Excel VLookup
Contents
Usage
|
A |
B |
C |
D |
E |
F |
G |
H |
1 |
Product ID |
Product Name |
Unit Cost |
International Source |
|
|
International Product ID |
Product Source |
2 |
1001 |
Apple |
$5.00 |
|
|
|
1002 |
Nicaragua |
3 |
1002 |
Banana |
$2.50 |
|
|
|
1003 |
Columbia |
4 |
1003 |
Coffee |
$1.99 |
|
|
|
1010 |
Canada |
To populate the 'International Source' column, try:
=VLOOKUP(A2, $G$2:$H$4, 2, FALSE)
The second argument ($G$1:$H$3) indicates the range of the lookup table. The first column is always the lookup key. The third argument (2) indicates the column to collect from the lookup table.
The default function of VLOOKUP is to use a fuzzy match. To force exact matching, pass the optional fourth argument as FALSE.
VLOOKUP produces #N/A in any cell where the matching failed. To produce a different message (such as a blank string), use:
=IFERROR(VLOOKUP(A2, $G$2:$H$4, 2, FALSE), 'message')