ReferenceFunctionsLookup Functions
HLOOKUP
HLOOKUP: Looks up a value in the first row of a table and returns a value from another row.
Summary
HLOOKUP searches horizontally and returns the matching column's value from row_index_num.
Remarks
row_index_numis 1-based and must be within the table height.range_lookupdefaults toFALSEin this engine (exact match by default).- When
range_lookup=TRUE, approximate match logic is used against the first row. - If the lookup value is not found, returns
#N/A. - If
row_index_numis invalid, returns#REF!(or#VALUE!if non-numeric). - A matched empty target cell is materialized as numeric
0.
Examples
Exact match across header row
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
150
Approximate threshold lookup
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
C
Related functions
FAQ
Does HLOOKUP default to exact or approximate matching?
It defaults to exact matching in this engine because range_lookup defaults to FALSE.
How are invalid row_index_num values reported?
If row_index_num is outside table height HLOOKUP returns #REF!; if it is non-numeric it returns #VALUE!.
Runtime metadata
Category
Lookup
Signature
HLOOKUP(arg1: Any, arg2: Any (Range), arg3: Number, arg4?: Logical)Arity
min 3, max 4
Arguments
arg1Any · Scalar
arg2Any · Range
arg3Number · Scalar · coercion NumberStrict
arg4optionaldefaultLogical · Scalar · coercion Logical
Caps
PURELOOKUP
Source