Counting Days in Specific Month between Two Dates

acwhelan

New Member
Joined
Nov 1, 2011
Messages
24
Hello,

I am trying to determine a formula that will calculate the the number of days that fall within a certain month.

Example: April
04/24/201004/02/20112
03/02/201104/03/20113

<tbody>
</tbody><colgroup><col><col><col></colgroup>


I need to do this for the months of April to July so I can calculate a proration based on the days falling in a specific month.

Please assist :)
 
Just registered as well to say THANK YOU Biff! Made my day, even if i have no idea what the formula really does in it's singular steps....but will reach there one day ;) I loved the way it was visualized, result and formula, just had to adjust it to my needs, GREAT!
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Try this...

Sheet1

*ABCDE
1StartEnd1/1/20092/1/20093/1/2009
21/2/20091/2/2009100
31/16/20093/27/2009162827
42/3/20093/11/200902611

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 67px;"><col style="width: 67px;"><col style="width: 60px;"><col style="width: 60px;"><col style="width: 60px;"></colgroup><tbody>
</tbody>



This formula entered in C2:

=MAX(0,MIN(EOMONTH(C$1,0),$B2)-MAX(C$1,$A2)+1)

Copy across as needed then down as needed.

Note that the EOMONTH function requires the Analysis ToolPak
add-in be installed if you're using a version of Excel prior to
Excel 2007. If you enter the formula and get a #NAME?
error look in Excel help for the EOMONTH function. It'll tell you
how to fix the problem.

This is almost exactly what I needed. How would you count the number of workdays in a month using the same layout?
 
Upvote 0
Welcome to the forum.

Try this formula in C2:

=MAX(NETWORKDAYS(MAX(C$1,$A2),MIN(EOMONTH(C$1,0),$B2)),0)

If you care about holidays, you should use the NETWORKDAYS.INTL function which allows you to add a list of holidays.
 
Upvote 0
Welcome to the forum.

Try this formula in C2:

=MAX(NETWORKDAYS(MAX(C$1,$A2),MIN(EOMONTH(C$1,0),$B2)),0)

If you care about holidays, you should use the NETWORKDAYS.INTL function which allows you to add a list of holidays.

Thank You!
That worked perfectly! Thank you so much!. Maybe this post could be pinned as it is very helpful.
 
Upvote 0
Glad it worked for you! :cool:

The trouble with pinning useful threads is that there are so many of them here! :eek: A better way to search might be nice, but that would still be no guarantee of finding what you want. Worst case scenario, open a new thread and someone will spot it and respond to it. If you add to an old thread, it might not be seen.
 
Upvote 0
Welcome to the forum.

Try this formula in C2:

=MAX(NETWORKDAYS(MAX(C$1,$A2),MIN(EOMONTH(C$1,0),$B2)),0)

If you care about holidays, you should use the NETWORKDAYS.INTL function which allows you to add a list of holidays.

Thank you so much.. You are a genius i was searching for this formula for months for our budget report and had to manually calculate.
 
Upvote 0
I'm glad you found this useful! :cool:

Feel free to start a new thread if you can't find what you're looking for.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

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