How To Use VLOOKUP On A Range of Values
How To Use VLOOKUP On A Range of Values
howtogeek.com/406053/how-to-use-vlookup-on-a-range-of-values/
Alan Murray
VLOOKUP is one of Excel’s most well-known functions. You’ll typically use it to look up
exact matches, such as the ID of products or customers, but in this article, we’ll
explore how to use VLOOKUP with a range of values.
1/3
In that formula, the variables work like this:
lookup_value: This is the value for which you are looking. For us, this is the
score in column A, starting with cell A2.
table_array: This is often referred to unofficially as the lookup table. For us, this
is the table containing the scores and associated grades ( range D2:E7).
col_index_num: This is the column number where the results will be placed. In
our example, this is column B, but since the VLOOKUP command requires a
number, it’s column 2.
range_lookup> This is a logical value question, so the answer is either true or
false. Are you performing a range lookup? For us, the answer is yes (or “TRUE” in
VLOOKUP terms).
=VLOOKUP(A2,$D$2:$E$7,2,TRUE)
Below is an image of the results we’d get if we sorted the table array by the grade
letter rather than the score.
2/3
In this example, we have some sales data. We would like to provide a discount on the
sales amount, and the percentage of that discount is dependent upon the amount
spent.
A lookup table (columns D and E) contains the discounts at each spending bracket.
=VLOOKUP(A2,$D$2:$E$7,2,TRUE)
You will often see Excel users writing complicated formulas for this type of conditional
logic, but this VLOOKUP provides a concise way of achieving it.
Below, the VLOOKUP is added to a formula to subtract the discount returned from
the sales amount in column A.
=A2-A2*VLOOKUP(A2,$D$2:$E$7,2,TRUE)
VLOOKUP is not just useful for when looking for specific records such as employees
and products. It’s more versatile than many people know, and having it return from a
range of values is an example of that. You can also use it as an alternative to
otherwise complicated formulas.
3/3