Description
Use this function to round a number to a specified number of digits. Supported in Chains.
Round is useful for controlling the precision of numerical data in calculations and display.
Syntax
ROUND(number, num_digits)
Inputs
This function accepts the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
number |
Yes | The number you want to round. | A real number, a cell reference that contains a real number, or a formula which results in a real number. |
num_digits |
Yes | The number of digits to which you want to round the number. | An integer, a cell reference that contains an integer, or a formula which results in an integer. |
Examples
Sample data
| A | B | |
|---|---|---|
1 |
3.14159 | 1234.5678 |
2 |
-2.9876 | 0.0005 |
3 |
10.5 | 99.99 |
4 |
Fred | 3/11/2022 |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Round a number to a specified number of decimal places. | =ROUND(A1, 2) |
The ROUND function rounds a number to a specified number of digits. This formula rounds the value in A1 (3.14159) to 2 decimal places, resulting in 3.14. |
| Round a number to the nearest multiple of a power of 10. | =ROUND(B1, -2) |
A negative number for the second argument rounds the number to the left of the decimal point. This formula rounds the value in B1 (1234.5678) to the nearest 100, returning 1200. |
| Round a negative number to a specified number of decimal places. | =ROUND(A2, 1) |
This formula rounds the value in A2 (-2.9876) to one decimal place. The 8 in the second decimal place causes the 9 to round up, returning -3.0. |
| Round a small decimal number. | =ROUND(B2, 3) |
This formula rounds the value in B2 (0.0005) to 3 decimal places. The 5 in the fourth decimal place causes the preceding digit to round up, returning 0.001. |
| Round a number with a decimal value to the nearest whole number. | =ROUND(A3, 0) |
This formula rounds the value in A3 (10.5) to 0 decimal places. In most spreadsheet programs, values ending in .5 or greater round up, returning 11. |
| Handle text values in a rounding function. | =ROUND(A4, 0) |
The ROUND function requires a numeric value as its first argument. Since A4 contains text, the function returns an error. For this data set, the formula returns #VALUE!. |
Notes
- If ROUND is applied to text, it will result in a #VALUE! error.
- ROUND 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.
- 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.
- ROUND differs from ROUNDUP and ROUNDDOWN in the following ways:
- If
num_digitsis positive (greater than 0), ROUND rounds (up or down) to the specified number of decimal places. - If
num_digitsis 0, ROUND rounds (up or down) to the nearest integer. - If
num_digitsis negative (less than 0), ROUNDUP rounds (up or down) the digits to the left of the decimal point. - ROUNDUP always rounds away from zero.
- ROUNDDOWN always rounds towards zero.
- If
Tips
- Use ROUND when you need to perform calculations with a specific level of precision.
- For displaying numbers with a certain number of decimal places without changing the underlying value, use cell formatting instead of ROUND.
- ROUND can be combined with other functions such as SUM or AVERAGE for more complex calculations.
- Be aware of potential rounding errors in financial calculations where high precision is required.
- Consider using ROUNDUP or ROUNDDOWN if you need to always round in a specific direction regardless of the digit values.
- Consider using the other rounding functions (linked in Related functions) if you need to round numbers in a different manner.