Function Problems

How to Lookup a Value Between Low and High Limits in Excel

Bushra ParveenBushra Parveen Oct 15, 2026 871 views

Question details

The user needs to retrieve a specific code from a table by determining if a search value falls precisely between explicitly defined lower and upper limits.

Product
Excel
Device & OS
not provided
Scenario
Assigning a classification code to a number when the lookup table has three columns: a low boundary, a high boundary, and the corresponding code.
Observed behavior
A standard VLOOKUP only checks the first column (lower limit) for an approximate match, failing to properly validate if the number actually exceeds the upper limit defined in the second column.
Before you start

Ensure your lookup data is organized into three distinct columns: lower limits, upper limits, and the result codes, and that your search values are ready in a separate cell.

Solution 1Recommended

Use INDEX and MATCH Array Formula

This method uses an array formula to evaluate both the lower limit and upper limit columns simultaneously, ensuring strict adherence to the defined boundaries.

By multiplying two logical conditions inside the MATCH function, Excel creates an array of 1s (True) and 0s (False). The MATCH function then searches for the value 1, pinpointing the exact row where the search value is both greater than or equal to the lower limit and less than or equal to the upper limit.

1
Set up your data

Place your lower limits in A2:A5, upper limits in B2:B5, and the output codes in C2:C5. Assume the value you want to search for is typed into cell E2.

2
Enter the INDEX and MATCH formula

Click on the cell where you want the result to appear (e.g., F2) and input the following formula: =INDEX($C$2:$C$5,MATCH(1,(E2>=$A$2:$A$5)*(E2<=$B$2:$B$5),0))

3
Confirm the array formula

If you are using an older version of Excel, you must press Ctrl+Shift+Enter to evaluate it as an array formula (curly brackets will appear around it). In newer versions of Excel or WPS Spreadsheet, simply press Enter.

Use INDEX and MATCH Array Formula
Absolute References: Using dollar signs ($) in the formula locks the lookup table range, allowing you to drag the formula down to calculate multiple search values in column E without shifting the table reference.
Advanced Spreadsheet Tool

Perform Complex Range Lookups Effortlessly in WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas like INDEX and MATCH, allowing you to solve complex data classification and lookup problems with ease.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and create a new blank spreadsheet or open your existing workbook.
  2. 2. Input Your Data: Format your table with lower limits, upper limits, and codes in separate columns.
  3. 3. Apply the Array Formula: Select the target cell, paste the INDEX and MATCH formula, and press Enter to instantly retrieve the correct code.
  4. 4. Drag to Fill: Use the fill handle to drag the formula down and automatically categorize all your search values.
Fully compatible with Microsoft Excel formulas and array logicHandles complex data processing smoothly and efficientlyFree and lightweight Microsoft Office alternativeFamiliar user interface for seamless migration
QA img-9

Frequently Asked Questions

Why does my INDEX and MATCH formula return a #VALUE! error?

This usually happens if the formula was not entered as an array in older spreadsheet versions. Try editing the cell and pressing Ctrl+Shift+Enter. Additionally, ensure that all the ranges (e.g., A2:A5 and B2:B5) are exactly the same size.

What if my search value doesn't fall into any of the specified ranges?

If the search value is outside all defined lower and upper limits, the MATCH function will not find a '1' and will return an #N/A error. You can wrap your entire formula in an IFERROR function, like =IFERROR(INDEX(...), "Not Found"), to handle this gracefully.

Can I use XLOOKUP for checking between two values?

Yes. If you have a newer version of Excel that supports XLOOKUP, you can use multiple criteria by multiplying the logical tests in the lookup_array argument: =XLOOKUP(1, (E2>=$A$2:$A$5)*(E2<=$B$2:$B$5), $C$2:$C$5, "Not Found").