Search for a value in a horizonally-arranged data set.
Syntax:
HLOOKUP( lookup_key_value, lookup_data:Range or Array, row_index:Number {, lookup_type:Number} )
Looks up the lookup_key_value in the first row of the lookup_data range of cells (or array) and returns the corresponding value in that range of cells (or array) from the row specified by row_index.
lookup_data must be a horizontally-arranged sorted set of data (a range of cells, or an array).
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 tolookup_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 tolookup_key_value. NB lookup_data must be sorted in descending order (largest values at the left). |