Returns an element from a list of choices based on index.
Sample Usage
CHOOSE(2,"A","B","C")
CHOOSE(4,B2,B3,B4,B5)
Syntax
CHOOSE(index, choice1, [choice2,..])
- index - Specifies which argument is chosen.
- choice1 - A value or reference to choose.
- choice2,.. - [OPTIONAL] Additional values among which to choose.
Examples
CHOOSE(2,"A","B","C") returns the second choice, i.e. "B".
CHOOSE(4,B2,B3,B4,B5) returns the value of the fourth list argument (value of cell B5).
Notes
- If index is 1, CHOOSE returns choice1 ; if it is 2, CHOOSE returns choice2 ; and so on.
- index must be a number between 1 and 254, or a formula or reference to a cell containing a number between 1 and 254.
- If index is zero, negative, or greater than the number of choices provided, an error is returned.
- If index is a fraction, it is truncated to the lowest integer before being used.