Question

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?

Was it helpful?

Solution

To calculate the number of workdays between two date, you could try the following formula, it will exculde weekends:

=(DATEDIF([Start Time],[End Time],"d"))+1-INT(DATEDIF([Start Time],[End Time],"d")/7)*2-IF((WEEKDAY([End Time])-WEEKDAY([Start Time]))<0,2,0)-IF(OR(AND(WEEKDAY([End Time])=7,WEEKDAY([Start Time])=7),AND(WEEKDAY([End Time])=1,WEEKDAY([Start Time])=1)),1,0)-IF(AND(WEEKDAY([Start Time])=1,(WEEKDAY([End Time])-WEEKDAY([Start Time]))>0),1,0)-IF(AND(NOT(WEEKDAY([Start Time])=7),WEEKDAY([End Time])=7),1,0)
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top