Top 3 Reasons Why My VLOOKUP Isn’t Working

by Mark Wong on February 21, 2010 · 212 comments

in Excel

1.  You Have Your Numbers Formatted as Text

2.  You Have a Trailing Space at the End of Your Values

3.  You Forgot to Reference Lock Your Arrays

During my days as the spreadsheet guy (oh wait, I still am the spreadsheet guy) I’d often get pinged by other analysts about why their VLOOKUP formulas were not working.  VLOOKUP is the most popular of all the available lookup formulas in Excel. What’s interesting is that, of the myriad of different requests I would get, the cause and the fix for each of the problems would fall into just a handful of categories.

So are you currently looking at a VLOOKUP that displays the dreaded “#N/A” result?  Before you go bug the Excel genius at your company, read below for the top three reasons why your VLOOKUP isn’t working.

VLOOKUP is an essential tool for anyone who uses spreadsheets on a regular basis. Please keep in mind that all of these reasons apply to INDEX MATCH as well, but I will use VLOOKUP syntax in the examples because it is more common.

Click here for a detailed explanation of why INDEX MATCH is better than VLOOKUP

1.  You Have Your Numbers Formatted as Text

None of your VLOOKUPs are working, so you click on the lookup reference of your data set. In the formula bar you see an apostrophe before your intended number entry.

Solution: Multiply all of your lookup values by 1.

This usually occurs when someone is trying to show a leading zero in front a number.  (A better way to do that is with custom formatting)  This can also happen from standard outputs of common source systems, such as Great Plains.

Multiplying a value by 1 is the easiest way to convert a value to a number.  Notice how your values are now aligned to the right, indicating that it is actually a number.

It is possible to do a VLOOKUP of the TEXT of your lookup values, but this method doesn’t truly solve the problem. Additionally, if your error comes from a data set that has both text and numbers, all your number lookups will then become erroneous. Using the multiply by 1 technique is the best way to address this issue.

2.  You Have a Trailing Space at the End of Your Values

In this example, we have a VLOOKUP formula that, from a surface view, should work as planned. But why are none of the values returning results? The answer is invisible to the naked eye. To actually see your problem, you need to highlight your lookup values and click your cursor past the very end of the entry. Yes, there’s an extra space at the end of the input.

Typically this error occurs in the lookup reference of your larger data set. It happens when people import their data from different source systems, or through flawed programming logic that neglects to remove the space in the first place. Whatever the case, the solution to this problem is easy.

Solution: Use Data – Text to Columns on your data set. Check the box to delimit new columns with “spaces” and to treat consecutive delimiters as one, just in case there is more than one space.  Assuming your data entries are each only one word, you won’t run the risk of deleting any data.

3.  You Forgot to Reference Lock Your Arrays

People rarely use the VLOOKUP formula to lookup just one value. If you’re adding an additional field to your data set or looking up based on a set of values, you’re going to need to drag your formula to copy it downward.  So you double click the lower right hand corner of the cell to populate the formula down, and lo and behold, only half the formulas are working.

Solution: Use the F4 Key to reference lock your arrays before dragging your formula down.

If you look at the example below, the lookup values you are trying to match are no longer in the lookup array and has actually shifted down.  This is because you dragged the formula down without highlighting your array references and hitting F4. While the solution to this problem is relatively simple, it’s still amazes me how many times people encounter this problem. Even if you don’t intend to drag your formulas down, it’s good practice to always reference lock your arrays when writing a VLOOKUP formula.

{ 207 comments… read them below or add one }

AggyNo Gravatar October 22, 2014 at 6:58 am

Hi My VLookup isnt working properly. i have using it with names and not numbers. its returning so correct and some wrong answers. how can i make it correct?

AngelaNo Gravatar October 27, 2014 at 2:14 pm

Martina–I have been going crazy over the same issue for months–your solution worked for me! I guess the vlookup table has to be in chronological order for it to work. Crazy, but sorting it worked for me, too. Thank you!!! :D

EshwaryaNo Gravatar October 29, 2014 at 3:03 pm

Hi Guys,

My problem was not stated in Mark’s list but the solution is given ;)

Well, i was trying to apply vlookup however whenever i tried to copy the formula in other fileds of the column, the vlookup result was the same as above.
Like if the 1st vlookup value is say “Prasad”, all the other results were same.

I tried the 2nd solution form listed solutions and now it worked. Now the correct lookup values are been reflected.

Miro Z.No Gravatar January 22, 2015 at 11:59 am

Thanks for your help! F4 was the clue.

LucyNo Gravatar February 4, 2015 at 10:52 pm

My issue was hidden columns in between the table array.

MarriottNo Gravatar February 10, 2015 at 4:33 am

Recently we have upgraded from Excel 2007 to Excel 2010 and I encountered a bug with the vlookup formula.

In Sheet 2 I have table of seven columns of numeric data (from columns A-G, all general format numerical values)
In Sheet 1 I have cover sheet where I enter different values from column A in Sheet 2

I run vlookups from sheet 1 on the table in sheet 2.

He’s my problem

I have about 1440 rows of data in sheet 2
The vlookup returns values on some of the data but not all. It gives me #N/A

I have cross checked the number formats every which way possible. I have tested it with exact numbers I know that are in sheet 2 but I still get the same kind of error (picking up some of the values I need but returning errors for others). I even reverted to inserting a data validation list in the required cells in sheet 1 (pointing to column a in sheet 2) but even that picks up some of the values and returning errors on others.

I have made sure I’ve locked the range cells required and every other ways vlookup usually falls over but I still get the same problem.
What would be causing this.

CYRIL GEORGENo Gravatar March 4, 2015 at 1:23 pm

at some places VLOOKUP is not working. If the looked up value is not an absolute value i.e. 1074.75, the result is #N/A… Please suggest me what changes I can do in my Excel. I’m using Excel 2007…

Leave a Comment

{ 5 trackbacks }

Previous post:

Next post: