INDEX
returns value at row and column in range
signature
INDEX(array, row_num, [column_num], [area_num])
returns: any
| argument | required |
|---|---|
| array | required |
| row_num | required |
| column_num | optional |
| area_num | optional |
examples
formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.
| A | B | C | |
|---|---|---|---|
| 1 | 10 | 2 | alpha |
| 2 | 20 | 4 | beta |
| 3 | 30 | 6 | gamma |
| 4 | 40 | 8 | delta |
| 5 | 50 | 10 | epsilon |
fx
=INDEX(A1:C10, 2, 3) beta | A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
| 4 | 40 |
| 5 | 50 |
fx
=INDEX(A1:A10, 5) 50 errors
error values observed from the engine — each with a call that produces it.
| error | produced by |
|---|---|
| #REF! | =INDEX({1,2,3},1,0,2) |
| #VALUE! | =INDEX({1,2,3;4,5,6},-1,1) |
related
- ADDRESS returns a cell address as text from row and column numbers
- AREAS returns the number of areas in a reference
- HLOOKUP searches first row and returns matching value
- INDIRECT returns reference specified by text string
- LOOKUP looks up value in one-row or one-column range
- MATCH returns position of value in a range