How to Fix Excel VLOOKUP Returning #N/A Even When the Value Exists

Looking straight at product code 10482 in cell A2 and seeing the exact same 10482 in your lookup sheet, yet watching your VLOOKUP formula return #N/A anyway, drives Excel users mad. Excel never fails to match without a literal byte-level difference underneath: almost always, one cell holds hidden trailing spaces, stores numbers as plain text while the other stores real numeric values, or omits the FALSE exact-match argument.

Cause 1: Hidden Trailing Spaces After Imported Text or Codes

Data pasted from web portals, CSV downloads, or ERP exports regularly packs invisible spaces at the end (like "SKU-99 " vs "SKU-99"). They look identical on screen yet fail exact VLOOKUP matches.

  • Test quickly: Click a matching cell on both sheets and look at the formula bar at the top, or run =LEN(A2) beside both cells. If one returns length 7 and the other returns length 6, trailing spaces are breaking VLOOKUP.
  • Fix fast with TRIM: Insert a helper column beside your lookup key and run =TRIM(A2), then Copy > Paste Values over the original column (or wrap your lookup value directly inside =VLOOKUP(TRIM(A2), ...)).

Cause 2: One Column Stores Numbers While the Other Stores Text (Very Common)

Even if both cells show 004812 or 45109, Excel treats a numeric integer and a text string as completely unrelated values. Look for a tiny green triangle in the top-left corner of cells in one column – that marks a number stored as text.

  1. Highlight the entire lookup ID column showing green triangles.
  2. Click the yellow warning diamond beside the top cell and select Convert to Number.
  3. Even faster on huge sheets without green triangles: select the column, click Data > Text to Columns > Finish to convert text digits into genuine numbers instantly across thousands of rows.
  4. Conversely, if your IDs must preserve leading zeros like postcodes or staff numbers, keep both sheets formatted as Text so both strings match cleanly.

Cause 3: Forgot FALSE (or 0) as the Fourth VLOOKUP Argument

Writing =VLOOKUP(A2, Sheet2!A:D, 3) without the fourth argument tells Excel to assume your table is sorted alphabetically and perform an approximate search – returning wrong values or #N/A on unsorted tables.

  • Always add FALSE or 0 at the end for exact ID/name lookups:
    =VLOOKUP(A2, Sheet2!$A$2:$D$500, 3, FALSE)
  • Also notice the $ dollar locks on $A$2:$D$500! Without dollar signs, dragging the formula down shifts your lookup table downward row by row until values near the top drop out of range and return #N/A.

Cause 4: Lookup Column Is Not the Leftmost Column (Switch to XLOOKUP)

Classic VLOOKUP can only search the very first (leftmost) column of the range you pass it and return values to the right. If your lookup ID sits in Column C and you need to pull a name from Column A, VLOOKUP fails every time. In modern Microsoft 365 Excel and Excel 2021+, switch to XLOOKUP instead (=XLOOKUP(A2, Sheet2!C:C, Sheet2!A:A, "Not found")), which works left or right, defaults to exact match automatically, and never breaks when columns are inserted.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.