Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint List Calculated Column excluding weekends

$
0
0

Hi All,

I am working on calculated field, where I am trying to exclude weekends and calculate workdays.

So far everything works good, except I keep get 1 day instead of 0 Days

It should be 0 day, for items that has been created less than 24hrs. 

here is my formula .

=IF(OR(ISBLANK([HDT Creation Date]),ISBLANK([HDT Completion Date])),"",IF(AND((WEEKDAY([HDT Completion Date],2))<(WEEKDAY([HDT Creation Date],2)),((WEEKDAY([HDT Creation Date],2))-(WEEKDAY([HDT Completion Date],2)))>1),(((DATEDIF([HDT Creation Date],[HDT Completion Date],"D")))-(FLOOR((DATEDIF([HDT Creation Date],[HDT Completion Date],"D"))/7,1)*2)-2),(((DATEDIF([HDT Creation Date],[HDT Completion Date],"D")))-(FLOOR((DATEDIF([HDT Creation Date],[HDT Completion Date],"D"))/7,1)*2)))&" days, "&TEXT(MOD([HDT Completion Date]-[HDT Creation Date],1),"hh "" hrs, "" mm "" mins"""))


Abenet


Viewing all articles
Browse latest Browse all 7589

Trending Articles