Excel - Identify number of business days for a specific month within a weekly date range

Mgigarcia

New Member
Joined
Oct 28, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

Looking for some expert assistance from a specific use case.

I have a set of columns starting on Monday and a number under each one of those. I have a separate excel divided in columns per month.

16/10/2023: 25 hours (5 business days in October)
23/10/2023: 30 hours (5 business days in October)
30/10/2023: 40 hours (2 business days in October and 3 business days in November)
06/11/2023: 27 hours (5 business days in November)

I need to allocate the numbers of hours belonging to October and November from this list based on the business days (Monday to Friday) for the specific month.

According to the sample above my result should be:

October = 71. 25h first row, 30h second row and 16h third row where there are two months listed (40/5 * 2 business days and for October, 30th and 31st October)
November = 51. 24h third row where there are two months listed (40/5 * 3 business days for November, 1st, 2nd and 3rd November) and 27h fourth row where the whole week belong to November.

I am not managing to do the split in the week where there are days for two different months. Could someone help? Appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Please provide some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data, allowing us to copy/paste it to our Excel spreadsheets to work with the same data you are. As of October 2023, the latest version is 2.1. Instructions on using this tool can be found here: XL2BB Add-in

Note that this board also has a "Test Here” forum. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Thanks,

Doug
 
Upvote 0
Hi, I am unable to install the Add-in for security reasons. I am putting a sample of the table here with the manual formula I use to divide the days between different months. In the sample, the problematic column is Column E that contains 3 business days for October and 2 business days for November. Thank you very much.
ABCDEFGOctNovember
1
81​
59​
2=B4+C4+D4+(E4/5*3)=(E4/5*2)+F4+G4
3Date
08/10/2023​
15/10/2023​
22/10/2023​
29/10/2023​
06/11/2023​
13/11/2023​
4Hours
25​
21​
17​
30​
35​
12​
 
Upvote 0
I had to rearrange your data so my brain could process it. There is likely other ways to achieve the results, my steps led me to this...(y)
Cell Formulas
RangeFormula
B3:B20B3=A3+6
D3:H20D3=IFS(AND(MONTH($A3)=MONTH($B3),MONTH($A3)=D$2),$C3, MONTH($A3)=D$2,NETWORKDAYS($A3,DATE(YEAR($A3),MONTH($A3)+1,1)-1)*$C3/5, MONTH($B3)=D$2,$C3-C3,1,0)
A4:A20A4=A3+7

I hope this helps,

Doug
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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