next up previous contents index
Next: CLEAN Up: A. Function Reference Previous: CHAR   Contents   Index


CHOOSE, XLCHOOSE

Syntax: CHOOSE(N, argumentlist)
  XLCHOOSE(N, argumentlist)

N = a numeric value which should be $<$= the number of items in argumentlist - 1
argumentlist = any combination of numbers, strings, or cell addresses separated by commas.

CHOOSE returns the Nth argument from the argument list, starting with an index of 0. XLCHOOSE returns the Nth argument from the argument list, starting with an index of 1. XLCHOOSE is compatible with Excel's CHOOSE function.

Examples:

CHOOSE(2, D1, C22, F5, K1) = 54, where F5= 54

CHOOSE(1, A9, D23, G12) = ``Peaches'', where D23 = ``Peaches''

CHOOSE(3, ``nuts'', ``rings'', ``bolts'', ``fittings'') = ``fittings''

XLCHOOSE(3, ``nuts'', ``rings'', ``bolts'', ``fittings'') = ``bolts''

CHOOSE(3, ``nuts'', ``rings'', ``bolts'', ``fittings'') = ``bolts'' (in Excel compatibility mode)

SUM(CHOOSE(A1$>$B1, B1..B10, A1..A10)) sums either column A or column B.

Excel function: XLCHOOSE is compatible with Excel's CHOOSE (In Excel compatibility mode, the ``XL'' prefix is not used.)


next up previous contents index
Next: CLEAN Up: A. Function Reference Previous: CHAR   Contents   Index
SpreadScript User's Guide, Version 1.2
Grey Trout Software
02 March 2003