Professional Documents
Culture Documents
Look Up Formulas
Look Up Formulas
https://www.vertex42.com/blog/excel-formulas/vlookup-and-index-match-examples.html
This workbook contains examples from the article "VLOOKUP and INDEX-MATCH Examples in Excel." Regard
sharing, think of this file like a book. You may use the ideas and techniques and formulas explained here, but y
this worksheet or copy substantial portions from it, just as you would not do so with a book. Thank you. - Jon W
EXAMPLES
VLOOKUP Syntax
NOTES If you insert a column into the table, the hard-coded "3" may no longer point to the correct co
from happening, use (COLUMN(result_column)-COLUMN(lookup_column)+1) in place of the
INDEX-MATCH Syntax
NOTE For an exact match, the last argument in the VLOOKUP and MATCH functions should be FA
Actually, the lookup is not truly "exact" because VLOOKUP and MATCH are not case-sensiti
the option an "exact match" so we'll go with that and explain how to do a case-sensitive mat
NOTES Remember to use FALSE or 0 for exact matches, because both VLOOKUP and MATCH def
or 1.
As a general rule, use absolute ($A$1) cell references to refer to the lookup ranges, table ar
you copy the lookup formula you will usually want those ranges to not change.
Check for extra blank spaces if you think a lookup formula should be finding a match, but it i
text may result in a match error, also.
Use IFERROR to handle the error returned when an exact match is not found.
Step 1: MATCH returns the position number of the matched value within th
Syntax: =MATCH(lookup_value,lookup_range,[match_type])
Example: =MATCH("MT",{"CA","NV","MT","TX","NY"},0)
NOTE The lookup_range can be a row or column, but if lookup_range is more than one row or colu
an error.
The match_type is optional, but the default is not 0. So, it is is best to always specify the ma
Step 2: INDEX returns the value from an array based on the row and colum
Syntax: =INDEX(array,row_number,[column_number],[area_number])
NOTES You don't need to include the column_number if the array is a single column.
Formula: =INDEX(array,row_number)
Formula: =INDEX(array,row_number,column_number)
In this example, we are looking for the first occurrence of a text string ending with "200"
In this example, we are looking for the first product that starts with an "A" and has "C" as the
In this example, we are looking for the first occurrence of any product name containing a qu
Formula: =VLOOKUP(lookup_value,table_array,result_column_num,TRUE)
Formula: =INDEX(result_range,MATCH(lookup_value,lookup_range,1)
0% F 93% A
60% D 70% C
70% C 75% C
80% B 83% B
90% A
0 0% 100 2%
10 1% 5 0%
100 2% 125 2%
1000 5% 2500 5%
Example 4: Experiment with what happens when the data is not sorted.
0 0% 200 5%
150 1%
300 2%
0 3%
0 4%
50 5%
500 6%
0 7%
1000 8%
NOTE For these types of matches, the formulas use an efficient search algorithm that assumes the
ascending order. That is why the above example returns 5% instead of 1% (a sequential che
cell) or 7% (a sequential check starting with the last cell). The algorithm looks at the first and
the middle value (which is zero) and decides to limit its search to the last 5 rows, then looks
decides to limit the search to rows 5-7, etc.
Formula: =VLOOKUP(row_lookup_value,table_array,
MATCH(column_lookup_value,column_label_range,0), FALSE)
Formula: =HLOOKUP(column_lookup_value,table_array,
MATCH(row_lookup_value,row_label_range,0), FALSE)
Syntax: =INDEX(array,row_number,column_number,area_number)
You can also do 3D lookups using VLOOKUP. Starting with the 2D lookup formula, we just need a formula to re
argument. In this example we'll use the CHOOSE function and define the syntax for this example below. We'll
table_number based on the chosen value of "Road" or "Plane".
CHOOSE: =CHOOSE(table_number,table_array_1,table_array_2,...)
Formula: =INDEX(result_range,MATCH(value1&value2,lookup_col1&lookup_col2,0))
Helper Product Color Price Qty
Ablue A blue 34.50 34
Agreen A green 52.30 28 Lookup Value:
Bblue B blue 29.30 57
Bgreen B green 87.20 103 VLOOKUP:
Byellow B yellow 98.10 23 INDEX-MATCH:
Amount Balance
300.00 300.00 VLOOKUP 60
(240.00) 60.00
text INDEX-MATCH 60
#N/A LOOKUP 60
Text
alpha VLOOKUP Ω
to
Ω INDEX-MATCH Ω
5000
#N/A LOOKUP Ω
Note: Using MATCH("*",lookup_column,-1) won't always find the last text value. Text beginning with symbols li
leading space will make that formula not find the last text value.
A more concise formula uses the LOOKUP function. The LOOKUP function allows the lookup_range to be an e
direct reference (and it can be a row or column). We can use a logical comparison and search for the last TRU
The trick here is that the expression 1/NOT(ISBLANK(lookup_range)) returns an array of 1s for TRUE and #DI
LOOKUP ignores the error values so it will return the last value in lookup_range that is not blank. The number
needs to be larger than 1 to return the last non-blank value in the range.
Text
1 LOOKUP 32
#N/A
32 INDEX-MATCH 32
You can use the SMALL function to return the nth smallest value from an array, and we can use that along with
the INDEX function to do a lookup based on the nth match. See the above reference to learn more about Array
specifically the SMALL-IF formula.
Event Date
A 3/7/2018 DATE 3/7/2018
B 3/8/2018 OCCURRENCE 2
C 3/7/2018
D 3/7/2018 EVENT C
E 3/10/2018
Return the 2nd Event occurring on the date 3/7/2018. The { } brackets in the formula below are a reminder
to enter the formula as an Array Formula. You don't actually type the brackets into the formula.
Formula: { =INDEX(result_range,SMALL(IF(lookup_range=lookup_value,
ROW(lookup_range)-ROW(first_cell_in_lookup_range)+1),occurrence)) }
REFERENCES
OOKUP Example
Result
29.30
EX-MATCH Example
Result
29.30
a single column.
$ 20.00 $ 20.00
$ 30.00 $ 30.00
$ 40.00 $ 40.00
and INDEX-MATCH
urn values that are not necessarily exact matches.
h argument = TRUE) and a "Less than" match with
in ascending order.
INDEX-MATCH
A
C
C
B
INDEX-MATCH
2%
0%
2%
5%
INDEX-MATCH
15%
10%
0%
INDEX-MATCH
5%
arch algorithm that assumes the data is sorted in
instead of 1% (a sequential check starting with the first
e algorithm looks at the first and last value, then looks at
h to the last 5 rows, then looks at the value 500 and
P and INDEX-MATCH-MATCH
he same as the simple lookup formula, except that in
H function and in the INDEX formula we replace the
e-Sensitive Lookup
Result
20.00
40.00
Match Criteria
lts from the lookup columns. Using VLOOKUP requires
ATCH does not need the helper column, but it becomes
m, FALSE)
ookup_col2,0))
Product: A
Color: green
Lookup Value: Agreen
VLOOKUP: 52.3
INDEX-MATCH: 52.3 Array Formula: Remember to press Ctrl+Shift+Enter
NDEX-MATCH
a simple method is to use INDEX-MATCH and convert
. Using this method, you can have any number of
.
e1) *
))
)
e previous example, we use a "large" text value. By
abetical order. If you are using the English alphabet
aracters or symbols in your list, you could try a Unicode
, MATCH(9E+100,
ange)
ose cells when searching for the last value in the range,
-
Ctrl+Shift+Enter
ue,
ccurrence)) }
VLOOKUP and INDEX-MATCH Examples
By Vertex42.com
https://www.vertex42.com/blog/excel-formulas/vlookup-and-index-match-examples.html
Please review the following license agreement to learn how you may or may
not use this file. Thank you.
https://www.vertex42.com/licensing/EULA_privateuse.html