The ROUND() function is a useful tool for formatting numbers to a specified number of decimal places. This function can be used in a variety of ways, such as rounding a number to a whole number or rounding to a specific number of decimal places. In this guide, we will walk through the syntax of the ROUND() function and provide examples of how to use it in different scenarios.
The ROUND() function takes two arguments: the number to be rounded and the number of decimal places to round to. The syntax for the ROUND() function is as follows:
ROUND(number, num_digits)
“number” is the number that you want to round.
“num_digits” is the number of decimal places to round to. If “num_digits” is a positive number, then the number will be rounded to that many decimal places. If “num_digits” is a negative number, then the number will be rounded to the left of the decimal point.
Examples:
Rounding to x decimal places. For example, if you have a number in cell A2 and you want to round it to two decimal places, you would enter the following formula in another cell: =ROUND(A2, 2)
Instead of rounding to two decimal places, you want it to round to 4, so simply change the 2 in the same formula to 4. The formula should look like: =ROUND(A2,4)
Rounding to the nearest integer. In the same example, we want to round up the number in cell A2 to the nearest integer, you would enter the following formula: =ROUND(A2,0)
Note: When using the ROUND() function, if the number of decimal places you want to round to is not specified, it defaults to 0, which will round the number to the nearest whole number.
Rounding to the nearest tens or hundreds. Using the same example, we want to round up the number in cell A2 to the nearest ten. You would enter the following formula: =ROUND(A2, -1).
To round it to the nearest hundred, change the num_digits to -2. -3 for thousand, and so on and so forth.
Note: When rounding up to the nearest hundred, when the tens digit is not equal to or greater than 5, Excel will return a zero. In this example, the tens digit in 46 is 4, which is not equal to or greater than 5, so Excel will return the function as a zero.
Rounding negative number to x decimal places. In the same example, we will change the number in cell A2 to a negative number and then round it to the nearest 2 decimal places. You would do the same formula as if it were a positive number: =ROUND(A2,2)
Rounding negative numbers to a whole number. The formula for negative numbers is unchanged from the one for positive numbers. So using the same example, the formula should be: =ROUND(A2,0)
Conclusion
The ROUND() function in Excel is a useful tool for formatting numbers to a specified number of decimal places, and it can be used to round a number to a whole number or to a specific number of decimal places. It’s important to remember the syntax and the rounding method used by the function when using it.