Thursday, August 19, 2021

Ceiling math function

This article describes the formula syntax and usage of the CEILING.MATH function in Microsoft Excel.

Description

Rounds a number up to the nearest integer or to the nearest multiple of significance.

Syntax

CEILING.MATH(number, [significance], [mode])

The CEILING.MATH function syntax has the following arguments.

  • Number    Required. Number must be less than 9.99E+307 and greater than -2.229E-308.

  • Significance    Optional. The multiple to which Number is to be rounded.

  • Mode    Optional. For negative numbers, controls whether Number is rounded toward or away from zero.

Remarks

  • By default, significance is +1 for positive numbers and -1 for negative numbers.

  • By default, positive numbers with decimal portions are rounded up to the nearest integer. For example, 6.3 is rounded up to 7.

  • By default, negative numbers with decimal portions are rounded up (toward 0) to the nearest integer. For example, -6.7 is rounded up to -6.

  • By specifying the Significance and Mode arguments, you can change the direction of the rounding for negative numbers. For example, rounding -6.3 to a significance of 1 with a mode of 1 rounds away from 0, to -7. There are many combinations of Significance and Mode values that affect rounding of negative numbers in different ways.

  • The Mode argument does not affect positive numbers.

  • The significance argument rounds the number up to the nearest integer that is a multiple of the significance specified. The exception is where the number to be rounded is an integer. For example, for a significance of 3 the number is rounded up to the next integer that is a multiple of 3.

  • If Number divided by a Significance of 2 or greater results in a remainder, the result is rounded up.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=CEILING.MATH(24.3,5)

Rounds 24.3 up to the nearest integer that is a multiple of 5 (25).

25

=CEILING.MATH(6.7)

Rounds 6.7 up to the nearest integer (7).

7

=CEILING.MATH(-8.1,2)

Rounds -8.1 up (toward 0) to the nearest integer that is a multiple of 2 (-8).

-8

=CEILING.MATH(-5.5,2,-1)

Rounds -5.5 down (away from 0) to the nearest integer that is a multiple of 2 with a mode of -1, which reverses rounding direction (-6).

-6

Top of Page

No comments:

Post a Comment