Look up a value in a table and return a matching value from another column.
VLOOKUP searches for a value in the first column of a table and returns the value in the same row from a specified column. Its syntax is =VLOOKUP(lookup_value, table_array, col_index_num, 0). The trailing 0 requires an exact match.
Look up the code in D1 within the table A1:B5 and return the matching price (column 2). Place the result in C1.
Click cell C1, type your formula and press Enter.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| Code | Price | Result | Lookup | ||
| 1 |
1
|
100
|
3
|
||
| 2 |
2
|
200
|
|||
| 3 |
3
|
300
|
|||
| 4 |
4
|
400
|
|||
| 5 |
5
|
500
|
|||
| 6 |