Formualizer Docs
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_num is 1-based and must be within the table height.
  • range_lookup defaults to FALSE in 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_num is 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
CellValue
Formula
=
Result
Not evaluated yet.
Expected
150
Approximate threshold lookup
Grid
CellValue
Formula
=
Result
Not evaluated yet.
Expected
C

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

arg1

Any · Scalar

arg2

Any · Range

arg3

Number · Scalar · coercion NumberStrict

arg4optionaldefault

Logical · Scalar · coercion Logical

Caps

PURELOOKUP

Source

On this page