Why Is My VLOOKUP Returning #N/A? Fixes

Errors & fixes · Updated November 23, 2026

Your VLOOKUP returns #N/A because it cannot find the lookup value in the first column of the table array, or because the value exists but is formatted differently, the range is wrong, or the lookup column is not the leftmost column. The #N/A error literally means “value not available” – Excel looked for what you asked for and didn’t find an exact match. In most cases, the fix is simple: check the data types, expand the table range, or use a different function like XLOOKUP.

What VLOOKUP Actually Does

VLOOKUP (Vertical Lookup) searches for a value in the first column of a specified range, then returns a value from any column to the right. Its syntax is:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
  • lookup_value – what you’re searching for. It must be in the first column of the table_array.
  • table_array – the range that contains the lookup column and the result column.
  • col_index_num – the column number in the table_array from which to return a value (1 = first column, 2 = second, etc.).
  • range_lookup – TRUE for approximate match (default) or FALSE for exact match. For most lookups you want FALSE.

For example, with product IDs in A2:A10 and prices in B2:B10, this formula returns the price for ID “P123”:

=VLOOKUP("P123", A2:B10, 2, FALSE)

That returns the value from column B for the row where column A equals “P123”. If no row has “P123” in column A, you get #N/A.

Common Reasons for #N/A (and How to Fix Each)

  1. Exact match not found – The lookup value simply isn’t in the first column. Check for typos, extra spaces, or hidden characters. Fix: use =TRIM(A1) to remove spaces, or verify the value exists with =COUNTIF(A:A, A1).
  2. Number vs. text mismatch – If the lookup value is a number but the first column contains text (or vice versa), VLOOKUP won’t match. For example, 123 (number) vs "123" (text). Fix: convert one to the other using =VALUE() or =TEXT(), or use -- to coerce text to number.
  3. Trailing or leading spaces – Invisible spaces can break matches. Fix: use =TRIM(A1) in a helper column, or use =VLOOKUP(TRIM(A1), table, col, FALSE).
  4. Wrong table_array – If the table range doesn’t include the lookup column as its first column, or if the range is too small, VLOOKUP fails. Fix: make sure the first column of the range contains the lookup values, and that the range extends far enough down to include the row you need.
  5. Approximate match with unsorted data – If you omit the fourth argument (or set it to TRUE), VLOOKUP assumes the first column is sorted ascending. If it isn’t, you get #N/A or wrong results. Fix: use FALSE for exact match, or sort the first column.
  6. Lookup value is an error – If the lookup cell itself contains an error like #REF!, VLOOKUP returns #N/A. Fix: correct the source error.

How to Diagnose the Exact Cause

Instead of guessing, use these quick checks:

  • Test if the value exists: =COUNTIF(A:A, D2) where D2 is your lookup value. If it returns 0, the value isn’t there.
  • Check for spaces with =LEN(A2) vs =LEN(TRIM(A2)). If they differ, you have spaces.
  • Check data type with =ISTEXT(A2) and =ISNUMBER(A2) for both the lookup value and the first column cells.
  • Use Excel’s “Trace Error” feature (Formulas > Formula Auditing > Trace Error) to visually see which part is failing.

When VLOOKUP Isn’t the Best Choice

VLOOKUP has limitations that often cause #N/A or frustration:

  • It can only look to the right – you cannot return a value from a column to the left of the lookup column.
  • It requires the lookup column to be the first column of the table_array.
  • It returns only the first match; if there are duplicates, you get the first one, not necessarily the one you want.
  • It is not case-sensitive, so “apple” and “APPLE” are treated as equal.

If you have Excel 2021 or Microsoft 365, consider XLOOKUP instead:

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])

For example, with IDs in A2:A10 and prices in B2:B10, to return “Not found” when missing:

=XLOOKUP("P123", A2:A10, B2:B10, "Not found")

XLOOKUP doesn’t require the lookup column to be first, can return values to the left, and lets you specify a custom error message. On Mac, XLOOKUP works the same, but you may need to update Excel to version 16.47 or later.

How to Handle #N/A Gracefully

Even with fixes, you might want to display a friendly message instead of an error. Use IFERROR to catch the error:

=IFERROR(VLOOKUP(D2, A2:B10, 2, FALSE), "Not found")

This returns “Not found” if the VLOOKUP returns #N/A. For more control, use IFNA which only catches #N/A (not other errors like #REF!):

=IFNA(VLOOKUP(D2, A2:B10, 2, FALSE), "Not found")

Both functions work in Excel 2013 and later. On Mac, they work identically.

Frequently Asked Questions

Why does VLOOKUP return #N/A even though the value looks identical?

Most often it’s invisible characters – spaces, non-breaking spaces, or line breaks. Use =TRIM(A1) to remove spaces, and =CLEAN(A1) to remove non-printable characters. Also check if one cell is text and the other is a number; Excel treats “123” and 123 as different.

Can VLOOKUP match text that has extra spaces?

No, VLOOKUP does exact character-by-character matching when range_lookup is FALSE. Extra spaces break the match. Use TRIM on both the lookup value and the data, or use a helper column with trimmed values.

Why does my VLOOKUP work in one sheet but not in another?

This usually happens because the table_array is different, the data types differ, or the lookup value references a cell that contains a formula returning a text value. Copy the exact formula and check the references on the new sheet.

What if my lookup value is a date?

Dates are stored as numbers in Excel. If the lookup value is a date entered as text (e.g., “01/01/2024” as a string), it won’t match the numeric date. Use =DATEVALUE() to convert text to a real date, or format both as the same date format.

Is there a way to make VLOOKUP case-sensitive?

No, VLOOKUP is not case-sensitive. For case-sensitive matching, use INDEX and MATCH with EXACT, or use XLOOKUP with the match_mode argument set to 2 (exact match, case-sensitive). Example: =XLOOKUP(D2, A2:A10, B2:B10, "", 2).

Why does VLOOKUP return #N/A when I use TRUE for approximate match?

When range_lookup is TRUE, the first column must be sorted in ascending order. If it isn’t, VLOOKUP may return #N/A or an incorrect result. Sort the first column, or use FALSE for exact match.

Alternatives to VLOOKUP

If VLOOKUP keeps giving you trouble, try these:

  • INDEX + MATCH – More flexible, can look left, and doesn’t require the lookup column to be first. Example: =INDEX(B2:B10, MATCH(D2, A2:A10, 0)) returns the price from column B where A matches D2.
  • XLOOKUP – The modern replacement (Excel 2021/365). It handles errors, can return multiple values, and is simpler.
  • FILTER – For returning multiple matches (Excel 2021/365). Example: =FILTER(B2:B10, A2:A10=D2) returns all prices for the ID in D2.
  • Power Query – For complex merging of tables, use Data > Get Data > From Other Sources > Blank Query, then merge queries based on a column.

Remember, the #N/A error is a signal that the lookup failed – it’s not a bug. By methodically checking the value, the data type, and the range, you can almost always resolve it quickly.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.