Uses index_num to return a value from the list of value arguments. Use CHOOSE to select one of up to 29 values based on the index number. For example, if value1 through value7 are the days of the week, CHOOSE returns one of the days when a number between 1 and 7 is used as index_num.
Syntax
CHOOSE(index_num,value1,value2, …)
Index_num specifies which value argument is selected. Index_num must be a number between 1 and 29, or a formula or reference to a cell containing a number between 1 and 29.
Value1, value2, … are 1 to 29 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or text.
Remarks
SUM(CHOOSE(2,A1:A10,B1:B10,C1:C10))
evaluates to:
SUM(B1:B10)
which then returns a value based on the values in the range B1:B10.
The CHOOSE function is evaluated first, returning the reference B1:B10. The SUM function is then evaluated using B1:B10, the result of the CHOOSE function, as its argument.
Examples
CHOOSE(2,"1st","2nd","3rd","Finished")
equals "2nd"
SUM(A1:CHOOSE(3,A10,A20,A30))
equals SUM(A1:A30)
If A10 contains 4, then:
CHOOSE(A10,"Nails","Screws","Nuts","Bolts")
equals "Bolts"
If A10-3 equals 3, then:
CHOOSE(A10-3,"1st","2nd","3rd","Finished")
equals "3rd"
If SalesOld is a name defined to refer to the value 10,000, then:
CHOOSE(2,SalesNew,SalesOld,SalesBudget)
equals 10,000