All courses available in-class or via remote login

Tips To Troubleshoot VLOOKUP in Excel

Tips To Troubleshoot VLOOKUP in Excel

May 12, 2017

Whenever you type “how to use VLOOKUP” in Google, you are faced with hundreds of blogs and pages trying to explain how to use VLOOKUP.

The issue is, these blogs just explain how to use the function in an ideal scenario, when lists are clean and tidy and you’re not faced with real life issues.

The Importance of VLOOKUP in Excel

However in reality, things are not that straight forward and if you’re reading this blog, I assume you have been faced with some challenges while using this function. Files on which we routinely work are usually massive. Not to mention filled with spelling mistakes, garbage values, blank spaces, incorrect formats and duplicate entries which can lead to incorrect values and bugs.


In this blog, we will troubleshoot the most common mistakes made while using VLOOKUP and provide some quick and easy solutions.

Error #1 - There’s no match

 

The VLOOKUP functions work by matching the “Lookup_Value” with the first column of the “Table_Array”. This way you can perform a vertical lookup by searching for a value in the first column of the table and returning the value in the same row in the “index_number” position.

If you search for something and there’s no match, you will get the following error message:

(#N/A)


However, sometimes the match you are looking for is there but the function is just failing to find it.

There are a couple of reasons why this may be happening…

  • Watch out for non-printable characters such as spaces.
  • There may be inconsistency in Cases of both the strings. e.g. One
  • Check the formatting. For example, numbers formatted as texts. This can happen when you import data from a database.
  • There may be special characters such as (- / : ;) within the string – especially if you’re working with long codes.


So, before you dive in it's recommended you take some steps to clean out your functions.


Use the Trim Function

This helps to remove unnecessary spaces between words in a string.

  • Use Clean function to removes all nonprintable characters from a string
  • Use Upper, Lower and Proper function to makes cases of both strings consistent.
  • Clear the formats of the matching columns.
  • Use find and replace function to clear all special characters (- / : ;)

If the error is still there…

  • Ensure 1st column of your Table_Array contains the Lookup_Value
  • Ensure you have locked your Table_Array (F4 key is used to lock it)
  • Ensure your Table_Array is arranged in ascending order if you’re using approximate match (Range_Lookup = TRUE)

 

Error # 2 – Incorrect Values

One of the most difficult errors to detect is the one when your function works perfectly fine but continually returns incorrect values.

This error can occur when you have duplicates in the “Lookup_Value” column.

Function picks up a Lookup_Value, reiterate from the top of the first column of Table_Array, returns the value when it finds the first match and then jumps to next Lookup_Value. Hence, same value is returned for all the duplicates.

This brings us to a conclusion that our Lookup_Value column should have a unique identifier.


Here’s the Solution:

If you don’t have a unique identifier it is simple enough to create one.

For example:

If you “Lookup_Value” column comprises of just the first name than there is an increased chance of duplicate values. Not everyone has the same name but some people do!

Instead, combine the first name with the last name to create the full name.

Now you will have a much more unique identifier and at the same time reducing your chance of duplication!

Additionally, use below option to highlight all duplicates before you start working on your function

Home Tab > Styles Group > Conditional Formatting > Highlight Cell Rules > Duplicate Values

So, that either you can delete them, or combine them.

Contact Us

What is Remote Training?

Valued by Individuals

4.8/5
Over 24262 Reviews
Great session to understand how to use Power Query to set up Data Tables that are then useful in Power BI for Visuals. A good introduction to DAX, M expression writing. and row level security. Jason paces the session well and makes it easy to understand. -Power BI Intermediate Brisbane
Karen - Power BI Intermediate, .
Great Course with good info good interactions. -Power BI Intermediate Brisbane
Jason - Power BI Intermediate, .
It was a good pace and easy to follow. -Power BI Intermediate Brisbane
Hanh - Power BI Intermediate, .
Well Delivered course -Power BI Intermediate Brisbane
Mike - Power BI Intermediate, .
Great session - Jason is a passionate teacher who kept it interesting all day -Power BI Intermediate Brisbane
Shane - Power BI Intermediate, .
Learned a lot!!! Demonstration of examples was precise. This will definitely come in handy in my current role. Highly recommended workshop! Jason conveyed the lesson in a fantastic way -Power BI Intermediate Canberra
Sehla - Power BI Intermediate, .
Happy with how our questions were answered. -Power BI Intermediate Adelaide
Andrew - Power BI Intermediate, .
Jagg is ran a great session. It was a small group which meant that we could have covered more however I still learnt lots. -Power BI Intermediate Adelaide
Nikki - Power BI Intermediate, .
Need to make sure all desktop apps same version -Power BI Intermediate Adelaide
Gary - Power BI Intermediate, .
Course well delivered. Thank you -Power BI Intermediate Adelaide
Nayan - Power BI Intermediate, .
The course was useful. I learned some things that I will be able to directly implement in my work. -Power BI Intermediate Canberra
Leanne - Power BI Intermediate, .
Very informative -Power BI Intermediate Canberra
Carol - Power BI Intermediate, .
Course was informative but more basic than indicated on the website -Power BI Intermediate Canberra
Amee - Power BI Intermediate, .
Very comprehensive & interactive to ensure understanding of each concept -Power BI Intermediate Canberra
Elizabeth - Power BI Intermediate, .
I picked up some great tools and tips to apply in my current role. Danny was friendly, knowledgeable and helpful. The day was set out well and covered everyone's questions. -Excel Intermediate Sydney
Bree - Excel Intermediate, .
Danny was an excellent presenter . The course covered and touched upon helpful tips and short cuts . I'll highly recommend also to those who would like a refresher on VLookups and Pivot tables. -Excel Intermediate Sydney
Ashwini - Excel Intermediate, .
Great for learning more short cuts and brush up on your skills. Excellent Trainer Danny great. -Excel Intermediate Sydney
Antoinette - Excel Intermediate, .
Good Course, Good outline on features. Happy with pace and presenters clear communication. -Excel Intermediate Sydney
Brock - Excel Intermediate, .
Very good , lots of information to take in. Great course and instructor! -Excel Intermediate Sydney
Kirsten - Excel Intermediate, .
Danny was an excellent trainer and explained things thoroughly and patiently -Excel Intermediate Sydney
Antonia - Excel Intermediate, .

Trusted by Business

Procured by Government

Awards and Accreditations

Map of Australia

Follow us