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?

Était-ce utile?

La 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)
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top