| Syntax |
| =MROUND(number,multiple) |
| Purpose / Description |
| Returns a value rounded to a whole multiple of a given value. Half adjusts the value, rounding-up values with remainders greater than half the multiple, and values with remainders less than half are rounded-down. |
| Arguments |
| Name |
Type |
Description |
| number |
number |
A reference or nested expression that returns a valid reference, a constant or a nested expression that returns a numeric value to be rounded. Text strings than can be coerced to numbers will be. Logical values generate an error. Arrays of values generate an error. |
| multiple |
number |
A reference or nested expression that returns a valid reference, a constant or a nested expression that returns a numeric value to be used for rounding. Text strings than can be coerced to numbers will be. Logical values generate an error. Arrays of values generate an error. The sign of multiple and number must be the same, otherwise an error is returned. |
| Return Values |
| Type |
Specific Value |
Description |
| number |
|
The answer may be legitimately 0, if the the multiple is more than twice the value of number. But if multiple or number are themselves 0, the result returned is 0. |
| number |
|
The result of rounding number to a whole multiple of the value passed as multiple, half adjusting up or down. |
| error |
#VALUE! |
If the value passed to number is a logical value or a text string that cannot be coerced to a number or is an array of values. |
| error |
#VALUE! |
If the value passed to multiple is a logical value or a text string that cannot be coerced to a number or is an array of values. |
| error |
#NUM! |
If the sign of multiple and number are not the same. |
| error |
|
Any errors referenced by arguments are returned due to propagation of error values. |
| Notes / Comments / Advice / Warnings |
| Comment: |
The result of number/multiple must produce a positive value (i.e. their signs must be the same), otherwise a #NUM! error is returned. |
| Advice: |
In situations where the direction of rounding needs to be controlled, either towards or away from zero, CEILING.MATH, FLOOR.MATH, CEILING or FLOOR might be considered. |
| Advice: |
If MROUND is required to operate on an array, then consider using a MAP or SCAN function. |
| Examples: |
Open / download sample workbook: MROUND.xlsx |
| |