How to Look Up Excel Prices by Product ID and Quantity Range
Question details
The user needs to return the correct price from a table where one product may have multiple rows, each with a different minimum and maximum quantity range. The lookup must match the Product ID and verify that the lookup quantity falls between those limits.

- Product
- WPS Office Spreadsheet
- Device & OS
- not provided
- Scenario
- A pricing table contains Product ID, Min Quantity, Max Quantity, and Price columns. The user enters a Product ID and an order quantity, and needs the matching tier price.
- Observed behavior
- The formula should return the price row where the Product ID equals the lookup ID and the quantity is greater than or equal to the minimum and less than or equal to the maximum.
Before writing the formula, confirm that the price table is arranged in separate columns for Product ID, Minimum Quantity, Maximum Quantity, and Price, and that the lookup Product ID and Quantity cells are available for direct references.
Use INDEX and MATCH with Multiple Conditions for Product ID and Quantity Range
Use this when you want one formula to match both the Product ID and the quantity band directly, without helper columns.
The MATCH function creates an array of 1s and 0s by multiplying three conditions: the Product ID matches, the quantity is at least the minimum, and the quantity is at most the maximum. INDEX then returns the price from the row where the first 1 occurs.
Click the cell where you want the matching price to appear.
Type =INDEX($D$3:$D$22,MATCH(1,($A$3:$A$22=G3)*($B$3:$B$22<=H3)*($C$3:$C$22>=H3),0)).
In older Excel versions that do not support dynamic arrays, press Ctrl+Shift+Enter instead of Enter. In Microsoft 365, Excel 2021, or WPS versions that support dynamic arrays, press Enter.
Confirm that the result shows the price from the row where Product ID matches G3 and H3 is between Min Quantity and Max Quantity.

Use XLOOKUP with Boolean Logic for Quantity Bands
Use this modern alternative in Excel 365, Excel 2021, or WPS Office versions that support XLOOKUP.
Use WPS Spreadsheets to Look Up Prices by Product ID and Quantity Range
WPS Spreadsheets can perform the same multi-criteria INDEX and MATCH lookup directly in your workbook. Open your pricing file in WPS Office, enter the formula in the result cell, and get the correct tier price without switching to another spreadsheet app.
- 1. Open WPS Spreadsheets: Launch WPS Office and open the workbook that contains your product pricing table.
- 2. Select the result cell: Click the cell where you want the matching price to appear.
- 3. Enter the INDEX and MATCH formula: Type =INDEX($D$3:$D$22,MATCH(1,($A$3:$A$22=G3)*($B$3:$B$22<=H3)*($C$3:$C$22>=H3),0)) and press Enter or Ctrl+Shift+Enter as required by your WPS version.
- 4. Verify the tier price: Check that the returned price matches the Product ID and the quantity band in your table.

Frequently Asked Questions
Why does my INDEX MATCH formula return #N/A?
#N/A usually means no row matches all conditions. Check that the Product ID is exactly the same in the lookup cell and the table, and that the quantity is greater than or equal to the minimum and less than or equal to the maximum. In older Excel versions, also confirm the formula was entered with Ctrl+Shift+Enter.
Do I need to press Ctrl+Shift+Enter for this formula?
In Microsoft 365, Excel 2021, and WPS versions that support dynamic arrays, you can press Enter. In older Excel versions, this is an array formula, so press Ctrl+Shift+Enter.
Can I use this formula when quantity ranges overlap?
Technically yes, but MATCH returns the first matching row. Overlapping quantity ranges can produce unreliable pricing, so it is best to keep each Product ID range unique and non-overlapping.
How can I avoid updating the row references every time my price table grows?
Convert the price table to an Excel Table and use structured references, or define named ranges for the Product ID, Min Quantity, Max Quantity, and Price columns, then replace the fixed ranges with those names.
Can I use this lookup in WPS Office Spreadsheets?
Yes. Open the workbook in WPS Office Spreadsheets, enter the INDEX and MATCH formula in the result cell, and use Enter or Ctrl+Shift+Enter depending on your WPS version and whether array entry is required.




