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_numandcolumn_num. - If
column_numis omitted for a 1D array,row_numselects 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
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
8
Index into a 1D vector
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
Q2
Related functions
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
arg1Any · Range
arg2Number · Scalar · coercion NumberStrict
arg3optionalNumber · Scalar · coercion NumberStrict
Caps
PURERETURNS_REFERENCE
Source