For a range of dates determine the number of days in a specified Month

klitton7

New Member
Joined
Jul 24, 2024
Messages
18
Office Version
  1. 2019
Platform
  1. Windows
For the attached document, I need a formula that will look at a range of dates (columns C & D) and determine if the dates in the row are in the same month as appears in column B. I have added the expected results in column E. Thank you!
 

Attachments

  • 2.png
    2.png
    5.7 KB · Views: 15

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to the MrExcel forum!

Assuming the B1 date is the first of the month:

Book2
ABCDE
1Billing Perios:Jun-24FromThrough#Days
25/25/20246/1/20241
36/2/20246/8/20247
46/9/20246/15/20247
56/16/20246/22/20247
66/23/20246/29/20247
76/30/20247/6/20241
Sheet2
Cell Formulas
RangeFormula
E2:E7E2=MAX(0,MIN(D2,EOMONTH($B$1,0))-MAX(C2,$B$1)+1)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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