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