Fix an Excel Lookup Between Minimum and Maximum Values
Question details
Find a matching result when a value falls between a minimum and maximum in a lookup table.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A value in H9 must be checked against minimum and maximum limits on the Groups sheet, with the corresponding result returned from column C.
- Observed behavior
- The formula should return the result for a range containing the value, including its endpoints, or indicate when no range matches.
Check that Groups!A3:A4 contains minimum values, Groups!B3:B4 contains maximum values, and Groups!C3:C4 contains the corresponding results. Use semicolons or commas as formula argument separators according to your regional settings.
Use LOOKUP to Match Both Range Limits
Use this formula to return a result when the value in H9 is within a listed range.
In Excel, select the cell where you want the matching result to appear.
Enter =LOOKUP(2;1/((H9>=Groups!A3:A4)*(H9<=Groups!B3:B4));Groups!C3:C4). If Excel uses commas as argument separators, replace the semicolons with commas; leave the multiplication operator unchanged.
Press Enter and test a value in H9. In some older Excel versions, select the formula cell, press F2, and confirm with Ctrl+Shift+Enter if the formula does not calculate as expected.

Use XLOOKUP to Return a Custom No-Match Message
Use XLOOKUP in a version of Excel that supports it when you want a readable message for values outside all ranges.
Match Values to Ranges in WPS Spreadsheet
Use a LOOKUP formula in WPS Spreadsheet to check a value against minimum and maximum limits and return the corresponding result.
- 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
- 2. Check the lookup table: On the Groups sheet, verify that columns A and B contain the minimum and maximum values and column C contains the results.
- 3. Enter the formula: Select the result cell and enter =LOOKUP(2;1/((H9>=Groups!A3:A4)*(H9<=Groups!B3:B4));Groups!C3:C4), using commas instead of semicolons if required by your settings.
- 4. Test the result: Press Enter and change H9 to a value within a listed range to check the returned result.

Frequently Asked Questions
Are the minimum and maximum values included in the match?
Yes. The >= and <= comparisons include both endpoints. Change them to > or < if an endpoint should be excluded.
Why does the LOOKUP formula return #N/A?
No listed range may contain the value in H9. Check the limits on the Groups sheet and confirm that the value and limits are numeric.
Should I replace the multiplication sign when using semicolons?
No. Semicolons separate formula arguments; the * operator combines the two TRUE/FALSE tests. Leave it in place.
What happens if two ranges overlap?
The LOOKUP formula returns the last matching row, while the XLOOKUP formula shown returns the first. Adjust the ranges or choose the formula that gives the intended result.
Do I need to press Ctrl+Shift+Enter?
Try Enter first. In some older Excel versions, the LOOKUP array calculation may require Ctrl+Shift+Enter; select the formula cell and press F2 before confirming it.




