Skip to main content

List.PositionOf

Returns the offset(s) of a value in a list.

Syntax

List.PositionOf(
list as list,
value as any,
optional occurrence as Occurrence.Type,
optional equationCriteria as any
) as any

Remarks

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.

  • occurrence: The maximum number of occurrences to report.

Examples

Example #1

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

List.PositionOf({1, 2, 3}, 3)

Result:

2

Category

List.Membership functions