#N/A error in Excel: what it means and how to fix it
#N/A means a lookup didn't find what it was looking for. Here are the six usual causes, how to spot each one on the sheet, and the fix, with a practice sheet.
Use XLOOKUP whenever everyone who opens the file has Excel for Microsoft 365 or Excel 2021 and later. It finds exact matches by default, can return a column to the left, keeps working when columns are inserted, and has its own “not found” value. Use VLOOKUP, or better INDEX and MATCH, only when the file must open in Excel 2019 or older.
Find the price of the code in E2. Both formulas return the same answer here:
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | A-101 | Keyboard | $49.00 | A-104 | $59.00 | |
| 3 | A-102 | Mouse | $19.00 | |||
| 4 | A-103 | Monitor | $189.00 | |||
| 5 | A-104 | Webcam | $59.00 | |||
| 6 | A-105 | Headset | $79.00 |
=XLOOKUP(E2,A2:A6,C2:C6) → $59.00=VLOOKUP(E2,A2:C6,3,FALSE) → $59.00The difference is in what each formula says. XLOOKUP reads as “find E2 in the codes, return the prices”. VLOOKUP reads as “find E2 in the first column of this table, return its 3rd column, exactly”. That 3 and that FALSE are where VLOOKUP goes wrong.
| XLOOKUP | VLOOKUP | |
|---|---|---|
| Default match | Exact | Approximate, unless you add FALSE |
| Return column | A range you point at | A number you count |
| Look to the left | Yes | No |
| After inserting a column | Still right | Returns the wrong column |
| When nothing is found | Its 4th argument | #N/A, unless wrapped in IFNA |
Forget FALSE in VLOOKUP and it switches to an approximate match that assumes sorted data. On unsorted codes that can return a neighbouring row’s price with no error at all, the worst kind of mistake. XLOOKUP is exact unless you ask otherwise.
Insert a “Colour” column between Product and Price, and =VLOOKUP(E2,A2:D6,3,FALSE) now returns the colour: the 3 still counts from the left. XLOOKUP’s return range moves with the prices, so it keeps returning prices.
VLOOKUP can only return columns to the right of the one it searches. Finding a product’s code from its name needs XLOOKUP, or INDEX and MATCH.
=XLOOKUP(E2,A2:A6,C2:C6,"Not listed") handles a missing code in one function. VLOOKUP needs =IFNA(VLOOKUP(E2,A2:C6,3,FALSE),"Not listed"). More on that in #N/A error in Excel.
VLOOKUP works in every version of Excel. XLOOKUP needs Excel for Microsoft 365, Excel 2021 or later, or Excel for the web; older versions show #NAME?.
For everyday sheets the difference isn't noticeable. Choose on correctness and readability, where XLOOKUP wins.
No. They'll see #NAME?. If your file goes to people on older versions, use INDEX and MATCH.
Yes, as long as the file is only used in Excel 365 or 2021 and later. Check results after converting: a VLOOKUP that relied on approximate match will behave differently.
Guides that build on this one.
#N/A means a lookup didn't find what it was looking for. Here are the six usual causes, how to spot each one on the sheet, and the fix, with a practice sheet.
#DIV/0! means a formula divided by zero or by an empty cell. Why it happens, averages of nothing included, and how to show a clean result, with a practice sheet.
Extra spaces, names in the wrong order, numbers stored as text and dates that aren't dates: the cleaning task interviewers love, solved with formulas, and a sheet that grades yours.
Practise in a live grid that grades what your formula calculates, with a specific hint when it's wrong.
Runs in your browser · Graded on your result · No install