Function Problems

Fix Excel VLOOKUP #N/A Errors with Text and Numbers

Phi Hung VoPhi Hung Vo Dec 2, 2026 869 views

Question details

Find an exact VLOOKUP match when lookup values contain text, numbers, or both.

Fix Excel VLOOKUP #N/A Errors with Text and Numbers
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user is looking up a value in a table whose keys may contain letters or numbers.
Observed behavior
VLOOKUP returns #N/A when it cannot find a matching value, potentially because of different data types, spaces, or hidden characters.
Before you start

Identify the lookup value, the table's lookup column, and the column containing the result. Check whether the keys are numeric values, numbers stored as text, or identifiers with meaningful leading zeros.

Solution 1Recommended

Clean both lookup values and use an exact match

Use helper columns to remove common hidden characters and compare keys as text.

In this example, column A contains the original keys, column B contains the results, and E2 contains the value to find. TRIM also collapses repeated internal spaces, so check that those spaces are not significant to your keys.

1
Clean the table keys

In C2, enter =TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))) and fill the formula down alongside the data in column A. This replaces nonbreaking spaces, removes common nonprinting characters, and trims spaces.

2
Place results beside the cleaned keys

In D2, enter =B2 and fill the formula down. The lookup range C:D now starts with the cleaned keys and has the desired results in its second column.

3
Clean the lookup value

In F2, enter =TRIM(CLEAN(SUBSTITUTE(E2,CHAR(160)," "))) to apply the same cleanup to the value you want to find.

4
Run the exact lookup

In a result cell, enter =VLOOKUP(F2,C:D,2,FALSE). The FALSE argument requests an exact match in the first column of C:D.

Clean both lookup values and use an exact match
Preserve meaningful zeros: If a key such as 0010 is an identifier, keep it as text on both sides. A numeric value of 10 does not retain its original leading zeros.
Work with lookup formulas in WPS

Clean and match lookup values in WPS Spreadsheets

Use WPS Spreadsheets to clean lookup keys in helper columns and run an exact-match VLOOKUP on an Excel workbook.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Clean the table keys: With keys in column A and results in column B, enter =TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))) in C2 and fill down. Enter =B2 in D2 and fill down to place the results beside the cleaned keys.
  3. 3. Clean the lookup value: If the lookup value is in E2, enter =TRIM(CLEAN(SUBSTITUTE(E2,CHAR(160)," "))) in F2.
  4. 4. Find the match: In a result cell, enter =VLOOKUP(F2,C:D,2,FALSE). Check that the cleaned key exists in column C if the formula still returns #N/A.
Clean spaces and common hidden characters before a VLOOKUP.Use an exact-match formula to compare text or numeric keys.Open and save Microsoft Excel XLSX files.Work in a familiar spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A for a number that appears in the table?

The lookup value may be a number while the table key is stored as text. Use helper cells with VALUE for genuinely numeric keys, or clean both sides as text before using VLOOKUP.

Does Excel VLOOKUP distinguish between uppercase and lowercase letters?

No. An exact-match VLOOKUP with FALSE is not case-sensitive, so it treats name1 and NAME1 as a match.

Why does TRIM not remove every hidden space?

Excel TRIM does not remove nonbreaking spaces by itself. Replace them first with SUBSTITUTE(A2,CHAR(160)," "), then apply CLEAN and TRIM as needed.

Can VLOOKUP match an identifier containing letters and numbers?

Yes. Keep the identifier as text on both sides, clean unwanted spaces or hidden characters, and use FALSE as the final argument, such as =VLOOKUP(F2,C:D,2,FALSE).

What if the formula still returns #N/A after cleaning?

Check that the cleaned lookup value exists in the first column of the selected table range. Also verify that significant characters, including leading zeros, match on both sides.