Function Problems

How to Retrieve a Customer-Specific Price Using XMATCH and INDEX in Excel

John WilsonJohn Wilson Nov 10, 2026 869 views

Question details

The user needs to retrieve specific product prices based on two dimensions: the product reference (row) and the customer identifier (column).

Retrieve Customer-Specific Prices with XMATCH and INDEX in Excel
Product
Excel
Device & OS
not provided
Scenario
Managing a product catalog where different customers or client tiers have different pricing columns.
Observed behavior
The user requires an efficient formula that dynamically looks up the correct row and column intersection to return the correct price.
Before you start

Ensure your product catalog data is organized in a clear grid format, with product references in a single column and customer pricing tiers in the top header row. Verify that there are no merged cells within your lookup ranges.

Solution 1Recommended

Use INDEX and XMATCH for a Two-Way Price Lookup

Use a combination of INDEX to define the price grid, and two XMATCH functions to locate the exact row (product) and column (customer).

While XLOOKUP is powerful, performing a two-dimensional lookup (matching both a row and a column) is often handled more efficiently by combining INDEX with XMATCH. The first XMATCH finds the product's row, and the second finds the customer's column.

1
Select the target cell

Click on the cell where you want the customer-specific price to appear (for example, L4).

2
Enter the INDEX function

Start by typing =INDEX($C$4:$D$7, replacing the range with your actual price data grid (excluding headers and ID columns).

3
Add row XMATCH

Insert XMATCH(I4,$A$4:$A$7), to locate the specific product reference (I4) within the product list column ($A$4:$A$7).

4
Add column XMATCH

Insert XMATCH("price client "&K4,$C$3:$D$3) to match the customer name header. You can combine strings using the ampersand (&) to match your specific header format if needed.

5
Handle errors and complete

Wrap the entire formula in IFERROR to return a blank cell if no match is found. The final formula should look like: =IFERROR(INDEX($C$4:$D$7,XMATCH(I4,$A$4:$A$7),XMATCH("price client "&K4,$C$3:$D$3)),""). Press Enter and drag the fill handle down to apply it to other rows.

Use INDEX and XMATCH for a Two-Way Price Lookup
Dynamic Lookup: Using absolute references (with $ signs) ensures that your lookup ranges stay locked when you copy the formula down to calculate prices for multiple orders.
Advanced Lookup Formulas in WPS Spreadsheet

Effortlessly Manage Pricing Matrices with WPS Spreadsheet

WPS Spreadsheet fully supports modern dynamic array functions like XLOOKUP, XMATCH, and INDEX, allowing you to build responsive pricing calculators with ease.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your pricing matrix or catalog spreadsheet.
  2. 2. Input the Lookup Formula: Select the target cell and enter the identical INDEX and XMATCH formula to retrieve customer-specific prices.
  3. 3. Fill and Format: Drag the fill handle to apply the formula across your dataset, and format the resulting numerical values as currency.
Fully compatible with Microsoft Excel's advanced lookup functions like XLOOKUP and XMATCH.Lightweight software that processes large, complex pricing catalogs quickly.Familiar spreadsheet interface lets you seamlessly switch from Excel without retraining.
QA img-9

Frequently Asked Questions

Why does my XMATCH formula return an #N/A error?

This usually happens if the lookup value (product reference or customer name) does not exactly match the data in your lookup array. Check both your lookup value and your data ranges for hidden leading or trailing spaces.

Can I use MATCH instead of XMATCH for older spreadsheet versions?

Yes. XMATCH is a newer version that defaults to an exact match. If you are using an older version of Excel, you can use the traditional MATCH function by adding a 0 as the third argument to force an exact match, like MATCH(I4, $A$4:$A$7, 0).

How do I handle missing price data in the catalog?

Wrapping your main lookup formula in the IFERROR function, such as =IFERROR([formula], "Not Found"), ensures that missing data displays a clean, readable message or a blank cell instead of a confusing #N/A error code.