ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. How to Fix #N/A Errors in VLOOKUP and XLOOKUP

How to Fix #N/A Errors in VLOOKUP and XLOOKUP

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

#N/A means "not available": the lookup couldn't find your value. First find the cause: extra spaces (fix with TRIM), numbers stored as text, a typo, or a table range that moved because it wasn't locked with $. If the item is truly missing, show a message with IFNA, or with XLOOKUP's 4th argument.

Key takeaways

  • #N/A means the lookup value wasn't found in the search column or row.
  • Hidden spaces and numbers stored as text are the most common reasons a value that looks right isn't found.
  • Lock the table with $ signs, or it slides down as you fill and the lower rows show #N/A.
  • Fix the cause first, then use IFNA or XLOOKUP's if_not_found to label items that are truly missing.
  • IFERROR also hides real mistakes like #REF! and #NAME?, so IFNA is usually the better wrapper for lookups.
On this page+
  1. What does the Excel N/A error mean?
  2. Step 1: check whether the value is really missing
  3. Step 2: remove hidden spaces with TRIM
  4. Step 3: fix numbers stored as text
  5. Step 4: check the formula for other causes
  6. Step 5: label missing items with IFNA or XLOOKUP
  7. IFERROR or IFNA: which should you use?
  8. Practise it

An Excel N/A error, shown as #N/A, means a lookup searched for your value and found no match. Sometimes the item is truly missing. More often, it is there but doesn't match exactly, because of a hidden space, a number stored as text or a table range that moved. This guide shows how to find the cause, fix it, and only then hide the errors that are left.

What does the Excel N/A error mean?#

#N/A stands for "not available": the function has no value to give you. In VLOOKUP, XLOOKUP, HLOOKUP and MATCH, it almost always means "I couldn't find what you asked for".

That makes #N/A different from other lookup errors:

ErrorWhat it usually means in a lookup
#N/AThe lookup value wasn't found
#REF!VLOOKUP's column number is bigger than the table
#NAME?A misspelled function, or XLOOKUP in Excel 2019 or older
#VALUE!XLOOKUP's two ranges are different sizes
No error, wrong answerVLOOKUP is missing FALSE, so it did an approximate match

The last row is the most dangerous, because nothing warns you. If you are new to lookups, start with our beginner's guide to VLOOKUP or the VLOOKUP function guide.

Step 1: check whether the value is really missing#

Before you change the formula, look for the value yourself. Copy the lookup value and press Ctrl+F (Mac: ⌘F) to search the table for it. Two things can happen:

  • It isn't there. The code might be a typo, like K-301 for K-310, or the item is new or discontinued. In that case #N/A is the honest answer. Fix the typo, or label the missing item (see Step 5).
  • It looks like it is there. Then the two values only look the same. Go to Step 2.

On a big sheet, first find every error at once. Select the column with your lookups and choose Home > Find & Select > Go To Special. Pick Formulas, leave only Errors ticked, and click OK. Excel selects every cell with an error, so you can see whether one row is broken or all of them. If every row shows #N/A, check the formula first (Step 4). If only a few do, check the data (Steps 2 and 3).

Step 2: remove hidden spaces with TRIM#

Extra spaces are the most common reason a lookup misses. Data copied from other systems often has a space at the end, like "P-205 ". You can't see it, but "P-205 " and "P-205" are different text.

Check with LEN, which counts characters. P-205 has 5 characters, so =LEN(B3) returning 6 means there is a hidden space. Then wrap the lookup value in TRIM, which removes spaces from the start and end of text:

Excel formula
=VLOOKUP(TRIM(B3),$F$2:$H$8,2,FALSE)

TRIM goes around the value you look up, not around the whole VLOOKUP. If the spaces are in the table instead, clean that column once with TRIM in a helper column, then paste the results as values.

Step 3: fix numbers stored as text#

A number and the same digits stored as text don't match. Employee ID 1042 in one sheet and "1042" in another (often shown with a small green triangle in the cell's corner) give #N/A.

  • =ISNUMBER(A2) returns TRUE for a real number and FALSE for text.
  • If your lookup value is text but the table has numbers, use VALUE(A2) as the lookup value.
  • If your lookup value is a number but the table has text, use A2&"" to turn it into text.
Excel formula
=VLOOKUP(VALUE(A2),$F$2:$H$8,2,FALSE)

A lasting fix is to convert the column itself: select it and use the warning icon's Convert to Number option.

Step 4: check the formula for other causes#

If the value is there and clean, check the formula itself:

  • The table isn't locked. =VLOOKUP(B2,F2:H8,2,FALSE) becomes F3:H9, then F4:H10 as you fill down, and the top rows of the table fall out of range. Lock it: $F$2:$H$8.
  • VLOOKUP is searching the wrong column. VLOOKUP always searches the first column of the table. If the value you know is to the right of the one you want, VLOOKUP can't find it. Use INDEX MATCH or XLOOKUP to look up to the left.
  • The table doesn't include new rows. If the price list grew from row 8 to row 12, a table of $F$2:$H$8 can't find the new items. Extend the range, or turn the list into an Excel table (Ctrl+T, Mac: ⌘T) so it grows by itself.
  • An approximate match below the first band. With TRUE, a number smaller than the first value in the table gives #N/A. Start the tier table at 0.
  • Wildcards in XLOOKUP. XLOOKUP treats * as a normal character unless match_mode is 2. See XLOOKUP wildcards and match modes.

Step 5: label missing items with IFNA or XLOOKUP#

Once every real problem is fixed, the #N/A errors left are items that truly aren't in the table. Show a clear message instead. IFNA replaces only #N/A:

Excel formula
=IFNA(VLOOKUP(TRIM(B2),$F$2:$H$8,2,FALSE),"Discontinued")

XLOOKUP (Excel 2021 or Microsoft 365) has the message built in, as its 4th argument:

Excel formula
=XLOOKUP(TRIM(B2),$F$2:$F$8,$H$2:$H$8,"Check code")

For a number you will add up, use 0 instead of text, so totals still work. With the quantity in C2, this gives 0 for a missing item instead of an error: =C2*IFNA(VLOOKUP(B2,$F$2:$H$8,3,FALSE),0).

IFERROR or IFNA: which should you use?#

Use IFNA for lookups. IFERROR catches every error, including #REF! from a wrong column number and #NAME? from a misspelled function. Those are your mistakes, and you want to see them. IFNA catches only "not found".

IFERROR is still useful for other errors, like #DIV/0! when you divide by zero. Read more in IFERROR in Excel and the IFERROR function guide, and see the full comparison in IFERROR vs IFNA. Whichever you use, check the formula works before you wrap it: a wrapper hides the problem, it doesn't fix it.

Practise it#

The best way to get fast at this is to fix broken lookups yourself. ExcelReady's fixing lookup errors lesson gives you a sheet with a #REF!, a silent wrong price, a hidden space and a discontinued item to diagnose and fix, ending with IFNA and XLOOKUP. The IFERROR lesson covers #DIV/0! and shows how a wrapper can hide your own typo. Try the TRIM exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

A2 has the code P-205, which is in the catalog, but a plain lookup gives #N/A because the code ends in a hidden space. Click B2 and type a VLOOKUP that removes the space with TRIM, looks the code up in D2:F6 and returns the description (column 2).

fx
ABCDEFG
1
Item Code
Description
Code
Description
Price
2
P-205
P-100
Copy Paper (Box)
42
3
P-205
Stapler
15.5
4
P-310
Toner Cartridge
88
5
P-120
Sticky Notes (12)
9.75
6
P-150
Whiteboard Markers
11.25
7
8
9

Tip: TRIM(A2) goes where A2 would normally go in the VLOOKUP.

Practise this in a lesson

LessonFixing lookup errorsDiagnose #N/A, #REF! and silent wrong answers in lookups, then handle missing items gracefully.LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.Function guideIFERRORUse IFERROR to swap #N/A, #DIV/0! and other errors for a clean value. Examples with division and VLOOKUP, pitfalls, and live practice.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

What does #N/A mean in Excel?

+

It means "not available". In a lookup, Excel searched for your value and didn't find an exact match, so it has nothing to return.

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

+

The two values only look the same. One usually has an extra space, or one is a number and the other is text. Use LEN to count characters and TRIM or VALUE to make them match.

How do I replace #N/A with 0 or a blank?

+

Wrap the lookup in IFNA: =IFNA(VLOOKUP(B2,$F$2:$H$8,3,FALSE),0) shows 0, and using "" instead of 0 shows an empty-looking cell. In XLOOKUP, put 0 or "" in the 4th argument.

Should I use IFERROR or IFNA for lookups?

+

IFNA is usually better. It replaces only #N/A, so real mistakes like a wrong column number (#REF!) or a misspelled function (#NAME?) still show.

Why do only the lower rows show #N/A after I fill down?

+

The table range wasn't locked, so it moved down one row for each row you filled and stopped covering the top of the table. Add $ signs, like $F$2:$H$8.

Sources

  • IFNA function - Microsoft Support
  • IFERROR function - Microsoft Support
  • VLOOKUP function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does the Excel N/A error mean?
  2. Step 1: check whether the value is really missing
  3. Step 2: remove hidden spaces with TRIM
  4. Step 3: fix numbers stored as text
  5. Step 4: check the formula for other causes
  6. Step 5: label missing items with IFNA or XLOOKUP
  7. IFERROR or IFNA: which should you use?
  8. Practise it

Keep reading

Lookups· 6 min read

How to Look Up to the Left in Excel

VLOOKUP can't look to the left: it searches the first column of its table and only returns columns to the right. To return a column on the left, use INDEX MATCH, =INDEX(A2:A9,MATCH(G2,B2:B9,0)), which works in every version, or XLOOKUP, =XLOOKUP(G2,B2:B9,A2:A9), in Excel 2021 or Microsoft 365.

Lookups· 6 min read

XLOOKUP Wildcards and Match Modes Explained

XLOOKUP uses wildcards only when its 5th argument, match_mode, is 2: =XLOOKUP("Riverside*",A2:A9,B2:B9,"Not found",2). The * stands for any number of characters and ? for exactly one. Match mode -1 returns an exact match or the next smaller value, and 1 the next larger, which is useful for bands and tiers.

Lookups· 6 min read

VLOOKUP in Excel: Step-by-Step for Beginners

VLOOKUP finds a value in the first column of a table and returns a value from the same row in another column. Write =VLOOKUP(what to find, table, column number, FALSE). FALSE means exact match, which is what you want for IDs, codes and names. If nothing matches, VLOOKUP returns #N/A.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free