Documentation/Calc Functions/CEILING/en

Function name:
CEILING

Category:
Mathematical

Summary:
Rounds a number to the nearest multiple of a significance value. In most cases, the number is rounded up (toward +∞). However, a mode parameter is provided and when this is set to a non-zero value, then negative numbers are rounded down (toward -∞).

Syntax:
CEILING(Number [; Significance [; Mode]])

Returns:
Returns a real number that is the rounded value and is an integer multiple of the significance value.

Arguments:
Number is a real number, or a reference to a cell containing that number, that is the value to be rounded.

Significance is a real number, or a reference to a cell containing that number, that is the significance value to be used. If omitted, Significance defaults to +1 or -1 depending on the sign of Number.

Mode is a real number, or a reference to a cell containing that number, that is a Boolean mode indicator. Mode is only effective when both Number and Significance are negative. If Mode is present and equal to any non-zero value (including TRUE), negative numbers are rounded down (toward -∞). If Mode is omitted, or equal to zero or FALSE, negative numbers are rounded up (toward +∞).


 * If any argument is non-numeric, then CEILING reports a #VALUE! error.
 * If one of Number or Significance is positive while the other is negative, then CEILING reports an invalid argument error (Err:502).
 * If either Number or Significance is equal to 0, then CEILING returns 0.

Details specific to CEILING function

 * With Significance set or defaulted to -1 or +1 (with the same sign as Number) and Mode set or defaulted to 0 or FALSE, CEILING provides functionality that implements the standard mathematical definition of a ceiling value.


 * If you export a spreadsheet to Microsoft Excel, calls to the CEILING function are converted to CEILING.MATH (CEILING.MATH has existed in Excel since Excel 2013). If you intend to use a spreadsheet with earlier Excel versions, use either the CEILING.PRECISE function (that has existed in Excel since Excel 2010), or the CEILING.XCL function that is converted to CEILING on export and should be compatible with all Excel versions.

Related LibreOffice functions:
CEILING.MATH

CEILING.PRECISE

CEILING.XCL

FLOOR

FLOOR.MATH

FLOOR.PRECISE

FLOOR.XCL

INT

ISO.CEILING

ODF standard:
Section 6.17.1, part 2

Equivalent Excel functions:
CEILING.MATH