Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# How to get number of WORKDAYS between two dates in SharePoint calculated column

Posted on 2011-09-21
Medium Priority
5,470 Views
I need to count the number of WORKING days between two dates in a calculated column in SharePoint 2007. Does anyone know of a formula to do this? I know that "=DATEDIF(Column1, Column2,"d")" provides the total number of days, but the customer wants only the number of WORKING days, i.e. M-F. Excel has a formula for it...can't seem to find one for SharePoint though. Anybody?

0
Question by:cjones_mcse
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 4

Accepted Solution

leopolde earned 2000 total points
ID: 36577662
SharePoint 2007 doesn't provide a direct function to achieve what you need.

You can try the following formula in a calculated field:
=DATEDIF([Start Date],[Due Date],"D")-IF(WEEKDAY([Due Date])=7,FLOOR((DATEDIF([Start Date],[Due Date],"D")+WEEKDAY([Start Date]))/7,1)*2,FLOOR((DATEDIF([Start Date],[Due Date],"D")+WEEKDAY([Start Date]))/7,1)*2+1)+IF(WEEKDAY([Start Date])=7,2,1)

Or here is a shorter version, that I haven't tested as thoroughtly as the first one:
=DATEDIF([Start Date],[Due Date],"D")-FLOOR((DATEDIF([Start Date],[Due Date],"D")+WEEKDAY([Start Date]))/7,1)*2-IF(WEEKDAY([Due Date])=7,0,1)+IF(WEEKDAY([Start Date])=7,2,1)
0

LVL 4

Expert Comment

ID: 36592667
Did the formulas work for you?
0

LVL 10

Author Comment

ID: 36686916
I think they're going to work. Just having some trouble getting my formulas to ignore empty date fields and invert dates that end up being negative numbers. It's not always a start/end date, but the days between two board meetings which can occur before or after each other, i.e., board1 convenes on 2/1/11 and board2 convenes on 3/1/11 for item 1, but board1 convenes on 4/1/11 and board2 convenes on 3/1/11 for item 2. The formula for item 2's calculated column gives me a #NUM! error because the returned value is less than 0. Anyway, that wasn't part of my question and your answer does what I asked, so points to you! Thanks!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
###### Suggested Courses
Course of the Month4 days, 17 hours left to enroll