Beruflich Dokumente
Kultur Dokumente
Feature
by Matthew Kuo on January 3, 2016
The vast majority of Excel users have never used VLOOKUPs range lookup feature. Most
Excel users familiar with the VLOOKUP formula are just conditioned to know that, when they
get to the range lookup option portion of the VLOOKUP syntax, they should just put in the word
FALSE because they want an exact match. This is because an exact match is what we want
95% of the time were using the VLOOKUP formula, and utilizing the range lookup option is
just not a common requirement.
Today, well walk through how you can actually utilize this feature of the VLOOKUP
formula. As mentioned before, the Range Lookups lack of prevalence is mainly due to the lack
of situations that require it. However, one key
situation does exist:
The Range Lookup feature of VLOOKUP can be used as an alternative to writing a Nested
IF Statement
Click here to download an example Excel file using VLOOKUPs Range Lookup Feature
While writing a Nested IF formula is a very popular approach to address these requirements,
there are a number of issues that make using it difficult. Nested IF formulas are difficult to
write, prone to errors, and not scalable if you have several categories or bins.
When you use VLOOKUPs Range Lookup feature as an alternative to using a Nested IF, it
solves the majority of these problems:
However, the VLOOKUP formulas Range Lookup is definitely less flexible than a Nested IF, as
there are certain specifications you need to ensure are in place before you can use it.
The full range of categories needs to be continuous there shouldnt be any breaks
between one categorys maximum and the next categorys minimum
Its difficult to digest these criteria without context, so well go through an audit of our setup to
ensure that these conditions are met during the actual exercise.
Click here to download an example Excel file using VLOOKUPs Range Lookup Feature
Step 1: Define the categories you want to assign your data set values to
The first step of this category assignment process will be to define the objective. In the
following example, our objective is to assign each number in our data set to one of three
categories:
Low
Medium
High
For simplification purposes well assume that our data set does not contain negative numbers.
Step 2: Setup your criteria table based on the requirements for VLOOKUPs range lookup
feature
The simplest way to complete this process is to put all of your categories and criteria in a simple
table detailing the minimum and maximum for each category. See below for an example based
on the conditions weve identified:
Now well go through an audit of each of the specifications we identified before to make sure
our setup of the criteria is appropriate for use with VLOOKUPs Range Lookup:
Since our setup is correct, we can now begin the category assignment process using VLOOKUP.
Step 3: Load your Data Set
Load your data into a single vertical column (highlighted in yellow below) and add a field next
to it to assign it to a category.
Step 6: Select the criteria table as your table array and remember to reference lock it
Hit the F4 Key right after selecting your criteria table to reference lock it.
We now have assigned all of our values to a specific category using the VLOOKUP formula.
How it Works
When you review VLOOKUPs documentation from Microsoft, youll see that you have two
options when you get to the range lookup portion of the syntax:
Input
0 or FALSE
1 or TRUE or leave blank
Result
VLOOKUP does an exact match
VLOOKUP does an approximate match
You can see that for the very last option, which we are utilizing in our example, VLOOKUP
does an approximate match. VLOOKUPs range lookup works exactly the same as the MATCH
formulas approximate match option. While Microsoft Excels documentation is very explicit
about the approximate match logic when describing the MATCH formula, for VLOOKUP it
feels somewhat hidden away. Therefore, lets go into the specifics of what Excel does during an
approximate match:
To see how it works, well work through the logic that a range lookup goes through:
Excel looks for the next largest value within the left hand column of our table array
that is still less than our lookup value. Because each of our category ranges are
continuous (there are no breaks between them) this logic works out to be the exact same
as looking for the category minimum of each of our lookup values.
For 42, the category minimum is 30, because 30 is the next largest number less than 42.
Once Excel knows which number to lock on to, it uses VLOOKUP to return the
corresponding value in the third column of the overall table array, which is Medium
Medium will be the category name for 42
Just for the sake of completeness, lets run through a scenario where we tell Excel to do a range
lookup, but we get an exact match:
For the number 60, the category minimum is 60, because when an exact match is found,
Excel just does an exact match VLOOKUP
Once Excel knows which number to lock on to, it uses VLOOKUP to return the
corresponding value in the third column of the overall table array, which is High
High will be the category name for 60
Click here to download an example Excel file using VLOOKUPs Range Lookup Feature
Conclusion
The Range Lookup feature of VLOOKUP remains a mystery to most Excel users in
world. However, one specific use case does exist and based on our example, it turns out to be a
much better option than using a Nested IF Statement. While VLOOKUPs Range Lookup does
have very specific setup conditions you need to put in place before you can use it, it ends up
being much easier to write, less prone to errors, and much more scalable than a Nested IF. While
its still not a common need, its worthwhile to learn VLOOKUPs Range Lookup just to have
this in your back pocket.