Difference between revisions of "Documentation/How Tos/Calc: CHOOSE function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m (Robot: Automated text replacement %s)
Line 33: Line 33:
 
* [[Documentation/How_Tos/Calc: MATCH function|MATCH]]
 
* [[Documentation/How_Tos/Calc: MATCH function|MATCH]]
 
* [[Documentation/How_Tos/Calc: OFFSET function|OFFSET]]
 
* [[Documentation/How_Tos/Calc: OFFSET function|OFFSET]]
* [[Documentation/How_Tos/Calc: VLOOKUP function|VLOOKUP]]'''
+
* [[Documentation/How_Tos/Calc: VLOOKUP function|VLOOKUP]]
  
 
* [[Documentation/How_Tos/Calc: SUM function|SUM]]
 
* [[Documentation/How_Tos/Calc: SUM function|SUM]]
* [[Documentation/How_Tos/Calc: SQRT function|SQRT]]'''
+
* [[Documentation/How_Tos/Calc: SQRT function|SQRT]]
  
* [[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]]'''
+
* [[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]]
  
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}

Revision as of 13:54, 26 February 2009


CHOOSE

Returns a value from a list, given an index number.

Syntax:

CHOOSE(index; value1; value2; ... value30)

value1 ... value30 are up to 30 values, each of which may be text, a number, a logical value, a reference or a formula.
index is an index number specifying which of value1 ... value30 to return; 1 returns value1, 2 returns value2, etc.

Example:

CHOOSE(1; "dog";"cat")

returns the text dog.

CHOOSE(2; "dog"; 65.4)

returns the number 65.4.

CHOOSE(3; "dog"; 65.4; B5)

returns the reference B5, so that =CHOOSE(3; "dog"; 65.4; B5) in a cell shows the contents of cell B5 in that cell (it is equivalent to =B5).

SUM(CHOOSE(1; B4:B5; B6))

returns the sum of the numbers in the range B4:B5.

CHOOSE(2;SUM(B1:C1);SQRT(9))

returns 3, the square root of 9.

Template:Documentation/SeeAlso

Personal tools