I have a requirement to calculate the difference between the current day and due day . I used the below formula and i was able to get the date difference .

<xsl:value-of select="(number(ddwrt:DateTimeTick(ddwrt:Today())) - number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))))) div 864000000000" />

However I now want to get only the business days in the difference (ie: Sat and Sun is not to be included. Any hints?

  • Where is the formula? – Harshini Hegde Oct 15 '13 at 5:27
  • @robertlindgren I have a start time and end time in "Date and time" format and i want to calculate the difference between the 2 times in days,hours and minutes format in XSL. Are there any formula to calculate the number of days,hours and mins between 2 time? – George Nov 28 '14 at 12:50
  • May be this: sharepoint.stackexchange.com/questions/79507/… – Manu Apr 1 '15 at 9:40

The following should work:

 =IF(AND((WEEKDAY([End Date],2))<(WEEKDAY([Start Date],2)),((WEEKDAY([Start Date],2))-(WEEKDAY([End Date],2)))>1),(((DATEDIF([Start Date],[End Date],"D")+1))-(FLOOR((DATEDIF([Start Date],[End Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Start Date],[End Date],"D")+1))-(FLOOR((DATEDIF([Start Date],[End Date],"D")+1)/7,1)*2)))


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.