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.
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.
Start with one that works. The consignment numbers are in column A. In D2, look up the destination of consignment 2043.
To begin, type it exactly:
=VLOOKUP(2043,A1:C5,2,FALSE)
| 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
-
Start with one that works. The consignment numbers are in column A. In
D2, look up the destination of consignment 2043. To begin, type it exactly:=VLOOKUP(2043,A1:C5,2,FALSE). -
D3is showing #N/A. It is looking up the number inE3, and that consignment is not on this manifest at all. The one you really want is 2044. RewriteD3to look that up instead. -
D4is showing #N/A even though 2043 is clearly on the manifest.E4was imported from another system and holds its number as text. It looks the same on screen, but it is not equal to the number. InD4, wrap the lookup value so it is read as a number. -
D5asks for the weight of the Cardiff parcel and returns #N/A. It is searching the whole manifest, andVLOOKUPonly ever looks in the first column of the range. Give it a range whose first column is Destination. -
The last cause, and the one that hides best.
E6holds a destination with a trailing space left by a copy-paste. InD6, get that consignment's weight. -
Sometimes #N/A is the right answer and just needs saying in words. In
D7, look up consignment 9051. Have the cell read "Not on the manifest" when it is not found.IFNAtakes the formula first and the fallback second.