Why VLOOKUP Returns #N/A
About this lesson
#N/A means VLOOKUP searched and did not find a match. There are only four reasons that ever happens.
- name the four reasons a VLOOKUP returns #N/A.
- fix a lookup that misses because of text-stored numbers or a trailing space.
- write a lookup that says Not found instead of showing an error.
The idea
Four, and the lesson makes you fix each one. The value really is not in the list. It is there as a number stored as text, which looks the same on screen and is not equal to the number you typed. It is there with a trailing space from a copy-paste, which looks the same too. Or the column you are searching is not the first column of the range you gave. VLOOKUP only ever searches the first one. That is the whole set. #N/A is also the only Excel error that is often correct. Sometimes the answer really is "not on the list". A sheet that says so in words is better than one showing an error code to somebody who does not read error codes.
The mistake to watch for
Using IFERROR before finding out why. #N/A from VLOOKUP has four usual causes. The value really is absent. It is a number stored as text on one side only. The lookup column is not the first column of the table. Or a trailing space makes two identical values unequal. Three of those are fixable. Only the first deserves a friendly message. IFNA, not IFERROR, is the wrapper that leaves the others visible.
Read more about this
Where this comes up again
This lesson needs JavaScript to run. Everything below is the lesson in full, but you cannot type into the grid or be marked.
The consignment numbers are in column A.
In D2, type:
=VLOOKUP(2043,A1:C5,2,FALSE)
That is the destination of consignment 2043.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Ref | Destination | Weight kg | ||||
| 2 | 2041 | Leeds | 2.4 | ||||
| 3 | 2042 | Bristol | 1.1 | 9051 | |||
| 4 | 2043 | Cardiff | 4.75 | 2043 | |||
| 5 | 2044 | Norwich | 0.9 | ||||
| 6 | Bristol | ||||||
| 7 | |||||||
| 8 |
Every step
-
The consignment numbers are in column A. In
D2, type:=VLOOKUP(2043,A1:C5,2,FALSE). That is the destination of consignment 2043. -
D3shows #N/A because it looks upE3, and 9051 is not on the manifest. InD3, look up 2044 instead. -
D4shows #N/A even though 2043 is on the manifest.E4was imported and holds 2043 as text, not a number. InD4, wrapE4inVALUEso the lookup sees a number. -
D5looks up Cardiff and shows #N/A.VLOOKUPonly searches the first column of its range. InD5, give it a range that starts at the Destination column. Remember: count the return column from the start of the range. -
The last cause hides best.
E6holds a destination with a space on the end. InD6, look up the weight for the destination inE6. Shape:=VLOOKUP(TRIM(cell), table, col, FALSE). -
Sometimes #N/A is the right answer, and it needs saying in words. In
D7, look up the destination of 9051 withIFNAaround the lookup. Shape:=IFNA(lookup, if_not_found). Show Not on the manifest when it is not found.