Calculating Workdays

nathansizemore

New Member
Joined
Dec 21, 2011
Messages
40
Hello,
I am needing some help calculating the number of working days between two dates, with the number of working days per week being variable.
Not sure Excel has a built in function for this? I have checkout out weekday, workday.intl, and networkingdays, but they do not offer exactly what I am wanting. If -

  • A1=Start Date
  • A2=End Date
  • A3=Number of Working days/week
    • 1=Mon
    • 4=Mon-Thurs
    • 7=Mon-Sun
If I did A2-A1, I could get the total number of days, but from that - how do I get the total number of those days that are working days, based on A3?

Thanks in advance for any help!
(Excel 2010)
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Just for the sake of anyone who may be searching for the same thing and wants the answer, what I figured out was use networkdays and have a separate sheet that contained all the Fridays for the next 5 years, all the Saturdays, and all the Sundays. Then I made it so that if(A3=4, networkdays(A1, A2, SELECTION_OF_FRIDAYS_SATURDAYS_AND_SUNDAYS), if(A3=5, networkdays(A1, A2, SAME_MINUS_FRIDAYS)......etc.
 
Upvote 0
(edited to improve clarity)
Actually, since you are using Excel 2010, it's much easier than you think.
With
A1: start date....01-Dec-2012
A2: end date.....10-Dec-2012
A3: workdays code...
Code:
1 means (Mondays only)
4 means (Mon-Thu)
7 means (Mon-Sun...all days)
anything else means standard work week (Mon-Fri)

This regular formula returns the count of work ays in that date range:
A4: =NETWORKDAYS.INTL(A1,A2,IFERROR(INDEX({"0111111","0000111","0000000"},MATCH(A3,{1,4,7},0)),1))

Note: the "0111111" codes flag 0's for workdays and 1's for non-workdays.

With
A3: 1....A4 returns: 2...Dec 3 and 10 are Mondays
A3: 4....A4 returns: 5...Dec 3,4,5 and 10 are Mon-Thu days
A3: 7....A4 returns: 8...Dec 3 thru 10 are Mon-Sun days
A3: 2....A4 returns: 6...Dec 3 thru 7 and 10 are standard Mon-Fri days

Is that something you can use?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top