Thursday, June 10, 2010

SharePoint 2010 Calculated Column - Get Days Left from Due date to current date

I was trying to Get day's remaining from the Due Date to current date using SharePoint calculated column in of our SPO2010 MileStone List.

I used ths technique to get days left

Create a dummy column Today with Single line of text

Create a DaysLeft calculated column
Enter this value in formula place
=(DATEDIF(Today,[DueDate],"d"))-INT(DATEDIF(Today,[DueDate],"d")/7)*2-IF((WEEKDAY([DueDate])-WEEKDAY(Today))<0,2,0)+1
Make the above output as Single Line text

Note: You should have column with name "DueDate"

After doing this, click Ok, than delete the column "Today". come back to your list, you will see number of days remaining under the column "DaysLeft"