說明
Use this function to round a number to the nearest multiple of a specified value.
MROUND is useful for rounding numbers to specific increments, such as the nearest five cents in financial calculations or the nearest quarter-hour in time tracking.
語法
MROUND(number, multiple)
Inputs
This function accepts the following arguments:
名稱 | 必要 | 說明 | Valid input |
---|---|---|---|
數字 |
是 | The number you want to round. | A real number, a reference to a cell containing a real number, or a formula which results in either of these. |
倍數 |
是 | The multiple to which you want to round the number. | Any non-zero number. |
範例
範例資料
A | B |
---|---|
數量 | 說明 |
27 | 整數 |
3.14159 | Pi |
-13.7 | Negative number |
0.47 | Fraction |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=MROUND(A2, 5) |
Rounds 27 to the nearest multiple of 5. | 25 |
=MROUND(A3, 0.1) |
Rounds Pi to the nearest tenth. | 3.1 |
=MROUND(A4, 2) |
Rounds -13.7 to the nearest multiple of 2. | -14 |
=MROUND(A5, 0.25) |
Rounds 0.47 to the nearest quarter. | 0.5 |
=MROUND(15.78, 0.05) |
Rounds 15.78 to the nearest 5 cents. | 15.80 |
附註
- The result of MROUND has the same sign as
number
. - If
number
andmultiple
have different signs, MROUND returns a #NUM! error. - If
multiple
is 0, MROUND returns a #DIV/0! error. - MROUND rounds up when the remainder of the division by
multiple
is exactly half the value ofmultiple
. -
MROUND differs from ROUND in that while MROUND rounds to a specified multiple of the supplied value, ROUND rounds to a specified number of decimal places.
提示
- MROUND is useful for rounding prices to the nearest sub-unit (cent/nickel/quarter/etc.) ; it is also useful in time tracking to round time to the nearest quarter-hour or half-hour.
- You can combine MROUND with other functions such as SUM or AVERAGE for more complex calculations.
- Be aware of potential rounding errors when working with very small multiples due to precision limitations.
- Consider using the other rounding functions (linked in Related functions) if you need to round numbers in a different manner.