Fix VLOOKUP #N/A Error When Lookup Value is a Formula Result
Question details
The user is experiencing an #N/A error when using VLOOKUP, specifically when the lookup value is generated dynamically by combining cells with a formula.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Attempting to retrieve data using VLOOKUP where the search key is generated by a formula (like CONCATENATE) rather than being manually entered text.
- Observed behavior
- The VLOOKUP function returns an #N/A error despite the visual result of the formula appearing to exactly match the data in the lookup array.
Ensure that your spreadsheet calculation options are set to 'Automatic'. Double-check that the visual output of your formula exactly matches the target text, as even a single hidden space or formatting difference can cause VLOOKUP to fail.
Clean and Trim the Lookup Formula Result
Remove hidden spaces and non-printable characters that often cause mismatches between dynamic formula results and static lookup arrays.
When you combine cells using functions like CONCATENATE or the '&' operator, any trailing or leading spaces from the original cells are carried over. VLOOKUP requires an exact match, so these invisible spaces will result in an #N/A error.
Edit the formula generating your lookup value to include the TRIM function. For example, change =A1&B1 to =TRIM(A1&B1).
If your data is imported from an external database or website, non-printable characters might be present. Update the formula to =CLEAN(TRIM(A1&B1)).
Use this new, cleaned cell as your lookup value, or embed it directly into your VLOOKUP formula: =VLOOKUP(TRIM(A1&B1), D:F, 2, FALSE).

Fix Data Type Mismatches (Text vs. Numbers)
Convert text-formatted formula results into numeric values to match the target lookup column.
Troubleshoot Formulas Seamlessly with WPS Office
WPS Spreadsheet provides excellent compatibility with all standard formulas, including VLOOKUP, TRIM, and VALUE. With its built-in Error Checking and Formula Evaluation tools, you can easily spot data mismatches and fix errors in seconds.
- 1. Open your document: Launch WPS Spreadsheet and open the file containing your problematic VLOOKUP formula.
- 2. Use Formula Evaluation: Navigate to the 'Formulas' tab and click on 'Evaluate Formula' to step through your VLOOKUP execution and see exactly where the mismatch occurs.
- 3. Standardize your data: Use the 'Text to Columns' feature under the 'Data' tab, or apply functions like TRIM to standardize your lookup arrays easily.

Frequently Asked Questions
Can VLOOKUP search for a value generated by another formula?
Yes, VLOOKUP perfectly supports using formula results as lookup values. The #N/A error usually stems from extra spaces, invisible characters, or data type mismatches rather than the fact that a formula was used.
Why does VLOOKUP work with manually typed text but not with my combined cell formula?
When combining cells using formulas, the software strictly evaluates the exact contents of the source cells, including trailing spaces. Manual typing typically omits these spaces, creating an exact match with the target array, while the formula output carries over the invisible errors.
How do I temporarily convert a formula result to static text to make VLOOKUP work?
Select the cells containing your formula results, copy them (Ctrl+C), right-click the same cells, and select 'Paste Special' > 'Values'. This converts the dynamic formulas to static text or numbers, which often helps isolate formatting issues.




