I have a calendar on SharePoint online that I'm trying to use to track the amount of leave time employees use. Currently I'm capturing the number of hours daily that the employees are using a field on the event, but I would like to calculate the number of workdays in each event so that I can find out the total number of hours used by a given person.
I already assume I'm going to need another field to capture this, but how would I perform the calculation?
Below formula used to calculate working days, hope this helps.
=(DATEDIF([Start Date],[Due Date],"D"))-INT(DATEDIF([Start Date],[Due Date],"D")/7)*2-IF((WEEKDAY([Due Date])-WEEKDAY([Start Date]))<0,2,0)+1
To get the working days from event item between the 'from' and 'to' columns You can use the following formula:
=IF(ISERROR(DATEDIF(From,To,"d")),"",(DATEDIF(From,To,"d"))+1-INT(DATEDIF(From,To,"d")/7)*2-IF((WEEKDAY(To)-WEEKDAY(From))0),1,0)-IF(AND(NOT(WEEKDAY(From)=7),WEEKDAY(To)=7),1,0))
Related
We are trying to generate a report to find out turn around time (TAT) of our deliveries of orders, categorize them in different buckets like 0-5 days, 5-8 days, etc.
I am able to get the count of orders delivered within these buckets using the saved search formula (numeric) with summary type as sum:
Example:
case when trunc ({custbody_dlight_kspdeliverydate})-{trandate} between 0 and 5 then {quantity} else 0 end
Now, I also want to get percentage of orders delivered in each bucket. How can I get that?
Secondly, I also want to consider holidays while doing this TAT calculation. currently, delivery date - trandate will give me calendar dates only. If there is a weekend in between or a declared holiday, the result should be able to consider that. Please suggest.
Since you have a delivery date one way to get the number of business days between two dates would be to add another custom field and use a User Event script to update the TAT into that field.
This would let you use a calendar aware script that could manage not only weekends but also any statutory holidays.
I have a couple of SS1.0 examples of date calc scripts in the repo at https://github.com/BKnights/KotN-Netsuite that you could use as samples.
How do I filter data for specific individual dates in a PivotTable? The input is changed on a weekly basis and therefore the specific desired dates will change every week. I have data for every business day. And I want to retrieve data from the most recent business day, 5 business days before that, 30 business days before that and 90 business days before that. How do I go about this?
Sound like you want an 'Aging Report' If you Google on 'Excel Aging Report', you should be able to find something. use of TODAY() in formula is part of answer. I also did something similar here. It didn't involve Pivot tables.. But it should help you on your way.
You might want to check out the code in my answer at Filtering pivot table with vba
That code lets you programatically filter a Pivot RowField or ColumnField by specifying an interval type (e.g. days, weeks, months, quarters, years) as well as an interval count (e.g. 7, -7). It has an optional argument vRelativeTo field which counts back/foward from the youngest/oldest item depending on whether lNumber is positive/negative.
It leverages off the inbuilt DateFilters functionality, and as such does not
work on RowFields.
Im creating an excel pay sheet so i can keep tabs on my pay.
I have two pay rates,
£9.30 is paid for hours worked from 6pm to 8am Monday to Thursday
£10.30 is paid for hours worked from 6pm Friday to 8am Monday.
I have a column that displays the pay rate, i want this to populate automatically with excel looking at the day of the week and then the start time and then returning the correct pay rate.
For example,
If the day is a Mon and the start time is 6pm return £9.30
If the day is Fri and the start time is 6pm return £10.30 etc etc
Any one have any ideas on how i can achieve this? Id rather this be formula based instead of VBA if possible but if it cant be formula based then VBA it is.
Thanks in advance
I had to make a few assumptions because your question was unclear about the possible start times for your shifts. Your wording and examples lead me to believe that your shifts always begin at 6 PM regardless of the day. I created a possible solution or start to a solution based on that assumption that does not rely on VBA. I've included links to an excel workbook with my solution and a screen shot. (I'm only allowed 2 links with my current rep.)
As Gowtham Shiva suggested in the comments, a screen shot of what you have so far would be helpful.
I created two tables and a named ranged called “valDays”. To use the workbook, you enter the date and start time for your shift in tblPay. Enter the pay rate for a specific day and time in tblRates. valDays provides a way to convert the text for a day of the week into a number for calculating date/time serial numbers.
Feel free to comment/message me for clarification. I’ll do my best to reply and refine the solution as necessary. I hope you find this answer helpful and appreciate feedback. This is my first time providing an answer on Stack Overflow.
I’m going to assume you know how to name a range, create tables, and rename tables in excel. If you don’t there are plenty of YouTubers and bloggers that cover these topics quite well.
List the days in a column off to the right. (I used column K.) “Sun”, “Mon”, “Tue”, etc. Select all the cells with the days of the week and name the range “valDays”.
Formula in tblRates[Serial]:
“=MATCH(tblRates[[#This Row],[Day]],valDays,0)+tblRates[[#This Row],[Time]]”
Formula in tblPay[Serial]:
“=WEEKDAY([Date])+[StartTime]”
Formula in tblPay[Rate]:
“=INDEX(tblRates[Rate],MATCH([Serial],tblRates[Serial],0))”
You can download the excel document and view these screenshots of a possible solution.
Link to Excel Workbook on Google Drive
Screenshot1
I am using a sharepoint to list to track some data. I have a column called Training Start Time which is a date/time field. Then I have another column called Training End Time. In order to get the total duration, I am using a calculated field with the following code
=TEXT([Training End Time]-[Training Start Time],"h:mm")
This will be me the total duration. What I can't figure out how to do, is make a total field which gives me all the totals added up. So if someone enters 5 hours and another person adds in 3 hours, the field I need would give as an example 8 hours. Any help would be greatly appreciated.
You should be able to do it programmatically. A similar solution that uses JSLink is present here
http://social.technet.microsoft.com/wiki/contents/articles/30317.sharepoint-2013-displaying-sum-for-calculated-column-in-a-list-view-using-jslink.aspx
AFAIK, you cannot do this OOTB solution.
This is a multi-tiered project. Let me give a quick overview. I have attendance data, card/ timestamp punches. I would like to have a pivot table with slicers in Excel. Ideally you'd be able to choose a department / last name / associate number. And also a period of time. Ideally this would be a table with the company period/week. And maybe default to last weeks.
I can get at timecard data in two ways:
(1) generate a CSV that automatically performs the timecard math, to figure out how many hours someone worked and it is smart enough to understand 3rd shift workers. The format of that CSV is:
Last Name, First Name, Personnel Type, Associate Number, Facility, Department, TimeIn, TimeOut, Total Hours
The problem with this method is that I would have to manually append the information to the CSV tables. Or come up with some autoIT script.
(2) Get at the raw data via sql/odbc. This way the math is not done. It is just all of the associates timestamps. I would have to figure up the daily hours myself and figure out a 3rd shift formula too. It is not a set schedule, many people swing shifts and others get called in a lot.
Lastly, I would like to be able to filter the dates by using our company fiscal calendar. I have a spreadsheet that goes from 2000 to 2093. With everyday listed and it's corresponding year/period/week.
Example period info spreadsheet:
date Year Period week WeekTotal Period Total
12/3/2007 2008 1 1 2008.1.1 2008.1
12/4/2007 2008 1 1 2008.1.1 2008.1
I know there is a lot going on here, but what would be the best way to approach this project?
First I have not been able to post any script however the last I tried it I used two options 1. Was a php conversion where the time was numbers ( which makes it easier for calculations)
2. Was in the tables where I deliberately entered the values places the time in different columns or fields for hours, mins, and seconds this meant that while the input is eased I still have to calculate the output in php especially for totals, averages and differences.
Hope it helps a bit