Quick answer

#N/A means “not available”: a lookup such as VLOOKUP, XLOOKUP or MATCH couldn’t find the value it was looking for. Usually the value isn’t in the list, or it is but doesn’t match exactly because of an extra space or a number stored as text. Fix the data first, and where a missing value is expected, wrap the formula in IFNA, as in =IFNA(VLOOKUP(A9,$A$2:$C$6,3,FALSE),"Not found").

#N/A is the error you meet most in lookups, and it often turns up where the value is plainly in the list. The causes are few, and each has a quick fix once you know which one you’re looking at.

What #N/A means

A lookup function searches one column for a value and returns something from the row where it finds it. When no cell in that column matches, it returns #N/A, “not available”, rather than guess. VLOOKUP, HLOOKUP, XLOOKUP, LOOKUP, MATCH and XMATCH all do this.

An error travels. Any formula that uses a cell showing #N/A shows #N/A as well, so one missing price turns the order total into #N/A too. Fix the first cell with the error, and the ones that depend on it clear by themselves.

The value isn’t in the lookup list

Say an order sheet looks up each product’s price from a price list. One order uses a code the price list doesn’t have:

P-107 isn't in the price list, so VLOOKUP returns #N/A. The other two codes are found and get their prices. The fix belongs in the data: add P-107 to the list or correct the code. In C10, =VLOOKUP(A10,$A$2:$C$6,3,FALSE) returns #N/A.

When the value is missing, add it to the list or correct the code that was typed. If missing values are normal, such as new products that aren’t priced yet, show a message instead of the error (see below).

A space or a number stored as text blocks the match

An exact-match lookup needs the two values to be identical, character for character, and two values that look the same on screen can differ in ways you can’t see.

An extra space

Codes pasted from an email or an export often bring a space along at the end. “P-104 ” with a space isn’t “P-104”, so the lookup misses it:

TRIM takes the space off before VLOOKUP searches. The code in A9 ends with a space, so it matches nothing. TRIM(A9) gives VLOOKUP plain P-104, and the price comes back. A space after the code: in C9, =VLOOKUP(A9,$A$2:$C$6,3,FALSE) returns #N/A. TRIM removes it: in C9, =VLOOKUP(TRIM(A9),$A$2:$C$6,3,FALSE) returns $54.90.

TRIM removes spaces at the start and end and leaves single spaces between words. Wrapping the lookup value in it, as above, fixes one formula. To fix the data itself, clean the column with TRIM and paste the results back as values.

A number stored as text

Staff numbers, account numbers and ZIP codes often arrive as text. The number 1045 and the text “1045” look the same, but a lookup treats them as different values. You can spot text by its position: it sits on the left of the cell, where numbers sit on the right, often with a small green triangle in the corner.

  • If the list holds numbers and the value you look up is text, convert it inside the formula: =VLOOKUP(VALUE(A9),$A$2:$C$6,3,FALSE).
  • If the list itself holds text, select the column, click the warning icon and choose Convert to Number.

VLOOKUP’s own causes

Approximate match by mistake

VLOOKUP’s last argument decides how it matches. FALSE means exact. Leave it out, or write TRUE, and VLOOKUP looks for an approximate match instead: it expects the first column sorted from smallest to largest, returns #N/A when the value is smaller than the first one in the list, and can return a wrong row from an unsorted list without any error at all. For codes, names and IDs, always end with FALSE.

The code isn’t in the first column

VLOOKUP searches only the first column of the range you give it. If the codes are in column B and the range starts at A, it searches the wrong column. Start the range at the column that holds the values you search for, or use XLOOKUP, which takes the search column and the result column separately.

The range moved when you filled the formula down

A range typed without dollar signs moves down a row each time you fill the formula down. After a few rows it no longer covers the top of the list:

Each copy looks one row lower, and P-101 falls out of the range. C10 searches A3:C7, so row 2 is left out. Lock the range as $A$2:$C$6, with F4 while you type it, and every row searches the whole list. In C10, =VLOOKUP(A10,A3:C7,3,FALSE) returns #N/A. Formula in C: C9 =VLOOKUP(A9,A2:C6,3,FALSE), C10 =VLOOKUP(A10,A3:C7,3,FALSE), C11 =VLOOKUP(A11,A4:C8,3,FALSE).

Type $A$2:$C$6 instead, or press F4 (Cmd+T on a Mac) with the cursor on the range, and fill down again.

The free lesson Look up a value with VLOOKUP practices exact matches and locked ranges. The VLOOKUP function page has the full syntax.

XLOOKUP and MATCH

XLOOKUP and MATCH fail for the same data reasons: a value that isn’t there, a trailing space, a number stored as text. Their defaults differ, though:

  • XLOOKUP matches exactly unless you ask otherwise, and it has its own argument for a value that isn’t found: =XLOOKUP(A9,$A$2:$A$6,$C$2:$C$6,"Not found").
  • MATCH does the opposite. Leave out its last argument and it looks for an approximate match in a list sorted from smallest to largest. Write 0 as the last argument for an exact match: =MATCH(A9,$A$2:$A$6,0). XMATCH matches exactly by default.

Show 0, a blank or a message instead

When a missing value is expected, IFNA shows something else in place of #N/A:

=IFNA(VLOOKUP(A9,$A$2:$C$6,3,FALSE),"Not found")

IFNA returns the lookup’s result when there is one and your second argument when the result is #N/A. Use 0 for a zero, "" for a cell that looks empty, or a short message. A zero can be mistaken for a real price, so a message is often clearer. IFNA has been in Excel since Excel 2013.

IFERROR works the same way but also hides #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!. Around a lookup that can hide a misspelled function name or a deleted column, so IFNA is the safer choice when the only error you expect is a missing value. The free lesson Replace an error with IFERROR covers when each is worth it.

Add up a column that contains #N/A

SUM returns #N/A when any cell in its range shows #N/A. To add up the rest, skip the error cells:

SUMIF adds every cell that isn't #N/A. SUM stops at the error and returns it. =SUMIF(B2:B4,"<>#N/A") adds $89.00 and $12.50 and leaves the missing price out. In B6, =SUMIF(B2:B4,"<>#N/A") returns $101.50.

=SUMIF(B2:B4,"<>#N/A") handles a range whose only errors are #N/A. If other errors can turn up too, =AGGREGATE(9,6,B2:B4) adds the range and skips every error: 9 asks for a sum and 6 says to ignore error values. A total that leaves out a missing price is still short, so fix the lookup when you can.

For the other error values and what each one means, see types of errors in Excel.

Frequently asked questions

How do I change #N/A to 0 in Excel?

Wrap the lookup in IFNA with 0 as the second argument, such as =IFNA(VLOOKUP(A9,$A$2:$C$6,3,FALSE),0). In XLOOKUP, put 0 in its fourth argument instead: =XLOOKUP(A9,$A$2:$A$6,$C$2:$C$6,0).

How do I show a blank instead of #N/A?

Use an empty text, "", as IFNA’s second argument: =IFNA(VLOOKUP(A9,$A$2:$C$6,3,FALSE),""). The cell looks empty, and SUM skips it.

Why does VLOOKUP return #N/A when the value is there?

The two values aren’t identical to Excel. Look for a space at the end of either one, a number stored as text on one side, a range that slid down when the formula was filled, or a missing FALSE at the end of the formula.

Why does XLOOKUP return #N/A?

It found no exact match in the lookup array. The causes are the same as for VLOOKUP, extra spaces and numbers stored as text in particular. Give XLOOKUP a fourth argument, such as “Not found”, to show something else.

How do I sum a column that has #N/A in it?

Use =SUMIF(B2:B20,"<>#N/A") to add every cell that isn’t #N/A, or =AGGREGATE(9,6,B2:B20) to skip every kind of error. A plain SUM returns #N/A.

What does N/A stand for in Excel?

Not available. Excel shows #N/A when a formula can’t find the value it needs, which in practice almost always means a lookup that found no match.