Free Online Tutorials on Spreadsheets

CHOOSE function in Excel

Use

The CHOOSE function returns a value from a list corresponding to the index number provided. For example, if index number (Index_num) is between 1 to 3 and the list contains three color names then the CHOOSE function returns one of the color names when a number between 1 to 3 is used as the index number.

Syntax

CHOOSE(index_num, value1, [value2], …)

The function has the following arguments:

index_num – Required. The index number uses to specify which value argument to select. It must be a number between 1 and 254.

value1, [value2], … – The first value is required, rest is optional. It is a list of values from which we want to choose a value against the supplied index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or text.

Example

In the example below, index numbers are between 1 and 7 and values are days in a week.

The CHOOSE function returns the first value in the list i.e. “Monday” against the index number 1. The formula used above is:

=CHOOSE(A4,”Monday”,”Tuesday”,”Wednesday”,”Thursday”,”Friday”,”Saturday”,”Sunday”)

Further Examples

Return different values based on condition.

For more detail and examples on the function, see Microsoft Office website.

Function Errors

The function returns the #VALUE! error if the supplied index number is smaller than 1 and greater than 254 or greater than the number of the last value in the list.

The #NAME? error occurs when the supplied value argument is not enclosed in quotes or supplied cell reference is not valid.




Copyright © 2016 - 2019 Explainry.com | All Rights Reserved