CHOOSE function

Uses index_num to return a value from the list of value arguments. Use CHOOSE to select one of up to 254 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 254, or a formula or reference to a cell containing a number between 1 and 254.

  • If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.

  • If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.

  • If index_num is a fraction, it is truncated to the lowest integer before being used.

Value1,value2,...     are 1 to 254 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

  • If index_num is an array, every value is evaluated when CHOOSE is evaluated.

  • The value arguments to CHOOSE can be range references as well as single values.

    For example, the formula:

    =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.

Example 1

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

How to copy an example

  1. Create a blank workbook or worksheet.

  2. Select the example in the Help topic.

    Note   Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help

  3. Press CTRL+C.

  4. In the worksheet, select cell A1, and press CTRL+V.

  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

1

2

3

4

5

A

B

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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.

  2. Select the example in the Help topic.

    Note   Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help

  3. Press CTRL+C.

  4. In the worksheet, select cell A1, and press CTRL+V.

  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

1

2

3

4

5

A

Data

23

45

12

10

Formula

Description (Result)

=SUM(A2:CHOOSE(2,A3,A4,A5))

Sums the range A2:A4 (80)

Applies To: Excel 2007



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language