Difference between revisions of "Documentation/How Tos/Calc: CEILING function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(See also:)
m (Robot: Automated text replacement %s)
Line 25: Line 25:
 
: returns <tt>'''-12'''</tt>, because with <tt>'''mode'''</tt><nowiki>=</nowiki><tt>'''1'''</tt> the function rounds away from zero.
 
: returns <tt>'''-12'''</tt>, because with <tt>'''mode'''</tt><nowiki>=</nowiki><tt>'''1'''</tt> the function rounds away from zero.
  
=== See also: ===
+
{{Documentation/SeeAlso|
'''[[Documentation/How_Tos/Calc: FLOOR function|FLOOR]]''',
+
* [[Documentation/How_Tos/Calc: FLOOR function|FLOOR]]
'''[[Documentation/How_Tos/Calc: EVEN function|EVEN]]''',
+
* [[Documentation/How_Tos/Calc: EVEN function|EVEN]]
'''[[Documentation/How_Tos/Calc: ODD function|ODD]]''',
+
* [[Documentation/How_Tos/Calc: ODD function|ODD]]
'''[[Documentation/How_Tos/Calc: MROUND function|MROUND]]'''
+
* [[Documentation/How_Tos/Calc: MROUND function|MROUND]]'''
  
'''[[Documentation/How_Tos/Calc: INT function|INT]]''',
+
* [[Documentation/How_Tos/Calc: INT function|INT]]
'''[[Documentation/How_Tos/Calc: TRUNC function|TRUNC]]''',
+
* [[Documentation/How_Tos/Calc: TRUNC function|TRUNC]]
'''[[Documentation/How_Tos/Calc: ROUND function|ROUND]]''',
+
* [[Documentation/How_Tos/Calc: ROUND function|ROUND]]
'''[[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]''',
+
* [[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]
'''[[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]'''
+
* [[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]'''
  
'''[[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
+
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
  
[[Documentation/How_Tos/Calc: Functions listed alphabetically|'''Functions listed alphabetically''']],
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
[[Documentation/How_Tos/Calc: Functions listed by category|'''Functions listed by category''']]
+
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}

Revision as of 13:33, 25 February 2009


CEILING

Returns a number rounded up to a multiple of another number.

Syntax:

CEILING(number; mult; mode)

number is the number that is to be rounded up to a multiple of mult.
If mode is zero or omitted, CEILING rounds up to the multiple above (greater than or equal to) number. If mode is non-zero, CEILING rounds up away from zero. This is only relevant with negative numbers.
Use mode=1 for compability if you have negative numbers and wish to export to MS Excel. In MS Excel this function only takes two arguments.

Example:

CEILING(4; 3)

returns 6, because 2*3 = 6 is the next multiple of 3 above 4.

CEILING(6; 3)

returns 6.

CEILING(-11; -2)

returns -10, rounding to the multiple above.

CEILING(-11; -2; 1)

returns -12, because with mode=1 the function rounds away from zero.

Template:Documentation/SeeAlso

Personal tools