VLOOKUP Not Working? 6 Best Fixes That Stop the #N/A Errors

When VLOOKUP is not working, the formula is usually fine and the data is not. A #N/A error means Excel could not find your value, a #REF! error means the range broke, and a #VALUE! error means the formula got the wrong kind of input. Each error has a clear cause, and each cause has a fix that takes under a minute. This guide gives you six fixes in the order you should check them, so you stop guessing and start fixing. If you are new to lookups, start with our pillar guide on how to use VLOOKUP in Excel first, then come back here.

Most people blame the formula first, and that is why they stay stuck. They rewrite the same formula three times, change the column number, and still see #N/A. The real cause is almost always in the data: a hidden space, a number stored as text, a range that moved when the formula was copied, or a match type left blank. This guide shows you how to find each cause with a simple test and fix it.

[SNIPPET TARGET] When VLOOKUP is not working, check these six things in order: the value is really in the table, the match type is FALSE, the range is locked, the lookup column is first, there are no hidden spaces, and the numbers are not stored as text. Most #N/A errors come from one of these six causes.

ANSWER BOX 1

VLOOKUP not working usually means #N/A, and #N/A means Excel could not find the lookup value in the first column of the table. The value may be missing, spelled differently, carrying a hidden space, or stored as text while the table stores it as a number.

ANSWER BOX 2

The six best fixes are: confirm the value exists, use FALSE for an exact match, lock the range with dollar signs, put the lookup column first, clean hidden spaces with TRIM and CLEAN, and convert numbers stored as text. Work through them in that order, and test the formula after each fix.

KEY TAKEAWAYS

  • VLOOKUP not working usually means the data is dirty, not the formula.
  • #N/A means no match was found, #REF! means the range broke, and #VALUE! means the wrong input type.
  • Always use FALSE for an exact match on codes, names, and IDs.
  • Lock the table range with dollar signs, or it moves when you copy the formula down.
  • Clean spaces and fix numbers stored as text before you hide the error with IFNA.

Contents

What Does VLOOKUP Not Working Mean?

VLOOKUP not working is a phrase that covers three different errors, and each one means something different. The #N/A error means Excel searched the table and found no match. The #REF! error means the range in the formula points at cells that no longer exist, usually because a column or a sheet was deleted. The #VALUE! error means the formula got the wrong kind of input, such as a column number of zero or a text value where a number belongs.

Before you fix anything, build a small test table you can trust. Type Product code in A1, Product in B1, and Price in C1, then type P-101, Notebook, 12 in row 2, P-102, Pen Set, 25 in row 3, and P-103, Desk Lamp, 40 in row 4. Type P-102 in F2, then type =VLOOKUP(F2,$A$2:$C$4,3,FALSE) in G2. Excel should return 25. If this small test works, your formula is fine, and the problem lives in your real data. If the small test fails too, the problem is in the formula itself.

Fix 1: Confirm the Value Really Exists

The first fix is the simplest. Before you change the formula, confirm that the lookup value is actually in the table. Type =COUNTIF(A:A,F2) in an empty cell, where A is the lookup column and F2 holds the value. If the answer is 0, the value is not in the table, and no formula can find it.

A zero from COUNTIF can also mean the value is there but spelled differently. Check for a missing hyphen, a swapped letter, or a different case in a code that mixes letters and numbers. Copy the value from the table and paste it into the lookup cell, then test the formula again.

Fix 2: Use FALSE for an Exact Match

The second fix is to use FALSE as the fourth argument, because leaving it blank is the most common cause of wrong answers. When the fourth argument is blank or TRUE, Excel uses approximate match, which needs the first column sorted in ascending order. On unsorted data, approximate match returns the closest value below your lookup value, which looks like a real answer but comes from the wrong row.

Change the formula to end with FALSE, such as =VLOOKUP(F2,$A$2:$C$4,3,FALSE), and test it again. If the formula now returns #N/A instead of a wrong value, that is progress, because the #N/A tells you the truth: the value is not in the table, or it does not match exactly. Save TRUE only for sorted bands such as grade bands and tax rates, where the lookup value falls inside a range.

Fix 3: Lock the Range With Dollar Signs

The third fix is to lock the table range with dollar signs, because an unlocked range moves when you copy the formula down. Without dollar signs, the first row works, the second row searches a range shifted down by one, and the errors multiply as you go down the column. Select the range in the formula bar and press F4 to lock it, or type the dollar signs by hand, such as $A$2:$C$4.

Hands pressing F4 to lock a range while fixing VLOOKUP not working

Fix 4: Put the Lookup Column First

The fourth fix is to put the lookup column first in the range, because VLOOKUP only searches the first column. If the product code sits in column B and the price sits in column A, VLOOKUP cannot find the code. Rearrange the table so the lookup column comes first, or change the range to start at the lookup column.

Fix 5: Clean Hidden Spaces and Characters

The fifth fix is to clean hidden spaces and characters, because they make two values look the same on screen while Excel treats them as different. A code typed as “P-102 ” with a trailing space does not match “P-102” in the table, and Excel returns #N/A. Microsoft Learn lists leading spaces, trailing spaces, mixed quotation marks, and nonprinting characters as reasons VLOOKUP returns an incorrect or unexpected value (Microsoft Learn).

Use TRIM to remove extra spaces, such as =TRIM(A2), and CLEAN to remove nonprinting characters, such as =CLEAN(A2). For a stubborn case, combine them as =TRIM(CLEAN(A2)), and copy the cleaned values back over the originals. Also check for nonbreaking spaces from web data, which TRIM does not remove, and use SUBSTITUTE to replace them, such as =SUBSTITUTE(A2,CHAR(160),””). Clean both sides of the lookup, the table column and the lookup cell, because a space on either side breaks the match.

Fix 6: Fix Numbers Stored as Text

The sixth fix is to fix numbers stored as text, because Excel treats text and numbers as different values even when they look the same. An ID that looks like 10023 may be text in one column and a real number in the other, and VLOOKUP will never match them. Select the column, go to Data, then Text to Columns, and click Finish to convert it in place.

Another fix is the VALUE function, such as =VALUE(A2), which turns text that looks like a number into a real number. The TEXT function does the reverse, turning a number into text with a set format, such as =TEXT(A2,”0″). When your lookup needs two keys at once, read our guide on VLOOKUP with multiple criteria for the four proven methods.

ErrorWhat it meansMost likely causeFix
#N/ANo match foundMissing value, space, or text numberFixes 1, 2, 5, and 6
#REF!Range is brokenDeleted column or sheetRebuild the range
#VALUE!Wrong input typeColumn number 0 or text in a number slotCheck the column number
Wrong valueApproximate matchTRUE or blank on unsorted dataUse FALSE
First row onlyRange movedNo dollar signsLock the range with F4

Person checking a printed Excel table with a pen to fix VLOOKUP not working

The Prevention Checklist for Your Next File

This is the section other guides skip, because it is a habit, not a fix. Before you build a VLOOKUP column for real work, run this short checklist, and you will stop most errors before they happen. The checklist has six items, and each one takes a few seconds.

First, clean the data before you write the formula, with TRIM and a check for numbers stored as text. Second, put the lookup values in the first column, with no blank rows inside the table. Third, turn the data into an Excel Table with Ctrl+T, so new rows join the range at once. Fourth, type FALSE for an exact match, unless you truly need a sorted band. Fifth, lock the range with dollar signs, or use a table name that cannot drift. Sixth, check the first three answers by hand, and filter the result column for #N/A before you send the file. Filter your data to spot the errors fast, and our live guide on how to filter data in Google Sheets shows the same filtering habit for sheets.

VLOOKUP Not Working FAQ

Why is my VLOOKUP returning #N/A when the value is there?

Your VLOOKUP returns #N/A when the value looks the same but is not identical to Excel. Check for a trailing space, a number stored as text, or a different spelling. Use LEN to compare the lengths, and use COUNTIF to confirm the value exists.

Why does VLOOKUP work for the first row only?

VLOOKUP works for the first row only when the table range is not locked with dollar signs. Each copied row shifts the range down by one, so the lower rows miss the top of the table. Select the range in the formula bar and press F4 to lock it, or turn the data into an Excel Table with Ctrl+T.

What does #REF! mean in VLOOKUP?

#REF! means the range in your formula points at cells that no longer exist, usually because a column or a sheet was deleted. Click the formula, look at the range, and rebuild it by selecting the range again with the mouse. Save a backup copy before you delete columns from a file that uses VLOOKUP.

What does #VALUE! mean in VLOOKUP?

#VALUE! means the formula got the wrong kind of input, such as a column number of zero or a lookup value that is already an error. Check that the column number is 1 or higher, and fix any error in the lookup cell first. In old Excel, an array formula entered without Ctrl+Shift+Enter can also return #VALUE!.

Why is VLOOKUP returning the wrong value instead of an error?

VLOOKUP returns the wrong value when the fourth argument is TRUE or blank on unsorted data, because approximate match picks the closest value below your lookup value. It also returns the wrong row when the lookup value appears more than once, because VLOOKUP always returns the first match. Use FALSE for an exact match, and make your lookup values unique.

How do I fix numbers stored as text in VLOOKUP?

Select the column, go to Data, then Text to Columns, and click Finish to convert the text into numbers. You can also use =VALUE(A2) to turn text into a number, or =TEXT(A2,”0″) to turn a number into text. Convert one side to match the other side, then test the formula again. Check the cell alignment, because text aligns left and numbers align right.

How do I remove hidden spaces that break VLOOKUP?

Use TRIM to remove extra spaces, such as =TRIM(A2), and CLEAN to remove nonprinting characters, such as =CLEAN(A2). For web data, use SUBSTITUTE to remove nonbreaking spaces, such as =SUBSTITUTE(A2,CHAR(160),””). Clean both the table column and the lookup cell, because a space on either side breaks the match.

Can VLOOKUP return a value from the left?

No, VLOOKUP cannot return a value from a column on the left of the lookup column, because it only searches the first column and only returns columns to the right. Rearrange the table so the lookup column comes first, or use INDEX with MATCH, or XLOOKUP, which have no left lookup limit. Check the column order before you blame the formula.

How do I hide #N/A in VLOOKUP?

Wrap the formula in IFNA, such as =IFNA(VLOOKUP(F2,A2:C4,3,FALSE),”Not found”). Excel shows your own text instead of #N/A when the value is missing. Fix the real cause first when you can, because hiding the error does not fix a missing value or dirty data.

Does VLOOKUP work in Google Sheets?

Yes, VLOOKUP works in Google Sheets with the same syntax, and the same errors mean the same things. The fixes in this guide apply there too, including TRIM, CLEAN, and locking the range with dollar signs. Google Sheets also has XLOOKUP and FILTER, so the modern methods work there as well.

Why does my VLOOKUP break when I insert a column?

VLOOKUP breaks when you insert a column inside the table, because the column number you typed now points at a different column. Turn the data into an Excel Table with Ctrl+T, or switch to XLOOKUP or INDEX with MATCH, which point at the return range directly. Check every VLOOKUP in the file after you insert a column.

Should I use IFERROR or IFNA for VLOOKUP?

Use IFNA for VLOOKUP, because IFNA catches only #N/A, while IFERROR catches every error, including real mistakes in the formula. IFERROR can hide a broken range or a wrong column number, which you want to see.

Final Word

When VLOOKUP is not working, slow down and check the data before you rewrite the formula. Work through the six fixes in order, and test after each one. Most #N/A errors come from a space, a missing value, or a number stored as text, and each one takes under a minute to fix.

Read more about VLOOKUP on Wikipedia: https://en.wikipedia.org/wiki/VLOOKUP

Leave a Reply