Documentation/Calc Functions/FLOOR

From The Document Foundation Wiki
Jump to: navigation, search
Other languages:
English

Function name:

FLOOR

Category:

Mathematical

Summary:

Rounds a number to the nearest multiple of a significance value.

For a positive number and a positive significance value, the function rounds down (towards zero). For a negative number and a negative significance value, the direction of rounding is determined by the value of a mode parameter. The function returns an error if the number and significance values have opposite signs.

Syntax:

FLOOR(Number [; Significance[; Mode]])

Returns:

Returns an integer value.

Arguments:

Number is the number that is to be rounded, or a reference to a cell containing the number.

Significance (optional) is the value, or a reference to a cell containing the value, to whose multiple Number is to be rounded. It defaults to +1 or -1 depending on the sign of Number.

Mode (optional) is a number, or a reference to a cell containing a number. The function only uses Mode if both Number and Significance are negative. Then if Mode is given and not equal to zero, numbers are rounded up (towards zero); if Mode is equal to zero or not given, negative numbers are rounded down (away from zero).

Additional details:

Gnome-dialog-warning.svg

Warning:
If the spreadsheet is exported to Microsoft Excel, the FLOOR function is exported as the equivalent FLOOR.MATH function that has existed since Excel 2013. If you plan to use the spreadsheet with earlier Excel versions, use either FLOOR.PRECISE that has existed since Excel 2010, or FLOOR.XCL that is exported as the FLOOR function compatible with all Excel versions.


Examples:

Formula Description Returns
=FLOOR(11.5) rounds down 11.5 to nearest multiple of +1(default) 11
=FLOOR(-11.5) rounds down -11.5 to nearest multiple of -1(default) -12
=FLOOR(-11;-2) rounds down -11 to nearest multiple of -2 -12
=FLOOR(-10;-3;1) rounds up -10 to nearest multiple of -3 under mode 1 which is not 0 hence result will be towards 0(rounded up) -9
=FLOOR(-11.67;-2;0) rounds down -11.67 to nearest multiple of -2 under mode 0 i.e. away from 0(rounded down) -12
=FLOOR(-11.67;-2;1) rounds up -11.67 to nearest multiple of -2 under mode 1 which is not 0 hence result will be towards 0(rounded up) -10
=FLOOR(11.5;-1) rounds down 11.5 to nearest multiple of -1 but due to opposite sign this will return an error value Err:502

Related LibreOffice functions:

FLOOR.MATH

FLOOR.PRECISE

FLOOR.XCL

CEILING

INT

ODF standard:

Section 6.17.3, part2

Equivalent Excel functions:

FLOOR.MATH