The MROUND function rounds a number to the nearest multiple of a number.
And while rounding a number, it doesn’t consider that number is greater or lower than the original number.
- number Number to round.
- multiple A number for which you want to find the nearest multiple.
In the below example, we have used different arguments to make you understand the concept of MROUND.
- 12.5 rounded to 12 to the nearest multiple of 3 is 12.
- 19 is rounded to 20 to the nearest multiple of 5
- 13 is rounded to 12 to the nearest multiple of 6.
- 3.6 is rounded to 2 to the nearest multiple of 4.
- The result is 0 as I have skipped specifying multiple.
- The result is 0 as I have specified 0 as the multiple.
- The result is an error as I have specified -2 as multiple.
- Here we have a tie between 20 and 18, but we get 20 as it always rounds away from zero.
- If you put zero in multiple it will return zero in the result.
- If you skip specifying multiple it will return with an error.
- It rounds away from zero. If you have two multiples on the same distance it will return the multiple which is higher than the number you are rounding.