Search for a value in a horizonally-arranged data set.
Syntax:
HLOOKUP(lookup_key_value, lookup_data:array, row_index:number {, lookup_type:number})
Looks up the lookup_key_value in the first row of the lookup_data array (or range of cells) and returns the corresponding value in that array (or range of cells) from the row specified by row_index.
lookup_data must be a horizontally-arranged sorted set of data (an array or range of cells).
row_index=1
would return a value obtained from the first row in the lookup_data,
row_index=2
would return a value obtained from the second row, and so on.
The lookup process is controlled by the optional lookup_type:
lookup_type | HLOOKUP action |
---|---|
1 or omitted |
HLOOKUP finds the largest value which is less than or equal to lookup_key_value.
NB lookup_data must be sorted in ascending order (largest values at the right).
|
0 |
HLOOKUP finds the value which exactly matches lookup_key_value. |
-1 |
HLOOKUP finds the smallest value which is greater than or equal to lookup_key_value.
NB lookup_data must be sorted in descending order (largest values at the left).
|