Mastering the VLOOKUP Function in MS Excel
Mastering the VLOOKUP Function in MS Excel
What is VLOOKUP?
VLOOKUP stands for Vertical Lookup. We can use it to scan your data to find a
matching value.
SYNTAX
● Search_value: this is the first parameter or option for VLOOKUP. You can
specify the lookup value here. It can be a typed-in value or reference to a cell
value.
● In_this_data: This is where your data is. It can be on the same worksheet or
in another tab. It can be a range of values (like B5:E17) or a table (like tblSales).
● return_column_number: This number tells VLOOKUP which column to
extract after the result is found.
● approximate_match_ok? This TRUE / FALSE setting tells VLOOKUP if you
want an approximate or exact match for your search.
VLOOKUP Explanation
Here is a simple VLOOKUP to get the sales value of Jessa Mae from my sales data in
the range $B$5:$E$17. The formula returns the result of $1592.
SYNTAX
EXAMPLE
=VLOOKUP("Jessa Mae", $B$5:$E$17,3,FALSE)
RESULT
1592
EXPLANATION
Vertically looks up “Jessa Mae” in column B of the range B5:E17 and returns the
exact matching value from column D (3rd column from B). Refer to the above picture
and syntax to understand the concept.
We can use the IFERROR function of Excel to handle errors with our VLOOKUP
FORMULAS.
For example, you can use this formula to show a message like “Person not found” for
the Example 5 above.
'EXAMPLE 5 with error handling
'Looking for an non-existent value
'Formula:
=IFERROR(VLOOKUP("Rommel", B5:E17,2,FALSE), "Person not found")
'RESULT
Person not found
While VLOOKUP is a game changer when it was originally introduced, when you look at
the data challenges we all face in 2024, it suffers from many limitations. Here are the
main downsides of using VLOOKUP.
VLOOKUP cannot search for $2,133 and find the name of the person.
● It can only lookup on the left-most column: VLOOKUP can only search on the
data in left-most column of the table and return values to the right. So, if you want
to find out the sales person’s name who has sales of $2,133, we can’t do that
with VLOOKUP.
○ We can use INDEX+MATCH or XLOOKUP to solve this problem.
● Column Numbers: Let’s be real. Nobody refers to their data by column
numbers. We think and memorize the data by what it is. So, if I want to lookup a
name and get the corresponding sales, then I must translate the sales to column
number for VLOOKUP. This is lame.
○ We can use XLOOKUP to fix this problem.
● No Error handling: VLOOKUP doesn’t handle errors by itself. So if your lookup
cannot find the value, it just comes back with #N/A. This often has a cascading
effect on the charts, dashboards or reports you create.
○ We can use either XLOOKUP or IFERROR to solve this problem.
● Approximate Trap: I can’t tell you how many times I accidentally leave the last
parameter of VLOOKUP out and end up getting wrong results. This is because, if
you forget to say FALSE at the end of VLOOKUP, you fall into the approximate
trap. Your VLOOKUP RESULTS WILL BE WRONG.
● We can use XLOOKUP or be careful when writing VLOOKUPS.