Calculate number of working days between two dates

In SP2013 calendar list I have calculated column that calculates number of working days between two dates. It gives accurate number of working days until user puts weekend day as End date, than it calculates one more day (Saturday as working day). Code for calculated column is bellow:

``````=(DATEDIF([Start Time],[End Time],"D"))-INT(DATEDIF([Start Time],[End Time],"D")/7)*2-IF((WEEKDAY([End Time])-WEEKDAY([Start Time]))<0,2,0)+1
``````

Any advice what to change in formula or if you know where can I find working one?

``````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))