VLOOKUP Returns #N/A but the Values Match? The 6 Invisible Causes

Short answerWhen VLOOKUP or XLOOKUP returns #N/A on values that look identical, the two cells are not identical. The usual culprits are a trailing space, a nonbreaking space from a bank or web export, a number stored as text, a lost leading zero, a long ID cut to 15 digits, or a date stored as text. Prove which one with LEN() and CODE(), then fix it in a cleaning column you can rerun.

It is one of the most-asked spreadsheet questions on the internet, usually typed in frustration: the account number is right there, you can see it, and the lookup still says it does not exist. Microsoft's own community forum has threads titled almost exactly like that, years apart, with the same answers.

The frustration comes from one wrong assumption: that two cells that look the same are the same. A lookup compares characters and types, not appearances. Here is what is usually hiding.

1. A trailing or leading space

The most common cause. Exports pad fields, people paste with a space, a system adds one at the end. =LEN(A2) against =LEN(B2) shows it instantly: "612.00" is 6 characters, "612.00 " is 7.

2. A nonbreaking space (CHAR 160)

This is the one that wastes hours, because TRIM() does not remove it. Bank portals, payment dashboards and anything copied from a web page often use a nonbreaking space instead of a normal one. Test the last character with =CODE(RIGHT(A2,1)): 32 is a normal space, 160 is the nonbreaking one. Replace it first, then trim: =TRIM(SUBSTITUTE(A2,CHAR(160)," ")).

3. A number stored as text

One list holds invoice numbers as real numbers, the other as text. They print the same; they never match. =ISNUMBER(A2) on both sides tells you. Convert in a helper column, and do it on both lists the same way.

4. Leading zeros that disappeared

Customer ID 00731 becomes 731 when someone double-clicks a CSV and the spreadsheet decides it is a number. The other system still says 00731. The fix is upstream: import ID columns as text, never by double-clicking.

5. Long IDs rounded to 15 digits

Spreadsheets keep 15 significant digits. A 16- to 19-digit transaction ID opened as a number turns its last digits into zeros, silently. Two different payouts can end up with the same ID. Again: import as text.

6. Dates that are really text

03/04/2026 is March 4 in one locale and April 3 in another, and if one side is text the comparison fails even when the day is right. Parse dates with explicit rules instead of letting the computer guess.

Check it in ten seconds

Paste the two stubborn values below. The detector shows every character, including the invisible ones. It runs in your browser; nothing is sent anywhere.

Hidden Difference Detector

From It Looks the Same but Doesn't Match, chapter 1 · runs in your browser

Try an example: trailing space · accents and case · nonbreaking space · parentheses

The fix that survives next month

Fixing the cell by hand works once. Next month the export arrives with the same problem and you lose the same hour. The durable approach is to keep the raw file untouched, import every column as text, and clean in visible formula columns: one column per rule, so anyone can see what changed and rerun it on the next export.

These six causes are half of the story. Accents and spelling variants of the same name, duplicate and overlapping rows, and one payment that is really several (or several that are really one) break matches too, and they need matching rules, not cleaning.

Sources: Microsoft Tech Community, “Used XLOOKUP and came back with result #N/A although text fields are the same” (techcommunity.microsoft.com); spreadsheet precision limit of 15 significant digits, Microsoft Excel specifications.

The Operator Library · 5 field manuals · $29.99 eachFind your book →