The Excel MROUND function
returns a number rounded to a given multiple. MROUND always rounds up, away
from zero.
Syntax
The syntax for the MROUND function in Microsoft Excel is:
=MROUND( number, multiple )
Parameters or Arguments
number
The number that should be
rounded
multiple
The multiple to use when
rounding.
Mround Function Examples
Column B of the following
spreadsheet shows several examples of the Mround function:
Formulas:
|
A
|
B
|
1
|
number
|
Mround
|
2
|
333.7
|
=MROUND(
A2, 0.5 )
|
3
|
333.8
|
=MROUND(
A3, 1 )
|
4
|
333.3
|
=MROUND(
A4, 2 )
|
5
|
555.3
|
=MROUND(
A5, 400 )
|
6
|
555
|
=MROUND(
A6, 1000 )
|
7
|
-555.7
|
=MROUND(
A7, -1 )
|
8
|
-555.4
|
=MROUND(
A8, -1 )
|
9
|
-1555
|
=MROUND(
A9, -1000 )
|
Results:
|
A
|
B
|
1
|
number
|
Mround
|
2
|
333.7
|
333.5
|
3
|
333.8
|
334
|
4
|
333.3
|
334
|
5
|
555.3
|
400
|
6
|
555
|
1000
|
7
|
-555.7
|
-556
|
8
|
-555.4
|
-555
|
9
|
-1555
|
-2000
|
The above examples show how
the Mround function rounds the supplied number to the nearest multiple of the
supplied multiple argument. This may involve rounding up or down.
Notes
Ø MROUND
rounds up, away from zero.
Ø The
rounding occurs when the remainder left from dividing number by multiple is
greater than or equal to half the value of multiple.
Ø the
Number and Multiple arguments must have the same sign - either positive or
negative. If not, the function returns a #NUM! error in the cell.
Ø if
the Number and Multiple arguments are both negative, the function returns a
negative number in the cell as shown in row four in the image above.
Ø if
the Multiple argument is set to zero (0), the function returns a value of zero
in the cell as shown in row seven in the image above.
References
No comments:
Post a Comment