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

klitton7

New Member
Joined
Jul 24, 2024
Messages
24
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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,224,818
Messages
6,181,152
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