What is the formula to calculate working days between two dates on lists SharePoint? Keeping in mind that the working week here in Dubai is Sunday to Thursday - Fridays and Saturdays are the weekend. Please help. thanks
What is the formula to calculate working days between two dates with Fridays & Saturdays as weekend!
1 Answer
You can try this monstrosoty. Replace the date names (FirstDate
and SecondDate
) and the semicolons with commas if you get an error.
This tests for WEEKDAY = 6 and 7 which are fridays and saturdays.
=IF(ISERROR(DATEDIF([D;];[SecondDate];"d"));"";(DATEDIF([FirstDate];[SecondDate];"d"))+1-INT(DATEDIF([FirstDate];[SecondDate];"d")/7)*2-IF((WEEKDAY([SecondDate])-WEEKDAY([FirstDate]))<0;2;0)-IF(OR(AND(WEEKDAY([SecondDate])=6;WEEKDAY([FirstDate])=6);AND(WEEKDAY([SecondDate])=7;WEEKDAY([FirstDate])=7));1;0)-IF(AND(WEEKDAY([FirstDate])=7;(WEEKDAY([SecondDate])-WEEKDAY([FirstDate]))>0);1;0)-IF(AND(NOT(WEEKDAY([FirstDate])=6);WEEKDAY([SecondDate])=6);1;0))