0
votes

I'm looking for a formula that will return Yes or No value if the date in one cells falls within date range contained in 2 other cells. Example provided in attached image. Yes/No value returned in cell C2 determined if date contained in Cell C1 falls within date range contained in Cells A2 and B2

**Yes result in C3 is incorrect and should be a "No"

enter image description here

2
Do columns A and B contain dates (formatted numbers), or text-that-looks-like-dates?BigBen
@BigBen Columns A and B contain dates through formatted numbersMelissa
=IF(AND(C$1>=A2,C$1<=B2),"Yes","No")BigBen
That solved it - thanks so much @BigBen!!Melissa

2 Answers

0
votes

You need a VBA-Function:

Public Function F(ByVal D1 As Date, ByVal D2 As Date, ByVal D3 As Date) As Boolean F = (D1 <= D2) And (D2 <= D3) Exit Function End Function

You can call this function by

=F(A2;C1;B2)

0
votes

Use an IF statement in conjunction with AND. Something like the below should work (adjust range as necessary).

Formula: =IF(AND(C$1>$A2, C$1<$B2),"Yes", "No")

Output:

enter image description here