Investment Studio > Expressions > Functions > Reference > INDEX
index(array[*][*] table, integer row = 0, integer column = 0)
Returns the specified row(s) and column(s) in the table array.
If both row and column are 1 or higher, the value in the specified position of table is returned.
If column is 0 or omitted, the entire row is returned.
If row is 0 or omitted, the entire column is returned. The index function allows an empty row argument slot, as in index(_my_array, , 1). This is interpreted as index(_my_array, 0, 1).
If both row and column are 0 or omitted, the entire table is returned.
Examples
=index({{1, 2}, {3, 4}}, 2, 1)
returns 3 (value in row 2, column 1)
=index({{1, 2}, {3, 4}}, , 1)
returns {{1}, {3}} (first column, all rows)
=index({{1, 2}, {3, 4}}, 2)
returns {3, 4} (second row, all columns)
=index({{1, 2}, {3, 4}})
returns {{1, 2}, {3, 4}} (entire array).