Formualizer Docs
ReferenceFunctionsReference Functions

INDEX

INDEX: Returns the value or reference at a 1-based row and column within an array or range.

Summary

INDEX can operate on both references and array literals. When the first argument is a reference, this implementation resolves a referenced cell and materializes its value in value context.

Remarks

  • Indexing is 1-based for both row_num and column_num.
  • If column_num is omitted for a 1D array, row_num selects the position in that vector.
  • row_num <= 0, column_num <= 0, or out-of-bounds indexes return #REF!.
  • Non-numeric index arguments return #VALUE!.

Examples

Pick a value from a 2D table
Grid
CellValue
Formula
=
Result
Not evaluated yet.
Expected
8
Index into a 1D vector
Grid
CellValue
Formula
=
Result
Not evaluated yet.
Expected
Q2

FAQ

How does INDEX behave when column_num is omitted?

For 1D arrays, row_num selects the position along that vector; for 2D arrays, omitted column_num defaults to the first column.

Which errors indicate bad indexes?

Non-numeric index arguments return #VALUE!, while 0/negative or out-of-bounds indexes return #REF!.

Runtime metadata

Category

Reference Fns

Signature

INDEX(arg1: Any (Range), arg2: Number, arg3?: Number)

Arity

min 2, max 3

Arguments

arg1

Any · Range

arg2

Number · Scalar · coercion NumberStrict

arg3optional

Number · Scalar · coercion NumberStrict

Caps

PURERETURNS_REFERENCE

Source

On this page