1. Calculation functions
  2. All Functions
  3. Numeric Functions
  4. MROUND

Use MROUND to round a value to the nearest multiple of n.

When the NEAREST direction argument is used, if the fractional part of x is .5 or greater:

  • a positive value is rounded up,
  • a negative value is rounded down.

Syntax

MROUND(x[, n][, d])

The MROUND function has the following arguments:

Argument Data type Description
x: number Numeric line item, property, or expression The number that you want to round to the nearest multiple of n.
n: number Numeric line item, property, or expression The multiple you want to round x to. If omitted, x will be rounded to an integer.
d: direction Keyword

This keyword determines which rounding direction the function uses. If omitted, the function uses the NEAREST rounding direction. The available keywords are:

  • UP, which rounds x up, towards positive infinity. This behavior is different to the Excel function ROUNDUP, which rounds away from zero.
  • DOWN, which rounds x down, towards negative infinity. This behavior is different to the Excel function ROUNDDOWN, which rounds towards zero.
  • NEAREST, which rounds x to the nearest number or decimal place.
  • TOWARDSZERO, which rounds x towards zero.
  • AWAYFROMZERO, which rounds x away from zero.
Returns
Numeric line item, property or expression

Excel equivalent

Examples

Formula Description Result
MROUND(1234.56) Only the value to be rounded, 1234.56, has been provided. The formula uses the default arguments of 0 decimal places and the NEAREST direction. 1,235
MROUND(1234.56, 10) Rounds 1234.56 to the nearest multiple of 10. The formula contains no rounding direction, so the default NEAREST direction is used. 1,230
MROUND(1234.56, 10, AWAYFROMZERO) Rounds 1234.56 to the nearest multiple of 10. The formula uses the AWAYFROMZERO rounding direction, so 1234.56, a positive number, was rounded towards positive infinity. 1,240
MROUND(1234.56, 1000) Rounds 1234.56 to the nearest multiple of 1,000. The formula contains no rounding direction, so the default NEAREST direction is used. 1,000
MROUND(-1234.56, 1000, UP) Rounds 1234.56 to the nearest multiple of 1,000. The formula uses the UP rounding direction, so x was rounded towards positive infinity. -1,000
MROUND(15555, 10, NEAREST) Rounds 15555 to the nearest multiple of 10. The formula contains no rounding direction, so the default NEAREST direction is used. As 55 is a positive number halfway between 50 and 60, x rounds up, towards positive infinity. 15,560
MROUND(-15555, 10, NEAREST) Rounds -15555 to the nearest multiple of 10. The formula contains no rounding direction, so the default NEAREST direction is used. As -55 is a negative number halfway between -50 and -60, x rounds down, towards negative infinity. -15,560