next up previous contents index
Next: FORECAST Up: A. Function Reference Previous: FIND   Contents   Index


FLOOR, XLFLOOR

Syntax: FLOOR(X[, S])
  XLFLOOR(X, S)

X = a numeric value
S = significance parameter

FLOOR returns the largest integer that is less than or equal to X. If the optional significance parameter S is specified, FLOOR returns X rounded down 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\lfloor \frac{X}{S} \right\rfloor \times S
\end{displaymath}

XLFLOOR is designed to be compatible with the Excel FLOOR function. It is functionally equivalent to SpreadScript's native FLOOR, 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, or an error will result.

Examples:

FLOOR(5.5) = 5

FLOOR(3.14159, 0.01) = 3.14

FLOOR(E3) = -10, where E3 = -9.99

XLFLOOR(-9.99, 1) = Error!

XLFLOOR(-9.99, -1) = -9

FLOOR(-9.99, -1) = -9 (in Excel compatibility mode)

FLOOR(C17) = 1, where C17 = 1

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


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