Formula Errors

Fix VLOOKUP Returning #N/A in Some Excel Cells

Huma Ashraf ChHuma Ashraf Ch Dec 2, 2026 868 views

Question details

Identify why a VLOOKUP formula returns #N/A in some rows but works in others.

Fix VLOOKUP Returning #N/A in Some Excel Cells
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula uses a concatenated value such as $A2&F2 to look up records on the DrayConsolidation sheet.
Observed behavior
Some rows return a result, while others return #N/A, potentially because their lookup keys do not match.
Before you start

Open the workbook and identify the VLOOKUP formula, its lookup range, and the column containing the keys on DrayConsolidation. Check whether the formula is intended to find exact matches.

Solution 1Recommended

Compare and clean the concatenated lookup keys

Use this method when the lookup works for some rows but the generated key may differ from the stored key.

1
Display the generated key

In an empty cell on an affected row, enter =$A2&F2, adjusting the row number as needed. Compare the result with the expected key on the DrayConsolidation sheet.

2
Check for an exact match

In another empty cell, enter =MATCH($A2&F2,DrayConsolidation!$A$2:$A$1000,0), replacing the range with the actual key column. A #N/A result means that Excel did not find an exact match in that range.

3
Remove extra spaces

Use a helper column to clean each component before joining it, for example =TRIM(SUBSTITUTE(A2,CHAR(160)," "))&TRIM(SUBSTITUTE(F2,CHAR(160)," ")). Apply equivalent cleaning to the source key components, then compare the resulting keys.

4
Check value formats

Select the contributing cells and inspect their values in the formula bar. Make sure both sides build the key consistently, especially when numbers, dates, leading zeros, or text-formatted numbers are involved; use TEXT with an appropriate format if fixed formatting is required.

Compare and clean the concatenated lookup keys
Compare both sides: Cleaning only the lookup value may not help if the stored key also contains unwanted spaces or uses different formatting.
Work with spreadsheets in WPS Office

Troubleshoot VLOOKUP Keys in WPS Spreadsheets

Open your workbook in WPS Spreadsheets to inspect concatenated keys, test for exact matches, and adjust VLOOKUP formulas.

  1. 1. Open the workbook: Launch WPS Spreadsheets, select Open, and choose the Excel workbook containing the VLOOKUP formula.
  2. 2. Inspect the key: In an empty cell beside an affected row, enter =$A2&F2 and compare the result with the corresponding key on DrayConsolidation.
  3. 3. Test the match: In another empty cell, enter =MATCH($A2&F2,DrayConsolidation!$A$2:$A$1000,0), replacing the range with the actual key column.
  4. 4. Adjust the formula: Select the VLOOKUP cell and edit its formula so the lookup range starts with the key column and its fourth argument is FALSE. Correct inconsistent spaces or formatting in the keys as needed.
Inspect and edit VLOOKUP formulas in a familiar spreadsheet interfaceCompare concatenated lookup keys with helper cellsOpen and edit Microsoft Excel XLSX and XLS filesUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A when the value appears to be present?

The values may differ because of extra spaces, hidden characters, or inconsistent formatting. Display the generated key in a helper cell and compare it with the key in the first column of the lookup range.

How can I check whether a concatenated key exists?

Enter =MATCH($A2&F2,DrayConsolidation!$A$2:$A$1000,0) in an empty cell, replacing the range with the actual key column. A match returns its relative position; #N/A means no exact match was found in that range.

Does the lookup column have to be first in the VLOOKUP range?

Yes. VLOOKUP searches the first column of its table_array. Edit the range in the formula bar so it starts with the key column and includes the column containing the return value.

How do I keep the lookup range from shifting when I copy the formula?

Use absolute references in the table_array, such as DrayConsolidation!$A$2:$B$1000. You can then copy the formula down while keeping that range fixed.