Excel: CHOOSE Function

 Excel : CHOOSE Function - Basic understanding and examples


Function

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

Basic Understanding

The CHOOSE function use index_num to return a value from the list of value arguments. 

Up to 254 values can be in the list of arguments. Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number between 1 and 245.

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

The arguments can be numbers, cell references, defined names, formulas, functions or text.

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 cell values.

CHOOSE can be used in non-contiguous ranges, unlike INDEX, LOOKUP, VLOOKUP and HLOOKUP.

CHOOSE is useful when you need to refer to cells on different worksheets or in other workbooks.

Examples

1. =CHOOSE(3,70,90,54)

    evaluates to: 54

1. =SUM(CHOOSE(2,A1:A5,C1:C5,E1:E5))

    evaluates to: =SUM(C1:C5)

2. =SUM(A1:CHOOSE(3,A5,C5,E5))

    evaluates to =SUM(A1:E5)

3. =DATE(A1,11,CHOOSE(WEEKDAY(DATE(A1,11,1)),26,25,24,23,22,28,27)) can be used to       

    calculate the US Thanksgiving Date, assuming cell A1 has the year.

    The same result can be obtained by using the following formula:

    =DATE(A1,11,28-MOD(WEEKDAY(DATE(A1,11,1))+1,7)

 4. =CHOOSE(index_num, calculation1, calculation2, calculation3, calculation4) is an example of             using choose when a calculation needs to be computed using different methods.

    Easier will however be =INDEX(Data, Selection_Number)




Comments

Popular posts from this blog

VBA Developer - Digitally sign your macro project

Distribute your VBA project to other Microsoft Users

How far can you stretch the Excel LET function?