Index

Returns a list value's element at the specified index.

Syntax

Index(list, index)
list[index]
list = the list from which you want to retrieve an element
index = the desired element's index in the list

Remarks

You can use either a function call form or hard brackets [] to reference an element in the list.

The first element of a list has an index of 1 (one).
If index is not in the interval [1..Length(list)] but is strictly positive, the function will return an empty result. However, if index is negative or zero, it will return #IDX!.

If list is a value that is not a list, it will be considered a list containing a single element: the value itself.

If you want to search for an element in a list, see IndexOf.

Examples

Index(List(1, 2), 1) = 1
Index(List(1, 2), 2) = 2
List(1, 2)[2] = 2
Index(List(1, 2), 3) = empty result
Index(List(1, 2), 0) = #IDX! (error)
Index(1, 1) = 1

Classification

Ranges