Documentation/Calc Functions/CEILING.XCL

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

Function name:

CEILING.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 up (away from zero). For a negative number and a positive significance value, the function rounds up (towards zero). For a negative number and a negative significance value, the function rounds down (away from 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:

CEILING.XCL(Number; Significance)

Returns:

Returns an integer value.

Arguments:

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

Significance(required) is the real number 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 CEILING.XCL function are exported as references to Excel’s CEILING function, which is compatible with all Excel versions. If a Microsoft Excel spreadsheet is imported into Calc, references to Excel’s CEILING function are imported as references to Calc’s CEILING.XCL function.


Examples:

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

Related LibreOffice functions:

CEILING.MATH

CEILING.PRECISE

CEILING

FLOOR

ODF standard:

None

Equivalent Excel functions:

CEILING