Forum Discussion
Felicity123
Oct 02, 2021Brass Contributor
Find if a date contained in one range is present in another range
I am trying to create a formula with a yes/no type outcome for the attached problem.
I have 2 date ranges and I want to know if any of the dates in the first range are contained within the second range.
I am using excel 2016 and do not want to use macros, just excel formulas.
Thank you!
Dates Proposed (Range 1): 01-Feb-21 to 07-Feb-21
Dates Expected (Range 2): 01-Jan-21 to 01-May-21
Question: Are any of the dates in range 1 in range 2? If so, then return "Y"
Must also work the same if there is overlap ie.
Dates Proposed (Range 3): 23-Dec-20 to 02-Jan-21
Dates Proposed (Range 4): 01-Jan-21 to 01-May-21
Felicity123 I believe this formula should work as desired:
=IF(OR(AND(B1<B2,C1<B2),AND(B1>C2,C1>C2)),"No","Yes")
2 Replies
- Riny_van_EekelenPlatinum Contributor
Felicity123 I believe this formula should work as desired:
=IF(OR(AND(B1<B2,C1<B2),AND(B1>C2,C1>C2)),"No","Yes")- Felicity123Brass ContributorThank you! Works perfectly!