Solved

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

Posted on 2011-09-21
3
4,175 Views
Last Modified: 2012-05-12
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
Comment
Question by:cjones_mcse
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
leopolde earned 500 total points
Comment Utility
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

by:leopolde
Comment Utility
Did the formulas work for you?
0
 
LVL 10

Author Comment

by:cjones_mcse
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now