# Formula to Determine How Many Days From a Specified Date Range Appear in a Different Date Range?

##### New Member
Hi All,

I have a list of events with start date and end dates (sometimes these are single day events) but I need to know how many working days appear in a certain month.

For example someone has taken a holiday from the 29th of January to the 5th of February 2021 this is 6 working days but only 5 of those are in February.

Is there a formula I can apply that will take the start date and end date of the event then calculate how many working days in that range are from each month (so in the above example it would give me 1 for Jan, 5 for Feb, 0 for Mar etc.)?

Gav

### 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.

#### JamesCanale

##### Board Regular
Do you have 365? This takes EOMONTH. If not, you can replace eomonth with a somewhat more convoluted formula.

MrExcelPlayground.xlsm
ABCDEFGHIJKLMN
1StartEnd1/1/20212/1/20213/1/20214/1/20215/1/20216/1/20217/1/20218/1/20219/1/202110/1/202111/1/202112/1/2021
21/5/20211/10/2021400000000000
31/8/20211/8/2021100000000000
41/29/20212/4/2021140000000000
52/24/20216/3/2021032322213000000
Sheet45
Cell Formulas
RangeFormula
D1:N1D1=EOMONTH(C1,0)+1
C2:N5C2=MAX(0,NETWORKDAYS(MAX(C\$1,\$A2),MIN(\$B2,EOMONTH(C\$1,0))))

For older versions of excel:
MrExcelPlayground.xlsm
ABCDEFGHIJKLMN
7StartEnd1/1/20212/1/20213/1/20214/1/20215/1/20216/1/20217/1/20218/1/20219/1/202110/1/202111/1/202112/1/2021
81/5/20211/10/2021400000000000
91/8/20211/8/2021100000000000
101/29/20212/4/2021140000000000
112/24/20216/3/2021032322213000000
Sheet45
Cell Formulas
RangeFormula
C8:N11C8=MAX(0,NETWORKDAYS(MAX(C\$1,\$A8),MIN(\$B8,(DATE(YEAR((DATE(YEAR(C\$7),MONTH(C\$7),1)+32)),MONTH((DATE(YEAR(C\$7),MONTH(C\$7),1)+32)),1)-1))))

Last edited:

##### New Member
That worked brilliantly, thank you

Replies
4
Views
201
Replies
5
Views
290
Replies
0
Views
119
Replies
3
Views
46
Replies
5
Views
241

1,130,119
Messages
5,640,226
Members
417,131
Latest member
Seanr19871

### 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.

### Which adblocker are you using?

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

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