How to check if a date is between two dates in Excel
Formula (Excel and Google Sheets)
=IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No")Test both ends with AND: =IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No").
- Result on the example
- one result per row in
C2, filled down toC7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in C2, filled down to C7. Change any input and the result updates, or edit the formula to experiment.
How it works
AND is TRUE only when both tests pass: on or after the start date and on or before the end date. The boundary days count, so June 1 and June 30 are inside the promotion and May 31 and July 1 are not.
=IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No")Result"No"
B25/31/2026The value in B2.
$F$16/1/2026The value in F1.
B2>=$F$1FALSEThe >= operator tests at least.
$F$26/30/2026The value in F2.
B2<=$F$2TRUEThe <= operator tests at most.
AND(B2>=$F$1,B2<=$F$2)FALSEAND: TRUE if every argument is true.- logical1
B2>=$F$1FALSE - logical2
B2<=$F$2TRUE
- logical1
IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No")"No"IF: Returns one value if a test is true, another if false.- logical_test
AND(B2>=$F$1,B2<=$F$2)FALSE - value_if_true
"Yes"not used - value_if_false
"No"
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No"). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =AND(B2>=$F$1,B2<=$F$2) | FALSE, TRUE, TRUE…Different result | TRUE or FALSE, for filters and conditional formatting. Returns TRUE/FALSE. |
| =IF(MEDIAN($F$1,B2,$F$2)=B2,"Yes","No") | No, Yes, Yes… | MEDIAN returns the middle value of three, which is the date only when it lies inside the range. |
| =IF((B2>=$F$1)*(B2<=$F$2),"Yes","No") | No, Yes, Yes… | Multiplying the two tests is the same as AND, and it also works inside array formulas. |
Common mistakes
- With timestamps, June 30 at 3:00 PM is later than June 30 itself and fails
<=$F$2. UseB2<$F$2+1. - Dates typed into the formula as text, like
B2>="6/1/2026", compare a number with text and give the wrong answer. Keep the dates in cells or use DATE(2026,6,1).
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Check if a date is between two dates
C2, show "Yes" if the check-in date is from the promo start in F1 to the promo end in F2, both days included, and "No" otherwise. Fill down to C7.Questions
How do I count the dates between two dates?
=COUNTIFS(B2:B7,">="&F1,B2:B7,"<="&F2).
How do I check if two date ranges overlap?
They overlap when each one starts before the other ends: =AND(start1<=end2,start2<=end1).
How do I check if today falls between two dates?
Put TODAY() in the test: =IF(AND(TODAY()>=F1,TODAY()<=F2),"Promo on","Promo off").
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.