Forum Discussion
Hogstad_Raadgivning
Jun 18, 2021Iron Contributor
Month is true, when it it between a date range.
Hi,
I want the Month to be true. If one or more dates in a date range is in that month.
Please see excample file for details.
Best Regards
- Geir
In G8:
=IF(AND($E8<=G$4,$F8>=G$3),"T","F")
Fill to the right, then down or vice versa.
4 Replies
- PeterBartholomew1Silver Contributor
For the possible benefit of Excel 365 users, the following shows a spreadsheet in which the display is controlled by a check box and conditional formatting.
- PeterBartholomew1Silver Contributor
An Excel 365 formula that I like is
= LET( latestStart, IF(Start>monthBegin, Start, monthBegin), earliestEnd, IF(End<monthEnd, End, monthEnd), overlap, 1 + earliestEnd - latestStart, IF(overlap>0, overlap, "") )placed in a single cell and allowed to spill. The final line can be modified to give "T" and "F" if preferred.
In G8:
=IF(AND($E8<=G$4,$F8>=G$3),"T","F")
Fill to the right, then down or vice versa.
- Hogstad_RaadgivningIron ContributorThank you, it worked perfect.
- Geir