How to Fix Excel #N/A Errors with LOOKUP and Exact Matches
Question details
The user is experiencing #N/A errors when using the LOOKUP function to retrieve data, even when the lookup value appears to exist in the source table.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Pulling data from source tables based on a selected name using a LOOKUP formula.
- Observed behavior
- The formula =LOOKUP($FC$4,$R$4:$R$17,$S$4:$S$17) returns an #N/A error for certain names, despite testing different letter cases.
Ensure your dataset does not contain invisible formatting characters or leading and trailing spaces, which frequently cause exact-match lookup formulas to fail.
Use VLOOKUP for Exact Matches
Switch from the approximate LOOKUP function to VLOOKUP with the FALSE argument to force an exact match.
The standard LOOKUP function defaults to an approximate match and requires the lookup vector to be sorted in ascending order. If your data is unsorted, it will often return incorrect results or #N/A errors. Using VLOOKUP allows you to specify an exact match search, which is ideal for matching specific names.
Click on the cell containing your current LOOKUP formula that is returning the #N/A error.
Replace your existing formula with a VLOOKUP formula: `=VLOOKUP($FC$4,$R$4:$S$17,2,FALSE)`. The FALSE argument guarantees that the function will only return a result for an exact name match.
If you need to drag and fill the formula down multiple rows, adjust the absolute referencing to `=VLOOKUP($FC4,$R$4:$S$17,2,FALSE)` so the row number can change dynamically while keeping the table array locked.

Clean Data to Remove Hidden Spaces
Remove leading and trailing spaces that cause text mismatches in lookup formulas.
Fix #N/A Lookup Errors Easily with WPS Spreadsheet
WPS Spreadsheet provides powerful data analysis tools, including VLOOKUP, XLOOKUP, and built-in data cleaning features to quickly resolve formula #N/A errors without hassle.
- 1. Open your spreadsheet: Launch WPS Spreadsheet and open the file containing the lookup errors.
- 2. Check the error indicator: Select the cell with the #N/A error and click the Error Checking alert icon that appears next to it for context.
- 3. Apply the exact match formula: Replace the LOOKUP formula in the formula bar with `=VLOOKUP($FC$4,$R$4:$S$17,2,FALSE)` and press Enter.
- 4. Clean the source data: If the error persists, use the TRIM function or the 'Text to Columns' feature under the Data tab to eliminate hidden spaces causing the mismatch.

Frequently Asked Questions
Why does the LOOKUP function return #N/A even when the value exists?
The classic LOOKUP function expects the lookup vector to be sorted in ascending order. If it is not sorted, the formula might not find the correct value, resulting in an #N/A error. Furthermore, trailing spaces or mismatched data types can cause the lookup to fail entirely.
What is the difference between LOOKUP and VLOOKUP?
LOOKUP defaults to an approximate match and requires data to be sorted. VLOOKUP searches vertically down the first column of a table and allows you to specify whether you want an exact match (FALSE) or an approximate match (TRUE), making it much more reliable for exact text searches.
How do I fix #N/A errors if VLOOKUP still isn't working?
If VLOOKUP with the FALSE argument still returns #N/A, check for hidden spaces using the TRIM function, ensure the data types match perfectly (e.g., make sure numbers aren't formatted as text), and verify that your table array range is locked using absolute references (like $R$4:$S$17).




