VLOOKUP returns #N/A: the 5 real causes and the fix for each

You can see the value in the source data. You are looking straight at it. VLOOKUP still returns #N/A. The formula is not broken — it is telling you, accurately, that no match was found, and the interesting question is why Excel disagrees with your eyes.

Five causes account for almost every case. Work through them in this order.

1. The lookup value is not in the first column of the range

VLOOKUP only searches the leftmost column of the range you give it. If your IDs sit in column C and your range starts at column A, it is searching column A and will never find them.

Test: look at the first argument of your range. Is that the column containing the lookup value?

Fix: start the range at the column holding the key — =VLOOKUP(A2,$C$2:$F$500,2,FALSE) — or switch to XLOOKUP, which takes the lookup column and return column separately and does not care about their order:

=XLOOKUP(A2, $C$2:$C$500, $F$2:$F$500, "Not found")

2. Text that looks like a number

The single most common cause in real workbooks. The ID 00451 imported as text in one sheet and as the number 451 in the other. They display almost identically. Excel treats them as unrelated values.

Test: in a spare cell, run =ISTEXT(A2) against both the lookup value and the source key. Different answers mean this is your problem. A quiet second clue: numbers stored as text align left by default, real numbers align right.

Fix: convert the whole column rather than patching the formula. Select it, then Data > Text to Columns > Finish — the fastest bulk conversion in Excel. To force it inside the formula:

=VLOOKUP(VALUE(A2), $C$2:$F$500, 2, FALSE)     'text key, numeric source
=VLOOKUP(TEXT(A2,"00000"), $C$2:$F$500, 2, FALSE)  'numeric key, text source

3. Invisible characters

Trailing spaces, and the non-breaking space (CHAR(160)) that arrives with anything copied from a web page or a PDF. Completely invisible, and fatal to an exact match.

Test: =LEN(A2) against =LEN(C2). If the lengths differ but the text looks identical, you have found it.

Fix: clean both sides. TRIM alone will not remove CHAR(160), so substitute it first:

=TRIM(SUBSTITUTE(CLEAN(A2), CHAR(160), " "))

Do this once in a helper column and look up against that, rather than nesting the cleanup inside every formula on the sheet.

4. Approximate match on unsorted data

Omit the fourth argument and VLOOKUP defaults to TRUE — approximate match — which requires the first column to be sorted ascending. On unsorted data it returns #N/A, or worse, the wrong value with no error at all.

Fix: always pass FALSE explicitly unless you are deliberately doing a banded lookup (tax brackets, shipping tiers, grade boundaries). =VLOOKUP(A2,$C$2:$F$500,2,FALSE). Make it a habit and this cause disappears permanently.

5. The range shifted when you dragged the formula

Written as C2:F500 without dollar signs, the range moves down with every row you fill. By row 200 it is searching C200:F698 and the early matches have fallen off the top.

Test: the first few rows return correct values and the errors start partway down. That pattern is diagnostic.

Fix: lock the range with $C$2:$F$500 — select the reference in the formula bar and press F4. Better still, convert the source to a proper Table (Ctrl+T) and reference it by name; table references never drift and they expand automatically when rows are added.

Hiding #N/A, once you know why it is there

Only after diagnosing the cause should you suppress the display:

=IFNA(VLOOKUP(A2,$C$2:$F$500,2,FALSE), "Not found")

Use IFNA rather than IFERROR. IFERROR swallows every error type, including the #REF! and #VALUE! that indicate a genuinely broken formula. Wrapping a whole model in IFERROR is how silent wrong numbers reach a board pack.

The one-minute diagnostic

Next time, in a spare cell, run these three against a failing pair before touching the formula:

=ISTEXT(A2)  vs  =ISTEXT(C2)     'cause 2
=LEN(A2)     vs  =LEN(C2)        'cause 3
=EXACT(TRIM(A2), TRIM(C2))       'confirms a clean match exists

Those three answers narrow it to one cause almost every time.

The full diagnostic protocol for formula failures — plus prompts for circular references, INDEX/MATCH breakdowns, slow workbooks and dates stored as text — is in The AI Copilot for Excel Power Users.