Power Query
published
Search
K

List.PositionOf

List.PositionOf

Returns the offset(s) of a value in a list.
function (list as list, optional value as nullable any, optional occurrence as nullable any, optional equationCriteria as nullable any) as nullable any

Description

Returns the offset at which the value value appears in the list list. Returns -1 if the value doesn't appear. An optional occurrence parameter occurrence can be specified.

Category

List.Membership functions

Examples

Find the position in the list {1, 2, 3} at which the value 3 appears.
List.PositionOf({1, 2, 3}, 3)
2