Spreadsheet error

How to fix the #N/A error

TL;DR

#N/A means the lookup value was not found in the source range. Fix: double-check the lookup value exists and the data types match, or wrap in IFNA to return a friendly default.

What it means

The #N/A error stands for "not available." It appears when a lookup function (VLOOKUP, HLOOKUP, MATCH, XLOOKUP) cannot find the value you asked it to find. It is not a broken formula — it is the formula correctly reporting "this does not exist."

Common causes

How to fix it

1.Wrap in IFNA for a friendly fallback

  1. Change =VLOOKUP(A2, B:D, 2, FALSE) to =IFNA(VLOOKUP(A2, B:D, 2, FALSE), "Not found")
  2. IFNA only catches #N/A, not other errors — safer than IFERROR which hides everything.

2.Check for whitespace and type mismatch

  1. Test with =TRIM(A2)=TRIM(B2) to see if whitespace is the issue.
  2. Test with =VALUE(A2)=B2 to see if number-vs-text is the issue.
  3. Fix by applying TRIM/VALUE at ingestion or wrapping the lookup: =VLOOKUP(TRIM(A2), B:D, 2, FALSE).

3.Use XLOOKUP with if_not_found

  1. XLOOKUP has a built-in fourth argument for when value is missing.
  2. =XLOOKUP(A2, B:B, C:C, "Not found")
  3. Cleaner than IFNA+VLOOKUP.

Example

Broken=VLOOKUP(A2, B:D, 2, FALSE)Fixed=IFNA(VLOOKUP(TRIM(A2), B:D, 2, FALSE), "")

Wrapped lookup in TRIM to remove whitespace and IFNA to return empty string instead of #N/A when genuinely missing.

Prevention

Related errors

#REF!#VALUE!#NAME?

Let FormulaPad debug it for you

Paste your broken formula and the error message — get a diff and an explanation in seconds.

Debug a formula