VLOOKUP Not Working? Fix #N/A and #REF! Errors
Formula not working?
Share a small sample and the result you expected.
When VLOOKUP is not working in Excel, the problem usually comes from one of five places: the lookup value is missing, the table array starts in the wrong column, the match type is wrong, the column number is invalid, or your data needs a quick cleanup.
If VLOOKUP returns the wrong data, check the fourth argument first. For IDs,
names, SKUs, invoice numbers, and most business data, the formula should end in
FALSE so Excel uses exact match instead of a nearby approximate match.
If you've ever thought, "I followed the VLOOKUP steps perfectly -- why isn't it working?", you're not alone. This guide walks through the most common VLOOKUP errors and the fastest way to fix each one.
If the values look identical but the formula still fails, start with Excel Data Cleaning to clear hidden spaces and text-number mismatches before changing the formula itself.
1. Quick Fix Table
Start here if you just need the likely cause.
| Symptom | Most likely cause | Fast fix |
|---|---|---|
#N/A |
Lookup value is missing, has extra spaces, or has the wrong data type | Check spelling, use TRIM, and compare numbers stored as text |
| Values match but VLOOKUP fails | One value is text and the other is a number, or one side has hidden spaces | Run the four checks below, then clean the side that fails |
| Wrong result, no error | Approximate match is being used | Add FALSE as the fourth argument |
#REF! |
col_index_num is larger than the table array |
Count columns inside the selected table array |
#VALUE! |
An argument has the wrong type or an invalid range | Rebuild the formula by selecting ranges with your mouse |
| Formula misses new rows | The table array does not expand | Convert the source range to an Excel Table with Ctrl+T |
| Left lookup fails | VLOOKUP can only search the first column of table_array |
Move the lookup column first, or use XLOOKUP / INDEX MATCH |
#N/A only for keys that start with zero |
Excel dropped the leading zeros and stored a number | Keep the key column as Text, or pad both sides with =TEXT(A2,"00000") |
| The result comes from the row above the one you wanted | The table array starts on the header row and approximate match is on | Start the array at the first data row and end the formula with FALSE |
| The wrong price or name is returned | col_index_num was counted from worksheet column A instead of from the table's first column |
Recount from the left edge of table_array |
| The value was pasted from a website, PDF, or CSV | TRIM does not remove non-breaking spaces or line breaks |
Clean with =TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))) |
If the Values Look Identical but VLOOKUP Still Fails
This is the most common "VLOOKUP not working" report, and the formula is usually fine. Excel compares values exactly, so two cells that look the same on screen can still be different values. Run these four tests in a spare column next to the lookup value.
| Test | Formula | What the result tells you |
|---|---|---|
| Compare the real values | =A2=B2 |
FALSE means Excel sees two different values |
| Compare the lengths | =LEN(A2)&" vs "&LEN(B2) |
Different lengths mean a hidden space or a different format |
| Count non-breaking spaces | =LEN(A2)-LEN(SUBSTITUTE(A2,CHAR(160),"")) |
Anything above 0 means TRIM alone cannot clean this cell |
| Compare the data types | =ISNUMBER(A2)&" vs "&ISNUMBER(B2) |
TRUE vs FALSE means one key is a number and the other is text |
Then match what you found to the fix:
| What you found | Cause | Fix |
|---|---|---|
=A2=B2 is FALSE and the lengths differ |
Leading, trailing, or non-breaking spaces | Clean both sides with =TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))) |
=A2=B2 is FALSE and the lengths match |
One value is text and the other is a number | Convert one side to match the other, then compare again |
=A2=B2 is FALSE and both values are dates |
One date is stored as text | Convert it with =DATEVALUE(A2), or re-enter it as a real date |
=A2=B2 is TRUE but VLOOKUP still returns #N/A |
The matching value is on the sheet but not in the first column of table_array |
Check where the array starts and whether it reaches that row |
Capitalization is not the cause. Text matching in VLOOKUP ignores case, so apple
matches Apple, and retyping the key will not change the result. Reach for
=EXACT(A2,B2) only when you deliberately want a case-sensitive comparison.
If the two key columns sit on different worksheets, the same four tests apply with a sheet-qualified second argument. See How to Use VLOOKUP Across Sheets in Excel.
2. What VLOOKUP Actually Does
VLOOKUP searches for a value in the first column of a table and returns a matching value from a specified column. The basic formula is:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])lookup_value: What you're searching for (e.g., a product ID)table_array: The range of cells containing your datacol_index_num: Which column to return data from (counting from the left)[range_lookup]: UseFALSEfor exact matches (most common),TRUEfor approximate matches
3. VLOOKUP Table Array Not Working
Many "VLOOKUP not working" problems are really table array problems. The
table_array must include both the column you search and the column you want to
return.
Check these rules:
| Rule | Example |
|---|---|
The lookup column must be the first column in table_array |
If you search product IDs in column B, the table array should start at B |
The return column must be inside table_array |
=VLOOKUP(A2, B:D, 3, FALSE) can return from D |
col_index_num counts from the left edge of table_array |
In B:D, B is 1, C is 2, D is 3 |
| The range should include future rows if the list grows | Use an Excel Table instead of a fixed range |
For example, if product IDs are in column B and prices are in column D, this can work:
=VLOOKUP(A2, B:D, 3, FALSE)But this will not work if Excel needs to search column B and your table starts in column C:
=VLOOKUP(A2, C:D, 2, FALSE)If your lookup table lives on another worksheet, use the same table-array rules with a sheet reference. See How to Use VLOOKUP Across Sheets in Excel for the exact syntax and sheet-name examples.
For a quick diagnostic, compare the two values directly before changing the lookup formula:
=A2=B2If the result is FALSE even though the cells look identical, check spaces and
data types:
=LEN(A2)=ISNUMBER(A2)The same checks help with XLOOKUP. If the problem is specifically #N/A, use
How to Fix VLOOKUP #N/A in Excel for the
focused checklist.
4. Problem: #N/A Error ("Not Available")
This is the most common VLOOKUP error. It means Excel can't find your lookup value in the first column of your table.
For a focused step-by-step checklist, see How to Fix VLOOKUP #N/A in Excel.
Possible Causes and Fixes
Typos or extra spaces
- Check for: Misspellings, extra spaces, or different capitalization (e.g., "apple" vs "Apple")
- Fix: Use the TRIM function to remove extra spaces:
=VLOOKUP(TRIM(A2), table_array, 2, FALSE) - Or clean your data first with Data > Text to Columns > Finish. For stubborn leading, trailing, or non-breaking spaces, use Remove Leading and Trailing Spaces in Excel.
Lookup value isn't in the first column
- VLOOKUP only searches the first column of your table_array
- Fix: Rearrange your columns so the lookup column is first, or use INDEX+MATCH instead
Numbers stored as text (or vice versa)
- Check if numbers look left-aligned (text) vs right-aligned (numbers)
- Fix: Convert text to numbers with:
- Select column > Data > Text to Columns > Finish
- Or use VALUE function:
=VLOOKUP(VALUE(A2), table_array, 2, FALSE)
- For a focused cleanup workflow, see Excel numbers stored as text.
5. Problem: Incorrect Result (But No Error)
Sometimes VLOOKUP returns a value, but it's the wrong one. This is often more dangerous than an error because you might not notice it.
Common Causes
Accidental approximate match
- Forgetting to add
FALSEas the last argument makes VLOOKUP return approximate matches - Fix: Always include
FALSEfor exact matches:=VLOOKUP(A2, B2:D100, 3, FALSE) - Avoid leaving the fourth argument blank unless you specifically want an approximate match.
- Forgetting to add
Duplicate values in the first column
- VLOOKUP returns the first occurrence of a value it finds
- Fix: Remove duplicates first, use
VLOOKUP with multiple criteria,
or use
INDEX+MATCHwithCOUNTIFto find all matches
Wrong column index number
- col_index_num counts from the first column of your table_array, not the worksheet
- Example: If your table is B2:D100, column 1 = B, column 2 = C, column 3 = D
- Fix: Double-check your column count relative to your table range
If VLOOKUP Returns the Wrong Data With No Error
An error announces itself. A wrong value with no error does not, which makes it the more expensive failure. Work through these causes in order.
| What you see | Cause | Fix |
|---|---|---|
| The header text appears in the result | The table array starts on the header row, and approximate match can land on it | Start the array at the first data row and end the formula with FALSE |
| Results are close but not equal | Approximate match is running on data that is not sorted | Add FALSE, or sort the key column ascending if you really want a band lookup |
| The first of several rows is always returned | The key column contains duplicates | Add a second criterion, or return the last match with XLOOKUP search_mode -1 |
| Only the copied rows are wrong | The table array shifted while the formula was filled down | Lock it with $, for example $A$2:$D$100 |
| The wrong field comes back | col_index_num was counted from column A instead of from the table's left edge |
Recount from the first column of table_array |
| The value is stale after you edit the source data | The workbook is set to manual calculation | Press F9, or switch the workbook back to automatic calculation |
Here is the column count worked out. If the table is C2:F100 and you want the
value in column F, count from the left edge of that array: C is 1, D is 2, E is 3,
F is 4.
=VLOOKUP(A2,$C$2:$F$100,4,FALSE)Counting from worksheet column A instead would suggest 6, which returns #REF!
because the array only has four columns. Counting to 1 returns the key itself.
To prove which row VLOOKUP is actually matching, ask MATCH the same question:
=MATCH(A2,$C$2:$C$100,0)If MATCH returns a number, that is the position inside the array, so any
mismatch in the result comes from col_index_num. If MATCH returns #N/A while
COUNTIF finds the value, the key columns disagree on data type or hold hidden
spaces, and the checks under Quick Fix Table identify which side is wrong.
6. Problem: #REF! Error ("Reference Error")
This error means Excel can't find the column you're trying to reference.
Causes and Fixes
col_index_num is larger than your table has columns
- If your table has 3 columns, using col_index_num = 4 will cause #REF!
- Fix: Reduce your column number or expand your table_array to include more columns
Table_array was deleted or moved
- If you delete columns/rows in your table range, VLOOKUP loses its reference
- Fix: Convert your range to a named table (Ctrl+T) so references update automatically
7. Problem: #VALUE! Error
This usually happens when one of your arguments is the wrong data type.
Common Fixes
col_index_num is not a number
- Make sure you're using a number (e.g., 2) instead of text (e.g., "2" or "Column B")
- Fix: Replace any text with a numeric value
table_array is not a valid range
- Ensure your table range is entered correctly (e.g., A1:C100, not "A1-C100")
- Fix: Click and drag to select your range instead of typing it manually
8. Problem: VLOOKUP Stops Working When You Add New Data
If your formula doesn't include new rows you add to your table:
- Fix 1: Use a dynamic named range that expands automatically
- Fix 2: Convert your data to an Excel Table (Ctrl+T) and use the table name in
your formula:
=VLOOKUP(A2, Table1, 2, FALSE)
Excel Tables are usually the safer fix because the table expands when new rows are added.
9. Better Than VLOOKUP: Try XLOOKUP (Excel 365/2021)
If you have Excel 365 or 2021, XLOOKUP avoids most VLOOKUP problems:
- Can search in any column (not just the first)
- Doesn't return errors for missing values if you specify a default
- Easier to read syntax
Example XLOOKUP formula:
=XLOOKUP(A2, B2:B100, D2:D100, "Not Found")If you are deciding between lookup formulas, see VLOOKUP vs XLOOKUP vs INDEX MATCH.
For a step-by-step modern replacement, use the
Excel XLOOKUP tutorial. If the formula still
returns #N/A, #REF!, or #VALUE!, review the broader
Excel formula errors guide. If XLOOKUP itself is
failing, use XLOOKUP troubleshooting.
10. Quick Troubleshooting Checklist
When VLOOKUP fails, run through this list:
- Is the lookup value in the first column of your table?
- Did you include
FALSEfor exact matches? - Are there typos or extra spaces in your data?
- Is
col_index_numsmaller than or equal to the number of columns in your table? - Are numbers stored as numbers, not text?
- Does your table array include the return column?
- Does your table range include newly added rows?
- Are there non-breaking spaces (
CHAR(160)) or line breaks hiding in either key? - Does
table_arraystart at the first data row rather than on the header row? - Do keys with leading zeros keep their zeros on both sides of the lookup?
11. FAQ
Why is my VLOOKUP not working even with exact match?
The most common causes are extra spaces, numbers stored as text, or a lookup
value that is not in the first column of the table array. Try TRIM, compare
the data types on both sides, and confirm that the table array starts with the
lookup column.
Why does VLOOKUP return the wrong value?
The fourth argument may be missing. If you leave it blank, VLOOKUP uses
approximate match, which can return a nearby value instead of an exact one. Use
FALSE for IDs, names, invoice numbers, and most business data.
Why is VLOOKUP not returning the right data?
VLOOKUP may be searching the wrong column, returning the wrong column index, or
using approximate match. Confirm that the lookup column is the first column in
the table array, recount col_index_num, and end the formula with FALSE.
Why is VLOOKUP not working even though values match?
The values may only look the same. One side might have extra spaces, hidden characters, or numbers stored as text. Clean both lookup columns, then test the match again with exact match enabled.
Why does VLOOKUP stop working when I add rows?
The formula may point to a fixed range that does not include the new rows.
Convert the source data to an Excel Table with Ctrl+T, then use the table name
in your VLOOKUP formula.
Related Guides
- Clean hidden spaces and text-number mismatches with Excel Data Cleaning.
- Use Remove Leading and Trailing Spaces in Excel when lookup values look identical but have hidden spaces.
- Decide whether a lookup should become a dynamic row report with Excel FILTER vs VLOOKUP.
- Compare modern lookup options in VLOOKUP vs XLOOKUP vs INDEX MATCH.
- Use Excel Dynamic Array Formulas when the task should return filtered rows instead of one lookup value.
- Fix exact-match failures with How to Fix VLOOKUP #N/A in Excel.
- Convert mismatched numeric keys with Excel numbers stored as text.
Need help fixing a formula?
Share the formula, a small sample table, and the result you expected. This free beta helps us learn which Excel problems readers actually need solved.
Ask for formula help