AnsweredAssumed Answered

sharepoint calculated field

Question asked by wassim.ghadban@snclavalin.com on Oct 25, 2014

f Could you please assist me in creating the calculated field in sharepoint that returns the number of working days between two dates excluding the weekend?

I have set the regional settings of my sharepoint as shown below (weekend is Friday and Saturday):

 

 

 

I used the two famous formulas from the link that you sent me

Formula1:

=DATEDIF([Startdate],[Enddate],"D")-IF(WEEKDAY([Enddate])=7,FLOOR((DATEDIF([Startdate],[Enddate],"D")+WEEKDAY([Startdate]))/7,1)*2,FLOOR((DATEDIF([Startdate],[Enddate],"D")+WEEKDAY([Startdate]))/7,1)*2+1)+IF(WEEKDAY([Startdate])=7,2,1)

 

 

Formula 2:

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

 

 

Both formulas give wrong results

Outcomes