Calculate Business Days between 2 SharePoint Dates

IF(ISERROR(DATEDIF([StartDate],[EndDate],”d”)),””,(DATEDIF([StartDate],[EndDate],”d”))+1-INT(DATEDIF([StartDate],[EndDate],”d”)/7)*2-IF((WEEKDAY([EndDate])-WEEKDAY([StartDate]))<0,2,0)-IF(OR(AND(WEEKDAY([EndDate])=7,WEEKDAY([StartDate])=7),AND(WEEKDAY([EndDate])=1,WEEKDAY([StartDate])=1)),1,0)-IF(AND(WEEKDAY([StartDate])=1,(WEEKDAY([EndDate])-WEEKDAY([StartDate]))>0),1,0)-IF(AND(NOT(WEEKDAY([StartDate])=7),WEEKDAY([EndDate])=7),1,0))

The formula above, where [StartDate] and [EndDate] are SharePoint date columns, will calculate the difference in days and exclude Saturday and Sunday from the calculation. It will return a pure number.

I got it from https://stackoverflow.com/questions/61346718/how-to-get-difference-between-two-dates-in-sharepoint-calculated-column

Published by Joseph LeMay

Former IBM Notes Developer, now doing SharePoint

Leave a comment