SOLVED

Find if a date contained in one range is present in another range

Brass Contributor

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

2 Replies
best response confirmed by Felicity123 (Brass Contributor)
Solution

@Felicity123 I believe this formula should work as desired:

=IF(OR(AND(B1<B2,C1<B2),AND(B1>C2,C1>C2)),"No","Yes")

 

Thank you! Works perfectly!
1 best response

Accepted Solutions
best response confirmed by Felicity123 (Brass Contributor)
Solution

@Felicity123 I believe this formula should work as desired:

=IF(OR(AND(B1<B2,C1<B2),AND(B1>C2,C1>C2)),"No","Yes")

 

View solution in original post