Fix VLOOKUP Returning #N/A in Some Excel Cells
Question details
Identify why a VLOOKUP formula returns #N/A in some rows but works in others.

- 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.
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.
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.
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.
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.
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.
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.

Correct the VLOOKUP range and match setting
Use this method if the key exists but the formula searches the wrong range or uses an approximate match.
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. Open the workbook: Launch WPS Spreadsheets, select Open, and choose the Excel workbook containing the VLOOKUP formula.
- 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. 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. 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.

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.




