Formula Errors

How to Fix Excel INDEX and MATCH When the Lookup Value Is Not Found

Maira MehtabMaira Mehtab Oct 26, 2026 870 views

Question details

The user's INDEX and MATCH formula fails to return the expected result when looking up calculated text values like 'Current' or 'NA' in an unsorted dataset.

How to Fix Excel INDEX and MATCH When the Lookup Value Is Not Found
Product
Excel
Device & OS
not provided
Scenario
Using an INDEX and MATCH formula combination to retrieve a date based on a text criteria within a lookup column.
Observed behavior
The formula does not return the expected result or appears broken unless the lookup value is manually typed into the cell as plain text.
Before you start

Ensure that your lookup values do not contain hidden leading or trailing spaces, as these will cause exact match formulas to fail.

Solution 1Recommended

Use Exact Match (0) in the MATCH Function

Because the source data is unsorted, you must force MATCH to look for an exact match to prevent incorrect results or errors.

By default, if you do not specify a match type, the MATCH function assumes your data is sorted in ascending order and looks for an approximate match. For unsorted text data, this behavior will often return wrong values or fail entirely.

1
Locate your MATCH formula

Click on the cell displaying the error and look at the formula bar to find the MATCH segment of your formula (e.g., MATCH(D2, Weeks!A2:A18)).

2
Add the exact match argument

Add a comma and the number 0 at the very end of the MATCH function's parenthesis to specify an exact match. It should look like this: MATCH(D2, Weeks!A2:A18, 0).

3
Remove unnecessary arguments

If your INDEX array is only one column wide, you do not need a second MATCH function to identify the column number. Your final corrected formula should look similar to: =INDEX(Weeks!B2:B18, MATCH(D2, Weeks!A2:A18, 0)).

Use Exact Match (0) in the MATCH Function
Formula Update Successful: Adding the 0 guarantees that Excel will only return a value if it finds the exact text you are searching for, bypassing sorting issues.
Efficient Formula Troubleshooting

Fix Advanced Formulas Easily with WPS Spreadsheet

WPS Spreadsheet provides a powerful, user-friendly environment for working with advanced lookup formulas like INDEX and MATCH, offering flawless compatibility with Microsoft Excel files.

  1. 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open your .xlsx or .xls file containing the broken INDEX and MATCH formulas.
  2. 2. Use Formula Auditing tools: Navigate to the Formulas tab and select 'Evaluate Formula'. This tool lets you step through your INDEX and MATCH logic to spot exactly where the lookup fails.
  3. 3. Apply the exact match fix: Edit the formula directly in the formula bar, append the ', 0' argument to your MATCH function, and press Enter to calculate the correct date.
100% compatible with Excel formulas, including INDEX, MATCH, and VLOOKUPBuilt-in error checking auditing tools to easily identify #N/A or #VALUE! issuesFree and lightweight alternative for heavy data processing
microsoft office alternative - wps office

Frequently Asked Questions

Why does my MATCH function return #N/A when the value is clearly in the list?

This usually happens due to formatting differences between the lookup value and the source array. Hidden spaces, trailing spaces, non-breaking spaces, or numbers formatted as text are common culprits. Using the TRIM() function or ensuring exact formatting can resolve this.

When should I use 1, 0, or -1 in the MATCH function?

Use 0 for an exact match, which is essential when looking up text strings or unsorted data. Use 1 for the largest value less than or equal to the lookup value (requires data sorted in ascending order). Use -1 for the smallest value greater than or equal to the lookup value (requires data sorted in descending order).

Can I use XLOOKUP instead of INDEX and MATCH?

Yes, if your spreadsheet software supports it. XLOOKUP is a modern alternative that defaults to an exact match automatically and handles unsorted arrays perfectly, making it much easier to write and troubleshoot than INDEX and MATCH combinations.