To check whether a value falls between two numbers in Excel, combine IF with AND and two comparisons.

The choice of comparison operators determines whether the range includes its endpoints, and a few variations handle reversed limits, text results, and dates.

Check whether a number is between two limits

Suppose cell A2 contains a score, the lower limit is 10, and the upper limit is 20.

Use:

=IF(AND(A2>=10,A2<=20),"Within range","Outside range")

AND returns TRUE only when both comparisons are true: the value is at least 10 and no more than 20.

IF then returns “Within range” when both conditions hold, or “Outside range” otherwise.

For example, values of 10, 15, and 20 return “Within range.” A value of 9 or 21 returns “Outside range.” This version includes both endpoints, so it is an inclusive range check.

Choose whether to include the endpoints

The operators set the boundary behavior.

Use >= and <= to include the lower and upper limits.

Use strict comparisons when values must be inside the range but cannot equal either limit:

=IF(AND(A2>10,A2<20),"Inside","At or outside boundary")

With this formula, 10 and 20 do not count as inside the range.

The same distinction matters for age cutoffs, discount thresholds, grading bands, and date windows.

Decide whether a value equal to a cutoff qualifies before choosing the operators.

Use cell references for changing limits

Putting the limits in cells makes the formula easier to update.

For example, enter the minimum in B2 and the maximum in C2, then use:

=IF(AND(A2>=B2,A2<=C2),"Within range","Outside range")

Copy the formula down a column to check more values in A.

If the limits should stay fixed as you copy the formula, make them absolute references:

=IF(AND(A2>=$B$2,A2<=$C$2),"Within range","Outside range")

The dollar signs keep the references on B2 and C2 when the formula is filled into other rows.

The value reference A2 remains relative, so it changes to A3, A4, and so on.

Return TRUE or FALSE without IF

If you only need a logical result for conditional formatting, filtering, or another formula, omit IF:

=AND(A2>=B2,A2<=C2)

This returns TRUE for values within the inclusive range and FALSE for values outside it.

The longer IF formula is useful when a person needs a readable label; the shorter check is useful when another calculation can use TRUE or FALSE directly.

Handle limits that might be entered in reverse order

If the lower and upper limits can be entered in either order, use MIN and MAX to normalize them:

=IF(AND(A2>=MIN(B2,C2),A2<=MAX(B2,C2)),"Within range","Outside range")

For example, if B2 is 20 and C2 is 10, the formula still checks whether A2 falls from 10 through 20.

Without this adjustment, a formula that assumes B2 is the minimum and C2 is the maximum would return unexpected results when those inputs are swapped.

Use OR when the value can fall in either range

Sometimes a value qualifies if it is in one range or another, such as a score from 0 to 10 or from 90 to 100.

Combine two range checks with OR:

=IF(OR(AND(A2>=0,A2<=10),AND(A2>=90,A2<=100)),"Qualifies","Does not qualify")

Each AND checks both boundaries for one interval.

OR returns TRUE if either complete interval matches.

This is different from using OR between the two comparisons for a single range: almost any number would be either above the minimum or below the maximum, so that test would not reliably identify values between them.

Check whether a date falls between two dates

Excel stores valid dates as serial numbers, so the same comparison pattern works for date ranges.

If A2 contains a date, B2 the start date, and C2 the end date, use:

=IF(AND(A2>=B2,A2<=C2),"In period","Outside period")

Format the cells as dates so the values are easy to read.

Make sure the entries are real Excel dates rather than text that only looks like a date.

If the checked cells contain times as well as dates, a value on the end date after midnight may be greater than the end-date cell.

To include the entire end date, compare against the start of the following day with an exclusive upper bound:

=IF(AND(A2>=B2,A2<C2+1),"In period","Outside period")

This assumes C2 contains a date with no time component and includes every time on that date.

Common problems and fixes

  • The formula returns FALSE for a value that looks in range: Check whether the value or limits are stored as text.

    Convert them to numbers or valid dates before comparing.
  • The formula uses commas but Excel shows an error: Some regional settings use semicolons between arguments.

    Try =IF(AND(A2>=B2;A2<=C2);"Within range";"Outside range").
  • The formula reports an unexpected result at a limit: Confirm whether the boundary should count.

    Inclusive checks use >= and <=; exclusive checks use > and <.
  • The limits may be swapped: Wrap the limit references with MIN and MAX.
  • A blank input receives a label: Add a blank check if empty cells should remain empty, as in =IF(A2="","",IF(AND(A2>=B2,A2<=C2),"Within range","Outside range")).

Excel and Google Sheets compatibility

IF, AND, OR, MIN, and MAX are supported by current desktop and web versions of Excel, including Excel for Microsoft 365, Excel 2024, Excel 2021, and Excel 2019.

Google Sheets supports the same formula patterns.

Argument separators can vary by spreadsheet locale, but the comparison logic is the same.