CHOOSE

Formulas / CHOOSE
To get a value from a list using a list index.
CHOOSE(index_num, value1, [value2], ...)
  • index_num - specifies which value argument is selected
  • value1, [value2], ... - value arguments (254) which can be numbers, cell references, defined names, formulas, functions, and text. Only the first value argument is required.

Examples

  • =CHOOSE(2,"red","blue","green") // returns "blue"

    In this example, the CHOOSE function has an index number of 2, meaning it returns "blue", the second value listed.

  • =CHOOSE(3,"red","blue","green") // returns "green"

    In this example, the index number in the CHOOSE function is 3, meaning it returns "green", the third value listed.

  • =CHOOSE(B5,"red","blue","green") // returns "red"

    In this example, the CHOOSE function has an index number specified by the cell B5. Because B5=1, the CHOOSE function returns the first value listed, which is "red".

Summary

The CHOOSE function selects a value from a list of up to 254 value arguments using an index number.

  • The CHOOSE function selects a value from a list of up to 254 items based on a value's position or index in the list.
  • Note that CHOOSE cannot get values from a range or array constant.
  • Note that CHOOSE will throw a #VALUE! error if index_num is not in range.


Frequently Asked Questions

What is the CHOOSE function?
CHOOSE is a Sourcetable function that selects a value from a list. The value that the CHOOSE function selects is based on position number.
How does the CHOOSE function work?
The CHOOSE function syntax is CHOOSE(index_num, value1, [value2], ...). The index_num argument specifies which value argument is selected, while the value1, value2, etc. arguments are values that CHOOSE selects from. The value that CHOOSE selects is based on the index_num provided.
What can the arguments be in the CHOOSE function?
CHOOSE takes many types of arguments. Arguments that CHOOSE works with include numbers, text, defined names, functions, formulas, and cell references.
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV