To check whether a value falls within a range in Excel, use =AND(A1>=low, A1<=high) or =IF(AND(A1>=low, A1<=high), "Yes", "No"). This formula returns TRUE or a custom label when the value is between two boundaries, inclusive. For a list of values, combine it with IF or COUNTIFS, or use conditional formatting to highlight matches. You will need Excel 2010 or later on Windows or Mac, or Excel for the web, and a basic understanding of cell references.

What You'll Need

  • Excel 2010 or later (Windows or Mac) or Excel for the web. The steps below work in all modern versions; menu labels may differ slightly by version, device or region.
  • A worksheet with at least one column of numbers to test and two cells (or hard-coded values) for the lower and upper limits.
  • Basic familiarity with typing formulas and using the fill handle.

Step-by-Step

  1. Set up your data. Put the values you want to test in column A, starting at A2. Enter the lower limit in cell D1 and the upper limit in D2. For example, A2=15, D1=10, D2=20.
  2. Write the basic AND formula. In B2, type =AND(A2>=D$1, A2<=D$2). Press Enter. The result is TRUE if A2 is between 10 and 20 inclusive, otherwise FALSE. The dollar signs lock the limits so you can copy the formula down without them shifting.
  3. Copy the formula down. Select B2, grab the fill handle (small square at the bottom-right corner of the cell), and drag down to the last row of your data. Every row now shows TRUE or FALSE for its own value.
  4. Return a custom label instead of TRUE/FALSE. Replace the formula in B2 with =IF(AND(A2>=D$1, A2<=D$2), "In range", "Out of range"). Copy down again. This is easier to read in reports.
  5. Count how many values fall in the range. In an empty cell, type =COUNTIFS(A2:A100, ">="&D1, A2:A100, "<="&D2). This counts every value in A2:A100 that is at least D1 and at most D2. Adjust the range to match your data.
  6. Flag only the rows that match (optional). Use conditional formatting: select your data range, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =AND($A2>=$D$1, $A2<=$D$2) and choose a fill colour. This highlights every in-range value without adding helper columns.
  7. Test edge cases. Enter a value exactly equal to D1 or D2. The formula should return TRUE because the comparison uses >= and <=. If you want an exclusive range (greater than low and less than high), change to > and <.

Common Mistakes

  • Forgetting absolute references. Without the $ signs, copying the formula down shifts D1 and D2 row by row, so later rows compare against empty cells. Use D$1 and D$2 or fully absolute $D$1 and $D$2.
  • Using the wrong comparison direction. Writing A2<=D1 instead of A2>=D1 reverses the logic and returns FALSE for valid values.
  • Mixing text and numbers. If A2 contains a number stored as text (often left-aligned), comparisons may fail or behave unexpectedly. Convert to numbers with Value or by using Text to Columns.
  • Hard-coding limits inside the formula. Typing =AND(A2>=10, A2<=20) works but is hard to update. Keep limits in separate cells so you can change them without editing every formula.
  • Using COUNTIF with two criteria. COUNTIF accepts only one condition; use COUNTIFS for a lower and upper bound.

Tips

  • Name your limit cells (Formulas > Define Name) so formulas read like =AND(A2>=Low, A2<=High).
  • Use IFS or nested IF to assign bands (e.g., Low, Medium, High) based on multiple ranges.
  • For a quick visual check, apply a two-colour scale or data bars via Conditional Formatting.
  • When sharing the workbook, keep the limit cells on the same sheet or use a named range so others can adjust them easily.
  • Test with a value just outside each boundary (e.g., 9 and 21) to confirm the formula rejects them.

Troubleshooting

  • Formula returns #VALUE!. One of the cells contains text that cannot be compared to a number. Check for stray spaces or non-breaking spaces and clean the data.
  • All results are FALSE. Verify the limit cells are numbers, not text. Also confirm the comparison operators are correct and the references point to the right cells.
  • Conditional formatting does not highlight. The formula in the rule must use relative references for the first cell of the selected range (e.g., $A2 if the range starts at row 2) and absolute references for the limits. Check the rule's Applies to range.
  • COUNTIFS returns 0 unexpectedly. Ensure the criteria strings are built correctly with ">="&D1 (no extra quotes around the cell reference). Also confirm the ranges are the same size.
  • Formula works in one row but not others. Look for missing dollar signs or a mix of relative and absolute references that shift incorrectly when copied.

Frequently Asked Questions

Can I use IN RANGE with text values?

Yes, but comparisons are alphabetical, not numeric. For example, =AND(A2>="A", A2<="M") returns TRUE for text starting with A through M. Be aware that Excel is case-insensitive for text comparisons by default.

How do I check if a value is between two numbers but exclude the boundaries?

Use strict inequalities: =AND(A2>D1, A2<D2). This returns TRUE only when the value is strictly greater than the lower limit and strictly less than the upper limit.

What is the difference between COUNTIFS and SUMPRODUCT for range checks?

COUNTIFS is simpler and faster for counting values between two limits. SUMPRODUCT with --(A2:A100>=D1), --(A2:A100<=D2) works too but is more prone to errors and slower on large datasets.

Can I apply an IN RANGE formula across multiple columns?

Yes. Use the same AND logic with references to each column, or combine conditions with * in SUMPRODUCT. For example, =AND(A2>=D$1, A2<=D$2, B2="Yes") checks both a numeric range and a text condition.

Why does my formula show TRUE for blank cells?

Blank cells are treated as 0 in numeric comparisons, so if your lower limit is 0 or negative, a blank may pass. Add A2<>"" to the AND condition to exclude blanks: =AND(A2<>"", A2>=D$1, A2<=D$2).

Does the IN RANGE formula work in Excel for the web and Google Sheets?

Yes, the AND, IF, and COUNTIFS functions behave the same in Excel for the web and Google Sheets. Menu locations for conditional formatting differ slightly, but the formula syntax is identical.