Description
Use this function to return a value from a list based on a specified position or index number. Supported in Chains. Can be used with CHILDREFS.
CHOOSE lets you extract one value from a list of up to 254 value arguments based on a given index number.
Syntax
CHOOSE(index_num, value_1, […, value_254])
Inputs
This function accepts the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
index_num |
Yes | Specifies which value argument to return. | A positive integer between 1 and 254, a reference to a cell containing a positive integer between 1 and 254, or a formula which results in either of these. It must also not be greater than the number of values being considered. |
value_1 |
Yes | The first value in the list of options. | A cell reference, a cell range, a number, a text string, or a formula which results in any of these. |
value_n |
No | Additional values in the list of options. | Cell reference, a cell range, a number, a text string, or a formula which results in any of these. You can include up to 254 value arguments. |
Example
Sample data
| A | B | |
|---|---|---|
| 1 | 1 |
Apple |
| 2 | 2 |
Banana |
| 3 | 3 |
Cherry |
| 4 | 4 |
Date |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Return the specified value from the provided list of options. | =CHOOSE(2,"Apple","Banana","Cherry","Date") |
This formula works in the following manner:
For this data set this formula returns Banana. |
| Return the value of the specified cell from the set provided, based on the value provided in the specified cell. | =CHOOSE(A1,B1,B2,B3,B4) |
This formula works in the following manner:
Note that if the formula was For this data set this formula returns Apple. |
| Return the third value from the provided list. | =CHOOSE(3,10,20,30,40) |
This formula works in the following manner:
For this data set this formula returns 30. |
| Return the fifth value from a list with only three options. | =CHOOSE(5,"Red","Blue","Green") |
This formula works in the following manner:
For this data set this formula returns #VALUE!. |
Notes
- If
index_numis less than 1 or greater than the number of values in the list, CHOOSE returns a #VALUE! error. - If
index_numis a fraction, it is truncated to the nearest integer. - The CHOOSE function can be nested within other functions.
- You can use CHOOSE to select one of several formulas to calculate.
- CHOOSE does not support cell ranges. If you want to consider a range, use
INDEXinstead.
Tips
- Use CHOOSE when you need to select a value or action based on a specific position in a list.
- CHOOSE can be combined with other functions (for example, MATCH to create dynamic lookups, or in conjunction with other functions such as IF or INDEX to create more complex logical operations. It will not work with CONCATENATE.
- CHOOSE is 1-indexed, meaning the first value corresponds to index 1, not 0.
- For more complex conditional logic, consider using nested IF statements instead of CHOOSE.