Forum Discussion
richzip505
Jul 06, 2023Copper Contributor
Calculate number of days, within a date range, that touch a specified month (or other period)
Hello,
I would like to know if a formula can be used to calculate the number of days, within a specified range that ALSO fall within a specific month (or "other" specified period)
See the example below. For the date range in columns A and B, I want to see how many days fall within Jan, Feb, Mar, and Apr. However, there is a twist -- the periods of Jan, Feb and Mar do not conform to the calendar months -- so in row 2, I specified the dates within those periods.
=MAX(MIN(C$3,$B4)-MAX(C$2,$A4)+1,0)
You can try this formula with the layout of the example which doesn't have merged cells and the dates in rows 2 and 3 are easier to reference.
2 Replies
Sort By
- OliverScheurichGold Contributor
=MAX(MIN(C$3,$B4)-MAX(C$2,$A4)+1,0)
You can try this formula with the layout of the example which doesn't have merged cells and the dates in rows 2 and 3 are easier to reference.
- richzip505Copper Contributor
OliverScheurich Thank you! That worked perfectly!