說明
Use this function to round a number up (in a positive direction) to a specified number of digits. Supported in Chains.
ROUNDUP always rounds a number up regardless of the digits that follow. It's useful when you need to ensure a number is not underestimated, such as in certain financial or inventory calculations.
語法
ROUNDUP(number, num_digits)
Inputs
This function accepts the following arguments:
名稱 | 必要 | 說明 | Valid input |
---|---|---|---|
數字 |
是 | The number you want to round up. | Any real number. |
num_digits |
是 | The number of digits to which you want to round up the number. | An integer. Positive for decimal places, negative for digits left of decimal point. |
範例
範例資料
A | B |
---|---|
數量 | 說明 |
3.14159 | Pi |
-2.718 | Negative e |
1234.5678 | Large number |
0.00123 | Small number |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=ROUNDUP(A2, 0) |
Rounds Pi up to an integer. | 4 |
=ROUNDUP(A2, 2) |
Rounds Pi up to 2 decimal places. | 3.15 |
=ROUNDUP(A3, 1) |
Rounds negative e up to 1 decimal place. | -2.8 |
=ROUNDUP(A4, -2) |
Rounds the large number up to hundreds. | 1300 |
=ROUNDUP(A5, 4) |
Rounds the small number up to 4 decimal places. | 0.0013 |
附註
- If ROUNDUP is applied to text, it will result in a #VALUE! error.
- ROUNDUP is different from formatting a cell to display a certain number of decimal places, as it actually changes the value stored in the cell by removing all digits to the right of the last digit rounded.
-
- ROUNDUP always rounds away from zero, regardless of whether the number is positive or negative.
- If
num_digits
is positive (greater than 0), ROUNDUP rounds up to the specified number of decimal places. - If
num_digits
is 0, ROUNDUP rounds up to the nearest integer. - If
num_digits
is negative (less than 0) , ROUNDUP rounds up the digits to the left of the decimal point.
- If
- ROUNDDOWN always rounds towards zero.
- ROUND follows standard rounding rules: if the digit to the right of the rounding position is 5 or greater, it rounds up; otherwise, it rounds down.
- Applying ROUND to a positive number will increase it in a positive direction, applying ROUND to a negative number will increase it in a negative direction. ROUNDUP differs from the ROUND and ROUNDDOWN functions in the following ways:
- ROUNDUP always rounds away from zero, regardless of whether the number is positive or negative.
提示
- ROUNDUP can be useful in financial calculations where you want to err on the side of caution, for example to ensure a value is not underestimated in pricing or cost calculations.
- For displaying numbers with a certain number of decimal places without changing the underlying value, use cell formatting instead of ROUNDUP.
- ROUNDUP can be combined with other functions such as SUM or AVERAGE for more complex calculations.
- Consider using the other rounding functions (linked in Related functions) if you need to round numbers in a different manner.