FormulaCraft

Fix the #N/A error

Excel & Google Sheets
Topic:VLOOKUP

What #N/A means

VLOOKUP returns #N/A when it cannot find the lookup value in the first column of your table range. The error means 'not available' — the match genuinely does not exist, or something is preventing the match from being recognised (a formatting difference, a hidden space, a number stored as text). No data is returned because no row was selected.

Common causes

Example fix

Broken
=VLOOKUP(A2,D2:F100,2,0)
Fixed
=VLOOKUP(TRIM(A2),$D$2:$F$100,2,0)

TRIM removes hidden spaces from the lookup value, and the absolute range ($D$2:$F$100) prevents the table from shifting when the formula is copied.

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How to fix it

  1. 1Verify the value exists: filter or Ctrl+F the lookup column for the exact lookup value. Check for typos.
  2. 2Strip hidden spaces: wrap both sides with TRIM. Change =VLOOKUP(A2,D:F,2,0) to =VLOOKUP(TRIM(A2),D:F,2,0) and apply TRIM to the source column if needed.
  3. 3Fix data-type mismatches: if the lookup column holds text-numbers, coerce your value with TEXT(A2,"0") or convert the column with Value Paste Special. If the column holds real numbers, wrap the lookup value with VALUE(A2).
  4. 4Lock the table range: replace =VLOOKUP(A2,D2:F100,2,0) with =VLOOKUP(A2,$D$2:$F$100,2,0) so copying the formula does not shrink the range.
  5. 5Make sure the search column is the first column in the range. If it is not, either reorder your data or switch to INDEX/MATCH which allows searching any column.
  6. 6Only use IFERROR to suppress the error after you have confirmed the #N/A is expected (e.g. truly absent items) — never use it to hide a bug.

Stop hunting errors by hand.

Upload your spreadsheet and the Auditor flags every #N/A and broken formula at once — or paste this one formula and get the fix explained.

Frequently asked

Should I just wrap the whole formula in IFERROR to get rid of the red cell?

Only after you have diagnosed why the mismatch happens. IFERROR hides #N/A but does not fix the underlying problem. If a row genuinely has no match and a blank or zero is the right result, then IFERROR or IFNA is appropriate.

Why does VLOOKUP find the value when I type it manually but not from the cell reference?

The cell likely contains invisible characters — a leading space, a non-breaking space, or a line break. Use TRIM(A2) in your formula and LEN(A2) to check the character count versus what you see.

My lookup column has numbers but the table stores them as text — how do I fix it quickly?

In Excel, select the text-number column, click the warning triangle, and choose 'Convert to Number'. In Google Sheets, multiply the column by 1 with a helper formula =B2*1 or use VALUE(B2) to convert.

More on VLOOKUP

See all →

Related formulas

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: