Formula Errors

Fix #N/A Error in INDEX and MATCH Pricing Formula in Excel

Bushra ParveenBushra Parveen Nov 3, 2026 870 views

Question details

The user needs to resolve an #N/A error that occurs when using an INDEX and MATCH formula to calculate pricing.

How to Fix the #N/A Error in an INDEX and MATCH Pricing Formula
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Setting up a two-way lookup for a pricing table using INDEX and MATCH with approximate matching criteria.
Observed behavior
The formula returns an #N/A error because the lookup range is not sorted correctly according to the chosen match type.
Before you start

Ensure you know whether your pricing model requires an exact match (0), a less than match (1), or a greater than match (-1), as this determines how your lookup data must be sorted.

Solution 1Recommended

Sort Values in Descending Order and Use Match Type -1

Fix the #N/A error by arranging your lookup array correctly to support the -1 approximate match type.

When using the MATCH function with the match_type set to -1 (greater than), Excel requires the lookup array to be sorted in descending order (largest to smallest). If the data is arranged randomly or in ascending order, the function fails to evaluate properly and throws an #N/A error.

1
Sort the lookup range

Select the header range containing your quantity or size values (e.g., B1:E1) and sort them in descending order.

2
Select the target cell

Click on the cell where you want the pricing result to be displayed.

3
Enter the corrected formula

Type the combined INDEX and MATCH formula using -1 for the approximate match and 0 for the exact match. For example: =INDEX(B2:E6, MATCH(B9, B1:E1, -1), MATCH(B8, A2:A6, 0)).

4
Execute the formula

Press the Enter key to apply the formula. The correct price will now display instead of the #N/A error.

Sort Values in Descending Order and Use Match Type -1
Understanding Match Types: Use 1 to find the largest value less than or equal to the lookup value (requires ascending sort), -1 for the smallest value greater than or equal to the lookup value (requires descending sort), and 0 for exact matches (no sorting required).
Powerful Spreadsheet Data Analysis

Use WPS Spreadsheet for Flawless INDEX and MATCH Formulas

WPS Spreadsheet provides robust formula support, intelligent syntax helpers, and real-time error checking, making it incredibly easy to build complex pricing models without running into frustrating #N/A errors.

  1. 1. Open your data in WPS: Launch WPS Spreadsheet and open your pricing table workbook.
  2. 2. Sort your arrays: Navigate to the 'Data' tab and use the Sort tool to arrange your columns or rows in descending order.
  3. 3. Input the formula: Select your output cell and start typing =INDEX. Follow the on-screen syntax prompts to build your lookup.
  4. 4. Calculate the price: Hit Enter to complete the formula and seamlessly retrieve your matched pricing data.
Fully compatible with Microsoft Excel formulas and functions (.xlsx)Intuitive formula hints and auto-completion to prevent syntax errorsEasy-to-use sorting tools to prepare lookup arrays instantlyFree and lightweight spreadsheet alternative
QA img-9

Frequently Asked Questions

Why does my INDEX and MATCH formula keep returning an #N/A error?

The #N/A error occurs when the MATCH function cannot find the lookup value. For exact matches (0), it means the value doesn't exist in the range. For approximate matches (1 or -1), it usually means the lookup array is not sorted correctly.

Can I use VLOOKUP instead of INDEX and MATCH for my pricing table?

Yes, VLOOKUP can be used if your lookup value is strictly in the first column of the range. However, INDEX and MATCH offer much more flexibility, such as conducting two-way lookups across both rows and columns simultaneously.

How do I find the closest match if the exact pricing tier isn't listed?

You can achieve this by using an approximate match. Set the MATCH function's third argument to 1 (and sort your data ascending) to find the next smallest value, or set it to -1 (and sort descending) to find the next largest value.