#N/A error in Excel: causes and how to fix it
Why VLOOKUP, XLOOKUP and MATCH return #N/A: missing values, extra spaces, text-numbers, sliding ranges, approximate match. Every cause with its fix.
#N/A is Excel's way of saying "not available": a formula went looking for something and came back empty-handed. Nine times out of ten the formula is a lookup such as VLOOKUP, XLOOKUP, MATCH, HLOOKUP or LOOKUP, and the value you asked for is not in the list, or it is there but Excel does not see it as the same value. Unlike most other errors, #N/A is not a sign of a broken formula. It is an answer: "I searched and found nothing". Your job is to decide whether that answer is true (the item really is missing) or false (the item is there, but spaces, number formats or a sliding range hide it). This page walks through every common cause with a small sheet that reproduces it, shows the fix, and explains when you should leave the error visible on purpose. For the overview of all error values see Formula errors: what each one means and how to fix it.
What #N/A means
A cell shows #N/A when a function cannot produce a value for the input it was given. Lookup functions return it when there is no match, array calculations return it for positions that do not exist, and some statistical functions such as MODE.SNGL return it when there is no answer (no value repeats). You can also type it on purpose with NA: =NA() returns #N/A. Like every error, #N/A propagates: any formula that uses a #N/A cell returns #N/A too, so one missing product code can turn an invoice total, a dashboard figure and a chart into #N/A at once.
Cause 1: the value really is not in the lookup list
The simplest case. Below, the price list contains P-101 to P-103 and someone asks for P-104. VLOOKUP with FALSE (exact match) searches the first column of A2:C4, does not find P-104 and returns #N/A.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-104 | #N/A | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
P-104 is not in the price list, so the exact-match lookup fails.
Result: #N/A
Fix. First confirm the item really is missing (search the list with Ctrl+F). If it is, decide what the sheet should show and say so explicitly. In Microsoft 365 and Excel 2021 or later, XLOOKUP has a built-in if_not_found argument:
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-104 | Not in list | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
XLOOKUP's fourth argument replaces #N/A with your own message.
Result: Not in list
In older versions wrap the lookup in IFNA (Excel 2013 and later): =IFNA(VLOOKUP(E2, A2:C4, 3, FALSE), "Not in list"). IFNA reacts only to #N/A, so a different problem, such as a deleted column that produces #REF!, still shows up instead of being silently replaced.
Cause 2: extra spaces or invisible characters
This is the most common reason for a "false" #N/A. The code looks identical on screen, but one side has a trailing space, a leading space or a non-breaking space copied from a web page or an accounting system. To Excel, "P-102 " and "P-102" are different texts.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-102 | #N/A | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
E2 contains P-102 followed by a space. =LEN(E2) returns 6 instead of 5, which gives the space away.
Result: #N/A
Fix. Clean the lookup value with TRIM, which removes leading and trailing spaces and squeezes double spaces inside the text:
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-102 | 12 | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
TRIM removes the trailing space, so the codes now match.
Result: 12
If the spaces are in the table instead, clean the column once (a helper column with =TRIM(A2), then Paste Special › Values over the original), or in Microsoft 365 trim inside the formula: =XLOOKUP(TRIM(E2), TRIM(A2:A4), C2:C4). TRIM does not remove the non-breaking space (character 160) that web pages use; for that add SUBSTITUTE: =TRIM(SUBSTITUTE(E2, CHAR(160), " ")). CLEAN removes line breaks and other non-printing characters. The Text cleanup: TRIM, CLEAN, TEXTSPLIT, Flash Fill and Text to Columns lesson covers these tools in depth.
Cause 3: a number on one side, text on the other
Employee numbers, postcodes and invoice numbers often arrive from other systems as text that looks like a number. A lookup never treats the number 1002 and the text "1002" as equal, so you get #N/A even though you can see the match. Clues: text-numbers are left-aligned by default, often carry a green triangle (Green triangle in Excel cells: what it means and how to fix it), and =ISTEXT(A3) returns TRUE.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Find ID | Name | |
| 2 | 1001 | Maria | 1002 | #N/A | |
| 3 | 1002 | Tom | |||
| 4 | 1003 | Priya |
The IDs in column A were imported as text; D2 holds the real number 1002.
Result: #N/A
Fix. Make both sides the same type. The quick formula fix converts the lookup value to text by joining an empty string to it:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Find ID | Name | |
| 2 | 1001 | Maria | 1002 | Tom | |
| 3 | 1002 | Tom | |||
| 4 | 1003 | Priya |
D2&"" turns the number 1002 into the text "1002", which matches column A.
Result: Tom
In the opposite situation (real numbers in the table, a text lookup value) convert with --D2 or VALUE: =VLOOKUP(--D2, A2:B4, 2, FALSE). The permanent fix is to convert the column itself: select it, click the warning icon and choose Convert to Number, or use Data › Text to Columns › Finish.
Cause 4: the lookup range slid when the formula was copied
You write a perfect VLOOKUP in F2 and fill it down. Because A2:C4 is a relative reference, the copy in F3 looks in A3:C5, the one in F4 in A4:C6, and so on. The first rows of the table drop out of the search and items that are clearly in the list return #N/A.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-102 | 12 | |
| 3 | P-102 | Mouse | 12 | P-101 | #N/A | |
| 4 | P-103 | Monitor | 189 |
F2 worked, but the copy in F3 searches A3:C5, which no longer contains P-101.
Result: #N/A
Fix. Lock the table with absolute references before copying: =VLOOKUP(E2, $A$2:$C$4, 3, FALSE) (press F4 after typing the range to add the dollar signs). Even better, turn the list into an Excel table (Ctrl+T) and use structured references such as Prices[Code], which never slide. See Cell references: relative, absolute and mixed for how $ works.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Price | |
| 2 | P-101 | Keyboard | 25 | P-102 | 12 | |
| 3 | P-102 | Mouse | 12 | P-101 | 25 | |
| 4 | P-103 | Monitor | 189 |
With $A$2:$C$4 every copy searches the whole table.
Result: 25
Cause 5: approximate match and a value below the first row
With approximate match (TRUE, or the fourth argument left out) VLOOKUP finds the largest value that is less than or equal to the lookup value. If the lookup value is smaller than the very first entry, there is nothing to fall back to and the result is #N/A. The same happens when the first column is not sorted in ascending order: the search can stop in the wrong place and return #N/A or, worse, a wrong value.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Weight from (kg) | Shipping | Parcel kg | Cost | |
| 2 | 1 | 5 | 0.5 | #N/A | |
| 3 | 5 | 9.5 | |||
| 4 | 10 | 14 |
The table starts at 1 kg, so a 0.5 kg parcel has no band.
Result: #N/A
Fix. Make the first band start at the lowest possible value (usually 0) and keep the first column sorted from smallest to largest:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Weight from (kg) | Shipping | Parcel kg | Cost | |
| 2 | 0 | 5 | 0.5 | 5 | |
| 3 | 5 | 9.5 | |||
| 4 | 10 | 14 |
With a 0 kg band every positive weight finds a rate.
Result: 5
XLOOKUP is safer here because it does not need sorted data: =XLOOKUP(D2, A2:A4, B2:B4, , -1) finds the exact match or the next smaller item, wherever it sits in the list.
Cause 6: VLOOKUP is searching the wrong column
VLOOKUP always searches the first column of the table you give it and can only return columns to its right. If you want the code of a product name, and the code is in the first column, VLOOKUP looks for the name among the codes and fails.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Code | |
| 2 | P-101 | Keyboard | 25 | Mouse | #N/A | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
"Mouse" is searched for in column A, which contains only codes.
Result: #N/A
Fix. Use a lookup that lets you choose the search column and the return column separately: XLOOKUP, or INDEX with MATCH in any version.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Find | Code | |
| 2 | P-101 | Keyboard | 25 | Mouse | P-102 | |
| 3 | P-102 | Mouse | 12 | |||
| 4 | P-103 | Monitor | 189 |
Search the Product column, return the Code column. =INDEX(A2:A4, MATCH(E2, B2:B4, 0)) gives the same result in older versions.
Result: P-102
Cause 7: arrays of different sizes
In Microsoft 365, when a formula combines two ranges of different sizes, Excel pads the shorter one and returns #N/A in the positions that have no partner. A typo in one range address is enough.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Qty | Price | |
| 2 | Pens | 3 | 4 | 12 |
| 3 | Paper | 5 | 10 | 50 |
| 4 | Ink | 2 | 6 | #N/A |
B2:B4 has three cells, C2:C3 only two, so the third row has nothing to multiply.
Fix. Make the ranges the same size: =B2:B4*C2:C4 returns 12, 50 and 12. If you see #N/A only at the bottom of a spilled result, a mismatched range is the first thing to check.
Cause 8: #N/A coming from the source data
Sometimes the #N/A is not created by your formula at all: it arrives from a cell you refer to. A forecast sheet might use =NA() for months without data, or an earlier lookup column may contain #N/A. Any SUM, AVERAGE or arithmetic over that range inherits the error.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Sales | Total | |
| 2 | Jan | 1200 | #N/A | |
| 3 | Feb | 1350 | ||
| 4 | Mar | #N/A | ||
| 5 | Apr | 1100 |
B4 contains #N/A, so the total is #N/A too.
Result: #N/A
Fix. Fix the source if it is a real problem. If the #N/A is intentional (for example to keep a chart from plotting a zero), total the range with AGGREGATE, which can skip errors:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Sales | Total | |
| 2 | Jan | 1200 | 3650 | |
| 3 | Feb | 1350 | ||
| 4 | Mar | #N/A | ||
| 5 | Apr | 1100 |
Function 9 is SUM, option 6 ignores error values: 1200 + 1350 + 1100 = 3650.
Result: 3650
=IF(B2="", NA(), B2) keeps an unfinished year from plunging to the axis.How to find every #N/A in a workbook
- Go To Special. Press
F5orCtrl+G(the same on a Mac), click Special, choose Formulas and leave only Errors ticked, then OK. Excel selects every formula on the sheet that shows an error, of any kind. Give the selection a fill colour so the cells stay visible after you click away. - Find All. Press
Ctrl+F(Cmd+F), type#N/A, open Options, set Look in to Values, tick Match entire cell contents, set Within to Workbook and click Find All. The list at the bottom shows sheet, cell and formula for every hit;Ctrl+Ainside the list selects them all. - Error Checking. Formulas › Formula Auditing › Error Checking jumps from one error to the next and offers Show Calculation Steps, which opens Evaluate Formula on that cell so you can see the exact step that fails.
- Trace Error. Select an error cell and choose Formulas › Error Checking (the arrow beside it) › Trace Error. Red arrows lead back to the cell where the error started; blue arrows show the healthy inputs. Errors travel downstream, so fixing the first cell often clears dozens of others.
- Count them with a formula.
=COUNTIF(B2:B500, "#N/A")counts the cells in a range that show this error, and=SUMPRODUCT(--ISERROR(B2:B500))counts every kind of error. Put the count next to a report total as an early-warning light. - Highlight them. Select the data, choose Home › Conditional Formatting › New Rule › Use a formula and enter
=ISNA(F2)(adjusted to the top-left cell). Every #N/A turns red and stays red as data changes.
IFNA, IFERROR and ISNA: catching #N/A properly
| Tool | What it catches | Use it when |
|---|---|---|
XLOOKUP if_not_found | Only a failed match | You use XLOOKUP (Microsoft 365, Excel 2021+) |
| IFNA | Only #N/A | Wrapping VLOOKUP, MATCH, INDEX/MATCH (Excel 2013+) |
| ISNA | Tests for #N/A, returns TRUE/FALSE | Conditional formatting, counting, very old versions: =IF(ISNA(x), "", x) |
| IFERROR | Every error | Only when any error genuinely means the same thing |
Prefer the narrowest tool. =IFERROR(VLOOKUP(...), 0) also swallows #REF! when someone deletes a column and #NAME? when a range name disappears, and it turns them into a believable 0 that ends up in totals.
When you should NOT hide #N/A
- Reconciliations and master-data checks. When you look up every invoice line in the customer list, an #N/A is the finding: a customer that is missing from the master data. Replacing it with blank or 0 hides exactly what the check was built to show.
- Prices and rates that feed totals. Turning a missing price into 0 makes an invoice cheaper without anyone noticing. Show a clear text such as "Price missing" instead, which also stops the total from calculating.
- While you are still building the sheet. Leave the raw errors visible until every formula is right; add the friendly messages last.
- When you have not checked Causes 2 to 4. If items you know exist return #N/A, the problem is spaces, types or ranges, not missing data. Hiding the error leaves wrong numbers.
Version notes
- #N/A exists in every version of Excel and in Google Sheets, LibreOffice and Numbers.
- IFNA arrived in Excel 2013. In Excel 2010 and earlier use
=IF(ISNA(x), alternative, x). - XLOOKUP and XMATCH need Microsoft 365, Excel 2021 or later, or Excel for the web. Opened in Excel 2019 or older they show
#NAME?(#NAME? error in Excel: causes and how to fix it). - Padding mismatched arrays with #N/A (Cause 7) is dynamic-array behaviour from Microsoft 365 and Excel 2021+.
Check yourself
1. =VLOOKUP("P-102", A2:C9, 3, FALSE) returns #N/A, but you can see P-102 in A5. What is the most likely cause?
With an exact match sorting does not matter. A trailing space, a non-breaking space or number-versus-text is the usual reason a visible value is not found.
2. Which function replaces only #N/A and lets other errors through?
IFNA reacts to #N/A only, so #REF! or #VALUE! still show up.
3. A formula works in F2 but returns #N/A after you fill it down to F3 and F4. What should you check first?
Without absolute references the table range slides down and drops the first rows.
4. Why might you deliberately put =NA() in a cell?
Charts treat #N/A as a gap; SUM, on the other hand, returns #N/A.