MROUND
Rounds a number to the nearest multiple.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=MROUND(number, multiple)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
multiple | number | Required | — |
Remarks
- Returns
0whenmultipleis0. - Midpoints are rounded away from zero.
Error cases
- If
numberandmultiplehave different signs, returns#NUM!.
Examples
Round 17 to the nearest multiple of five.
Formula =MROUND(17,5)
Expected result 15
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use negative inputs on both sides of the rounding calculation.
Formula =MROUND(-17,-5)
Expected result -15
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A value already at a multiple stays in place.
Formula =MROUND(15,5)
Expected result 15
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Opposite signs for the number and multiple are rejected.
Formula =MROUND(17,-5)
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why does MROUND return #NUM! for mixed signs?
If number and multiple have different signs (excluding zero), MROUND returns #NUM!.