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.

What is Remote Training?

Valued by Individuals

 

4.8/5
Over 21470 Reviews
Jagg was an excellent trainer - very patient, had lots of options for people who didn't have the newest versions. I feel really confident about what I learnt today and I am very happy I did this course! -Power BI Beginner Adelaide
Melissa - Power BI Beginner, .
Excellent! Very knowledgeable instructor. -Power BI Beginner Adelaide
Jason - Power BI Beginner, .
Great course, very informative. Great instructor, very helpful -Power BI Beginner Adelaide
Sarah - Power BI Beginner, .
Great session, moves at a good pace with support when needed. Thanks -Power BI Beginner Adelaide
Matthew - Power BI Beginner, .
Excellent! -Microsoft Applications - Customised Sydney
Candice - Microsoft Applications - Customised, .
Very helpful -Microsoft Applications - Customised Sydney
Janet - Microsoft Applications - Customised, .
The learning environment and facilities are great. Ken knew the course content and is a friendly trainer.. -SharePoint Site Owner Melbourne
Robbie - SharePoint Site Owner, .
Thank you Ken Great 2 day of learning lots of information, looking forward to making our New Company SharePoint Site -SharePoint Site Owner Melbourne
Natasha - SharePoint Site Owner, .
Thank you Ken, I feel a lot more empowered and up-skilled with regards to SharePoint. I am looking forward to supporting my organisation to leverage SharePoint as one of collaboration and information management tools. -SharePoint Site Owner Melbourne
Annita - SharePoint Site Owner, .
Found it beneficial. Ken was extremely knowledgeable -SharePoint Site Owner Melbourne
Toby - SharePoint Site Owner, .
Great course, learnt a lot for the trainer. -Power BI Beginner Sydney
Aaron - Power BI Beginner, .
A good session however some revision of content from the intermediate course, which meant doing those two courses close together made those portions somewhat repetitive. Jagg was a good presenter and a good pace. -Excel Advanced Adelaide
Belinda - Excel Advanced, .
Jagg went above and beyond to help us learn the advance functions of excel. -Excel Advanced Adelaide
Ateeq-ur - Excel Advanced, .
Jagg was a great instructor - he stepped us through at a good pace, paused well to take q's and was well prepared. -Excel Advanced Adelaide
Hannah - Excel Advanced, .
Excellent range of advanced skills presented -Excel Advanced Adelaide
Oliver - Excel Advanced, .
Jag was excellent! Clear and thorough. I was a bit worried doing it remotely but found it better! Highly recommend. -Excel Advanced Adelaide
Agland - Excel Advanced, .
Was a very good informative session from Jag. -Excel Advanced Adelaide
Nilmini - Excel Advanced, .
Thank you. Well taught, clearly presented, and valuable lessons. Would recommend. -Excel Advanced Adelaide
David - Excel Advanced, .
Good pace, great course -Excel Intermediate Melbourne
Gemma - Excel Intermediate, .
Was a very informative course. John is a very patient instructor. Gives clear instructions. -Excel Intermediate Melbourne
Sonia - Excel Intermediate, .

Trusted by Business

Procured by Government

Map of Australia