Documentation/Calc Functions/FLOOR.XCL

From The Document Foundation Wiki
Jump to: navigation, search

Other languages:

Function name:

FLOOR.XCL

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 positive significance value, the function rounds down (away from zero). For a negative number and a negative significance value, the function rounds up (towards zero). The function returns an error if the number is positive and the significance value is negative.

Im-jabber.svg

Note:
This function is available since LibreOfficeDev 5.0.

Syntax:

FLOOR.XCL(Number; Significance)

Returns:

Returns an integer value.

Arguments:

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

Significance(required) is the value, or a reference to a cell containing the value, to whose multiple Number is to be rounded.

If Number is positive and Significance is negative it returns an error.

Additional details:

Gnome-dialog-warning.svg

Warning:
This function exists for interoperability with Microsoft Excel 2007 or older. If a Calc spreadsheet is exported to Microsoft Excel, references to Calc’s FLOOR.XCL function are exported as references to Excel’s FLOOR function, which is compatible with all Excel versions. If a Microsoft Excel spreadsheet is imported into Calc, references to Excel’s FLOOR function are imported as references to Calc’s FLOOR.XCL function.


Examples:

Formula Description Returns
=FLOOR.XCL(14.5;4) rounds down 14.5 to nearest multiple of 4 12
=FLOOR.XCL(-11;2) rounds down -11 to nearest multiple of 2 -12
=FLOOR.XCL(-11;-2) rounds up -11 to nearest multiple of 2 and negative sign will round up i.e. towards 0 -10
=FLOOR.XCL(7;4) rounds down 7 to nearest multiple of 4 4
=FLOOR.XCL(11.5) Significance value is required so it will return an error value Err:511
=FLOOR.XCL(11,-2) Significance value is negative but Number is positive so it will return an error value Err:502

Related LibreOffice functions:

FLOOR

FLOOR.MATH

FLOOR.PRECISE

CEILING

INT

ODF standard:

NONE

Equivalent Excel functions:

FLOOR