Function Problems

How to Return a Result When a Number Falls Within a Range in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 10, 2026 869 views

Question details

The user needs to look up and return a specific label from a column when a target value falls between a minimum and maximum limit specified in other columns.

How to Return a Result When a Number Falls Within a Range
Product
Spreadsheet
Device & OS
not provided
Scenario
Categorizing data, assigning grades, or applying pricing tiers based on a numeric value falling within specific upper and lower boundaries.
Observed behavior
The goal is to automatically output the correct category label by evaluating whether a target value is greater than or equal to a minimum limit and less than or equal to a maximum limit without overlapping errors.
Before you start

Ensure your minimum and maximum limits are clearly separated into two distinct columns and verify that your numerical ranges do not overlap.

Solution 1Recommended

Use INDEX and MATCH for Exact Range Boundaries

This method checks both the minimum and maximum columns simultaneously using Boolean logic to return the exact match.

By multiplying two logical conditions, Excel creates an array of 1s and 0s. The MATCH function then searches for the value 1 to locate the row where both conditions are true.

1
Select the destination cell

Click on the cell where you want the resulting label to appear.

2
Enter the INDEX and MATCH formula

Type the formula: =INDEX(D:D,MATCH(1,(A2>=E:E)*(A2<=F:F),0)). In this formula, column D contains the labels, A2 is your target number, column E is the minimum limit, and column F is the maximum limit.

3
Apply the formula

Press Enter to execute. Drag the fill handle down to apply the formula to other rows if necessary.

Use INDEX and MATCH for Exact Range Boundaries
Array Formula Requirement: In older versions of Excel, you may need to confirm this formula by pressing Ctrl+Shift+Enter instead of just Enter.
Advanced Spreadsheet Functions

Seamlessly Look Up Data Ranges with WPS Spreadsheet

WPS Office provides robust formula support, including fully functional INDEX, MATCH, and XLOOKUP functions, allowing you to easily categorize and extract data within specified ranges.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data ranges.
  2. 2. Select the output cell: Click on the specific cell where you want the matched label to be displayed.
  3. 3. Input your lookup formula: Type your preferred formula, such as =INDEX(D:D,MATCH(1,(A2>=E:E)*(A2<=F:F),0)).
  4. 4. Execute the calculation: Press Enter (or Ctrl+Shift+Enter for array formulas) to instantly categorize your data based on the defined limits.
Fully compatible with Microsoft Excel formulas and array operationsProcess complex calculations and large datasets quicklyFree to use with a familiar, user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my INDEX and MATCH formula return an #N/A error?

This usually happens if the target number does not fall within any of the specified ranges, if there are typos in your ranges, or if you forgot to use Ctrl+Shift+Enter to evaluate the array formula in older software versions.

Can I use VLOOKUP instead of INDEX and MATCH for number ranges?

Yes, you can use VLOOKUP with the approximate match argument set to TRUE. However, your reference table must be strictly sorted in ascending order by the lower boundary, and it does not check a secondary maximum column.

How do I prevent overlapping ranges from causing incorrect lookup results?

Ensure the maximum limit of one tier is strictly less than the minimum limit of the next tier. For example, use 0-10 and 11-20 instead of 0-10 and 10-20 to avoid ambiguity when the lookup value is exactly 10.