Function Problems

How to Do an Excel Two-Way Approximate Lookup for Width and Height

Emma BrownEmma Brown Nov 11, 2026 869 views

Question details

The user needs to find a specific price from a grid based on width and height limits using approximate matching.

How to Perform a Two-Way Approximate Lookup in Excel for Width and Height Pricing
Product
Excel
Device & OS
not provided
Scenario
Retrieving pricing data where the input dimensions (width and height) fall into specific tiered ranges (e.g., width > 2.0 and <= 2.5) rather than exact matches.
Observed behavior
The user needs a formula setup that correctly identifies the next larger boundary in both the row and column to retrieve the corresponding intersection price.
Before you start

Ensure your pricing table is organized with sorted boundary values in ascending order for both rows and columns. Make sure the lookup values use the exact same measurement units as the table headers.

Solution 1Recommended

Use Nested XLOOKUP Functions for Next-Larger Matching

The most efficient way to perform a two-way lookup for upper-bound tiered pricing.

XLOOKUP is a powerful function that allows for exact matches or the next larger item. By nesting one XLOOKUP inside another, you can simultaneously evaluate the width columns and height rows to locate the exact intersection price.

1
Prepare your data table

Ensure your row headers (e.g., Heights in B2:B4) and column headers (e.g., Widths in C1:L1) contain the upper limits of your pricing tiers, sorted in ascending order.

2
Select your target cell

Click the empty cell where you want the final calculated price to appear.

3
Enter the XLOOKUP formula

Type the nested formula: =XLOOKUP(D8, B2:B4, XLOOKUP(D7, C1:L1, C2:L4, 0, 1), 0, 1). In this formula, D8 is your target height, D7 is your target width, and the 1 specifies the 'exact match or next larger item' match mode.

4
Calculate the result

Press Enter. The inner XLOOKUP finds the correct column for the width, and the outer XLOOKUP uses that column array to find the correct row for the height.

Use Nested XLOOKUP Functions for Next-Larger Matching
Match Mode Parameters: The '1' parameter at the end of both XLOOKUP functions is critical. It tells Excel that if an exact match is not found, it should return the next larger item, which perfectly simulates an 'up to' boundary limit.
Efficient Spreadsheet Data Processing

Use WPS Spreadsheet for Advanced Data Lookups

WPS Office fully supports modern dynamic array functions including XLOOKUP and FILTER, allowing you to build complex two-way tiered pricing models seamlessly and efficiently.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open the workbook containing your pricing grid.
  2. 2. Apply XLOOKUP: Use the exact same nested XLOOKUP syntax to handle your height and width pricing lookup.
  3. 3. Process Data Instantly: Drag the formula down to automatically calculate and retrieve pricing for thousands of dimension combinations instantly.
Fully compatible with Microsoft Excel formulas, including nested XLOOKUP and dynamic arrays.Free to use with a lightweight installation and exceptionally fast processing speed.Intuitive UI that makes auditing complex formulas straightforward.Reliable cross-platform support for Windows, Mac, Linux, iOS, and Android.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my nested XLOOKUP returning an #N/A error?

An #N/A error usually means your input dimensions exceed the maximum values in your pricing table headers. Ensure your table covers the maximum possible inputs, or use the 'if_not_found' argument in XLOOKUP (the '0' in the examples) to handle these cases.

Does XLOOKUP require the row and column headers to be sorted?

While XLOOKUP does not strictly require sorted arrays for exact matches, using an approximate match (match mode 1 or -1) works best when your headers are organized in ascending order. This ensures the formula logically grabs the 'next larger item' based on your grid's visual structure.

Can I use INDEX and MATCH instead of XLOOKUP for two-way approximate matching?

Yes, you can use an INDEX/MATCH/MATCH formula. However, the MATCH function with match type 1 finds the largest value that is less than or equal to the lookup value. This means your table bounds must represent lower limits instead of upper limits, requiring you to restructure your pricing grid.