IndexOf

Searches for an element in a list value and returns its index.

Syntax

IndexOf(list, element)
list = list you want to search for an element
element = element for which you want to search

Remarks

Returns 0 (zero) if the element is not found (the first element in any list has an index of 1).

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

To retrieve an element based on its index, see Index.

Examples

IndexOf(List(1, 2), 1) = 1
IndexOf(List(1, 2), 2) = 2
IndexOf(List(1, 2), 3) = 0
IndexOf(1, 1) = 1

Classification

Ranges