VLOOKUP Not Finding Value That Exists? Fixes

Formulas & functions · Updated November 23, 2026

The most common reason VLOOKUP returns #N/A for a value that visibly exists in your lookup table is a hidden character, extra space, or number-stored-as-text mismatch in either the lookup value or the first column of the table. The quickest fix is to use the TRIM function to strip stray spaces and to ensure both columns are the same data type (both text or both numbers).

How VLOOKUP Actually Matches Values

VLOOKUP searches for a value in the first column of a table range and returns a value from a column to the right. It performs an exact match when the fourth argument is FALSE or 0, and an approximate match when it is TRUE or omitted. For exact matching, Excel compares the raw underlying values—not what is displayed. That means formatting differences (like number formats) do not matter, but data type differences (text vs. number) and invisible characters do.

For example, if you look up the number 123 but the lookup column contains the text string "123" (perhaps imported from another system), VLOOKUP will not match them. Similarly, a trailing space after a name in the table will break the match because Excel treats "John" and "John " as different values.

Step-by-Step Diagnosis

Work through these checks in order. Each one targets a common cause.

  • Check for extra spaces: Click a cell in the first column of your table and look at the formula bar. If you see a space after the text, use =TRIM(A2) in a helper column to clean it.
  • Check for non-printing characters: Use =LEN(A2) and compare it to the visible length. If LEN is larger than expected, characters like line breaks or non-breaking spaces may be present. Use =CLEAN(A2) to remove line breaks and =SUBSTITUTE(A2,CHAR(160),"") to remove non-breaking spaces.
  • Check data types: Use =ISTEXT(A2) and =ISNUMBER(A2) on both the lookup value and the first column of the table. If they differ, convert the text to numbers with =VALUE(A2) or use --A2 in a helper column.
  • Check for leading apostrophes: An apostrophe at the start of a cell forces text format. It is not visible in the cell but appears in the formula bar. Remove it by re-entering the value or using =SUBSTITUTE(A2,"'","").
  • Check for merged cells: VLOOKUP cannot find values in merged cells because the first column of the table may not contain the value in every row. Unmerge and fill the values down.

Use TRIM and CLEAN in a Helper Column

Instead of editing every cell manually, create a helper column that cleans your lookup column and use that as the new first column of your VLOOKUP range. With your original data in A2:C20, put this formula in D2:

=TRIM(CLEAN(A2))

Drag down to D20. Then use D2:E20 as the table array. For example, with the lookup value in F2, the formula becomes:

=VLOOKUP(F2, D2:E20, 2, FALSE)

This removes line breaks and extra spaces. If you also need to remove non-breaking spaces, use =TRIM(SUBSTITUTE(CLEAN(A2),CHAR(160),"")).

Force Numbers to Match with VALUE or TEXT

If your lookup value is a number but the table contains text, or vice versa, you can convert one side to match the other. If the lookup value in F2 is text and the table column contains real numbers, use:

=VLOOKUP(VALUE(F2), A2:B20, 2, FALSE)

If the lookup value is a number and the table column contains text, use:

=VLOOKUP(TEXT(F2,"0"), A2:B20, 2, FALSE)

Be careful with decimal numbers: TEXT(F2,"0") rounds to a whole number. Use TEXT(F2,"0.00") for two decimals, matching the format in your table.

Use XLOOKUP for More Robust Matching

If you are using Excel 2021 or Microsoft 365, XLOOKUP is a more forgiving alternative. It can handle exact matches with the same issues, but it lets you specify a search mode and does not require the lookup column to be the first in the range. More importantly, you can nest TRIM and CLEAN directly inside the formula:

=XLOOKUP(F2, TRIM(CLEAN(A2:A20)), B2:B20, "Not found")

This works because XLOOKUP accepts an array for the lookup array. However, it still requires the cleaned values to match the lookup value, so you may also need to clean F2:

=XLOOKUP(TRIM(CLEAN(F2)), TRIM(CLEAN(A2:A20)), B2:B20, "Not found")

XLOOKUP also handles numbers and text more gracefully in some cases, but it does not automatically convert types—you still need to fix mismatches.

Common Related Misconception: Approximate Match

Many users set the fourth argument to TRUE or omit it, expecting an exact match. With approximate match, VLOOKUP does not look for the exact value; it finds the largest value that is less than or equal to the lookup value. This requires the first column to be sorted in ascending order. If your table is not sorted, you will get incorrect results or #N/A. Always use FALSE for exact matching unless you intentionally need an approximate match (e.g., for tax brackets or grading scales).

When the Value Is a Date or Time

Dates and times are stored as serial numbers in Excel. A date that looks like 01/15/2024 might actually be the number 45241. If your lookup value is a text string like "01/15/2024", it will not match the date serial number. Convert the lookup value to a real date with =DATEVALUE(F2) or enter the date directly as a date. Similarly, times are fractions of a day; ensure both sides are true time values, not text.

Frequently Asked Questions

Why does VLOOKUP work for some rows but not others?
This usually indicates that the problem is specific to certain cells—maybe a trailing space in one row, or a number stored as text in one cell but not others. Run the diagnosis steps on the failing rows specifically.

Can I use VLOOKUP to find a value that is not in the first column?
No. VLOOKUP only searches the first column of the table array. If your lookup value is in column B and you need a result from column C, you must rearrange your data or use INDEX/MATCH or XLOOKUP, which allow any lookup column.

How do I fix #N/A when the value is definitely there?
First, use the TRIM and CLEAN helper column method. Then check data types. If both fail, try rebuilding the formula with FALSE for exact match. Also verify that the table array range is correct—if you accidentally include a header row, the first data row is skipped.

Does VLOOKUP ignore hidden rows or filtered data?
No. VLOOKUP looks at all rows in the table array, including hidden or filtered rows. If you need to search only visible rows, you must use a different approach, such as a helper column with SUBTOTAL or a dynamic array formula.

What is the difference between VLOOKUP and INDEX/MATCH?
INDEX/MATCH is more flexible because it can look up values to the left of the lookup column and does not break if you insert columns. It also handles unsorted data with exact match just as well. The syntax is =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)).

Can I use wildcards with VLOOKUP?
Yes, but only with text lookup values. Use an asterisk (*) for any number of characters and a question mark (?) for a single character. For example, =VLOOKUP("*"&F2&"*", A2:B20, 2, FALSE) finds a cell containing the value in F2 anywhere within the text. This works only when the lookup value is text, not a number.

Related

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

More in Formulas & functions

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

Spotted an error in this guide? Let us know.