The Excel Choose function returns a value from an array, that corresponds to a supplied index number (position).
It may help to think of the Choose function as a function that returns the nth entry in a given list.
The syntax of the function is:
where the arguments are as follows:
|index_num||-||An integer value, which specifies the index of the item to be returned.|
|value1, [value2], ...||-|
A list of one or more values that you want to return a value from.Note that these must entered as individual values (or references to individual cells containing values).
In Excel 2007 and later versions of Excel, up to 254 value arguments can be supplied to the Choose function. However, in Excel 2003, you can only supply up to 29 values to the function.
Imagine you are working on the spreadsheet below and you want to set the cells in Column B, to have the following values, depending on the value of the corresponding cell in Column A.
The Excel Choose function can be used to assign the correct value to the cells of Column B, as shown below:
The Excel Choose function can also return cell references, as shown in the following example. In this case, the reference that is returned from the Choose function is then provided to the Excel SUM Function.
In the example above, the Choose function returns the cell reference A1:A3. This is then passed to the SUM function which calculates the sum of the values in the cell range A1:A3 and returns the value 33.
Further information and examples of the Excel Choose Function can be found on the Microsoft Office website.
If you get an error from the Excel Choose Function, this is likely to be one of the following:
|#VALUE!||-||Occurs if the supplied index_num is less than 1 or is greater than the supplied number of values.|
|#NAME?||-||Occurs if any of the value arguments are text values that are not enclosed in quotes and are not valid cell references.|