Difference between revisions of "Manuals/calci/CHOOSE"

From ZCubes Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=CHOOSE(indexnum, val1, val2, .....)=
+
<div style="font-size:30px">'''CHOOSE () '''</div><br/>
 
 
 
where,
 
where,
*<math>indexnum</math> the relative position of value to be selected
+
*First Parameter is the relative position of value to be selected
*<math>val1, val2, ...</math> are value arguments or cell references to the values
+
*From the second parameter are value arguments or cell references to the values
 
+
**CHOOSE(), chooses a value from a list of values.
CHOOSE() selects a value from list of arguments with respect to the specified index position.
 
  
 
== Description ==
 
== Description ==
  
CHOOSE(indexnum, val1, val2, .....)
+
CHOOSE()
  
 
e.g. CHOOSE(2,10,20,30) displays '''20''' as a result.
 
e.g. CHOOSE(2,10,20,30) displays '''20''' as a result.
  
*CHOOSE() selects the value from the list of values depending on the specified <math>indexnum</math>. e.g. If <math>indexnum</math> is 2, Calci displays <math>val2</math>.
+
*CHOOSE() selects the value from the list of values depending on the specified in the first parameter. e.g. If first parameter is 2, Calci displays in the second parameter.
*If <math>indexnum</math> is not an integer, Calci displays #NULL error message.
+
*If the first parameter is not an integer, Calci displays #NULL error message.
*If <math>indexnum</math> &lt;1 or <math>indexnum</math> &gt; number of values in the list, Calci displays #N/A error message.
+
*If the first parameter &lt;1 or the first parameter &gt; number of values in the list, Calci displays #N/A error message.
*Arguments <math>val1, val2, ...</math> can be numbers, text, cell references, formulas, functions etc.
+
*Arguments from the second parameter can be numbers, text, cell references, formulas, functions etc.
  
 
== Examples ==
 
== Examples ==
Line 49: Line 47:
 
|}
 
|}
  
  =CHOOSE(5,A1,A2,A3,A4,A5) : Finds the value with index number '5' in the cell range A1 to A5. Displays '''Orange'''.
+
  =CHOOSE(5,A1,A2,A3,A4,A5) : Finds the value with index number '5' in the cell range A1 to A5. <br>Displays '''Orange'''.
  =CHOOSE(2,A1,A2,A3,A4,A5) : Finds the value with index number '2' in the cell range A1 to A5. Displays '''Blue'''.
+
  =CHOOSE(2,A1,A2,A3,A4,A5) : Finds the value with index number '2' in the cell range A1 to A5. <br>Displays '''Blue'''.
  =CHOOSE(4,B1,B2,B3,B4,B5) : Finds the value with index number '4' in the cell range B1 to B5. Displays '''-1'''.
+
  =CHOOSE(4,B1,B2,B3,B4,B5) : Finds the value with index number '4' in the cell range B1 to B5. <br>Displays '''-1'''.
  =CHOOSE(10,B1,B2,B3,B4) : Specified index number '10' is greater than the cell range, hence Calci displays '''#N/A''' error message.
+
  =CHOOSE(10,B1,B2,B3,B4) : Specified index number '10' is greater than the cell range, hence <br>Calci displays '''#N/A''' error message.
 +
 
 +
==Related Videos==
 +
 
 +
{{#ev:youtube|Ygdn7H0rw8U|280|center|CHOOSE}}
  
 
== See Also ==
 
== See Also ==
Line 65: Line 67:
 
*[http://en.wikipedia.org/wiki/String_(computer_science) String]
 
*[http://en.wikipedia.org/wiki/String_(computer_science) String]
 
*[http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)#Find Find String]
 
*[http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)#Find Find String]
 +
 +
 +
 +
 +
*[[Z_API_Functions | List of Main Z Functions]]
 +
 +
*[[ Z3 |  Z3 home ]]

Latest revision as of 14:53, 24 August 2018

CHOOSE ()


where,

  • First Parameter is the relative position of value to be selected
  • From the second parameter are value arguments or cell references to the values
    • CHOOSE(), chooses a value from a list of values.

Description

CHOOSE()

e.g. CHOOSE(2,10,20,30) displays 20 as a result.

  • CHOOSE() selects the value from the list of values depending on the specified in the first parameter. e.g. If first parameter is 2, Calci displays in the second parameter.
  • If the first parameter is not an integer, Calci displays #NULL error message.
  • If the first parameter <1 or the first parameter > number of values in the list, Calci displays #N/A error message.
  • Arguments from the second parameter can be numbers, text, cell references, formulas, functions etc.

Examples

Red 23
Blue 12
Yellow 3
Green -1
Orange 4
=CHOOSE(5,A1,A2,A3,A4,A5) : Finds the value with index number '5' in the cell range A1 to A5. 
Displays Orange. =CHOOSE(2,A1,A2,A3,A4,A5) : Finds the value with index number '2' in the cell range A1 to A5.
Displays Blue. =CHOOSE(4,B1,B2,B3,B4,B5) : Finds the value with index number '4' in the cell range B1 to B5.
Displays -1. =CHOOSE(10,B1,B2,B3,B4) : Specified index number '10' is greater than the cell range, hence
Calci displays #N/A error message.

Related Videos

CHOOSE

See Also

References