Specifies the array to extract a value from.
Specifies the index to use to reference the value within the array.
1. |
In the following example, the index specified is 2, so the function returns the second element, "Tigers".
ELEMENTAT(["Lions", "Tigers", "Bears", "Oh", "My"], 2)
|
2. |
To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.
IF(COUNT(["Lions", "Tigers", "Bears", "Oh", "My"]) > 0,
ELEMENTAT(["Lions", "Tigers", "Bears", "Oh", "My"], 2) ,
-1)
|