The VLOOKUP function looks up a value in a table and returns a corresponding value from a specified column. For example, consider following table:
|
A |
B |
C |
1 |
Day |
Rainfall |
Sunshine |
2 |
1 |
122 |
6 |
3 |
2 |
135 |
1.9 |
4 |
3 |
78 |
5.6 |
5 |
4 |
88 |
3.2 |
You want a function to return the Rainfall and Sunshine for the second day:
VLOOKUP(2, B2..B5, 2) – returns rainfall, 135
VLOOKUP(2, B2..B5, 3) – returns sunshine, 1.9
Note that the lookup_value must exist in the range.
VLOOKUP works in the same way vertically as HLOOKUP works horizontally.
VLOOKUP works in a similar way to LOOKUP except it’s easier to control the column returned with VLOOKUP (a single offset value rather than specifying a range for the return column).
See also: