Returns a value from the specified list of values based on the specified index.
Syntax
![]() |
---|
CHOOSE( Integer index, Any value1, [Any value2], ... ) → Any |
If index is 1, CHOOSE returns value1, if index is 2, CHOOSE returns value2, and so on. The values of parameters other than index and the one chosen are not evaluated for side effects, that is, this function short-circuits.
If index is less than zero or greater than the number of values passed as parameters, CHOOSE returns the #VALUE! error value. If index is not an integer value, it is automatically truncated.
Formula
![]() |
---|
=SUM(CHOOSE(2,A1:A5,B1:B5,C1:C5)) |
Function Reference
IF Function
INDEX Function