CHOOSE

See Also

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

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data Data
1st Nails
2nd Screws
3rd Nuts
Finished Bolts
Formula Description (Result)
=CHOOSE(2,A2,A3,A4,A5) Value from the second argument A3 (2nd)
=CHOOSE(4,B2,B3,B4,B5) Value from the fourth argument B5 (Bolts)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
23
45
12
10
Formula Description (Result)
=SUM(A2:CHOOSE(2,A3,A4,A5)) Sums the range A2:A4 (80)