Skip to content

choose

Pick from a list by integer index.

v = choose(index_num, value1, value2, ...)

Returns the index_num-th value (1-based) from the list. index_num = 1 returns value1, 2 returns value2, etc.

choose(2, 'red', 'green', 'blue') % 'green'
  • xlookup — Modern lookup with optional default and search direction.
  • index — Element of an array by row and column position.