Calculate the number of workdays in a given month

OverKnight

New Member
Joined
Jun 13, 2011
Messages
10
I am using the following formula to calculate the number of workdays (Monday through Friday) to date in a given month:
INT((T$4-WEEKDAY(T$4-S5)-DATE(YEAR(T$4),1,-7))/7)-SUMPRODUCT((WEEKDAY(T$5:T$10,2)=S5)*(YEAR(T$5:T$10)=YEAR(T$4))*(T$5:T$10<=T$4))
I was using this formula in a worksheet I updated monthly, but now I need to be able to compare monthly to year-to-date. This formula is in P19:P23, with S5:S10 updated for each row.
• T4contains yesterday’s date (yesterday, because the data on this sheet are updated the following day).
• S5:T10 contains the legal holidays for the year.

I would like to be able to change this formula to show the number of workdays in a given month. This formula is currently returning 9, 8, 8, 8 and 8 for Monday through Friday, which is correct for the first two months of 2016. The correct values for February are 5, 4, 4, 4 and 4. I’d guess a start and end date needs to be added to this formula, but if this is the correct approach, I have no idea how to do this. I searched for this, but could not find a solution that lists each day of the week. Can anyone recommend a solution?

Thank you.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

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