Use Excel IF and AND to Check a Number Range
Question details
The user needs a valid formula that tests whether a number falls between two limits and returns a result.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Check whether the value in AB4 is greater than 1 and less than 1.25, then return 17.25.
- Observed behavior
- The attempted formula uses invalid comparison syntax.
Identify the cell containing the number and decide whether either boundary should be included. The examples below use AB4 as the input cell.
Use AND Inside IF to Test Both Range Limits
Use this formula when a value must satisfy both the lower and upper limit.
In Excel, click the cell where you want the result to appear.
Type =IF(AND(AB4>1,AB4<1.25),17.25,"") and press Enter. Replace AB4 and the limits as needed.
Enter a value such as 1.1 in AB4. The formula returns the number 17.25; values outside the range, including 1 and 1.25, return a blank.

Check Number Ranges in WPS Spreadsheets
Use IF and AND in WPS Spreadsheets to test a value against two limits and return a result in an Excel-compatible workbook.
- 1. Open your workbook: Open WPS Spreadsheets and select Open to choose your workbook.
- 2. Select a result cell: Click the cell where you want the range-check result.
- 3. Enter the formula: Type =IF(AND(AB4>1,AB4<1.25),17.25,"") and press Enter.
- 4. Test and save: Enter a test number in AB4, check the result, and select Save.

Frequently Asked Questions
How do I include the boundary values in the range?
In the formula cell, use =IF(AND(AB4>=1,AB4<=1.25),17.25,""). The >= and <= operators include both endpoints.
How can I return different results for multiple ranges?
In the result cell, nest another IF function or use IFS where supported. Give each range its own AND test and corresponding result, and define the boundaries to avoid overlaps or gaps.
Why does Excel reject the formula even though the syntax looks correct?
Check the formula bar for missing parentheses or quotation marks. Depending on your regional settings, you may also need semicolons instead of commas between arguments and a different decimal separator.
What happens if AB4 is exactly 1 or 1.25?
With >1 and <1.25, neither endpoint meets the test, so the formula returns a blank. Change the relevant operator to >= or <= to include an endpoint.




