next up previous contents index
Next: CELLREF Up: A. Function Reference Previous: CCOUNT   Contents   Index


CEIL, CEILING, XLCEILING

Syntax: CEIL(X[, S])
  CEILING(X[, S])
  XLCEILING(X, S)

X = a numeric value
S = significance parameter

CEIL returns the smallest integer that is greater than or equal to X. If the optional significance parameter S is specified, CEIL returns X rounded up to the nearest multiple of S. When S is omitted it is assumed to be 1. The mathematical formula is given by:

\begin{displaymath}
\left\lceil \frac{X}{S} \right\rceil \times S
\end{displaymath}

CEILING is a synonym for CEIL. XLCEILING is designed to be compatible with the Excel CEILING function. It is functionally equivalent to CEIL, except that the parameter S is required.

If both X and S are specified, they must have the same sign, or an error is generated. S should not be set to 0. This will produce an error in CEIL. XLCEILING will return 0 in this case for consistency with the undocumented behavior of Excel's CEILING function.

Examples:

CEIL(5.5) = 6

CEIL(3.14159, 0.01) = 3.15

CEIL(E3) = -9, where E3 = -9.99

XLCEILING(-9.99, 1) = Error!

XLCEILING(-9.99, -1) = -10

CEILING(-9.99, -1) = -10 (in Excel compatibility mode)

CEILING(C17) = 1, where C17 = 1

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


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