Rounding to significant digits is a way of expressing a number with a certain number of digits that are meaningful or important. For example, if you want to round the number 1234.567 to three significant digits, you would get 1230, because the first three digits (1, 2, and 3) are the most significant ones, while the rest are less significant and can be dropped.
Rounding to significant digits can be useful when you want to simplify a number or avoid unnecessary precision. For example, if you are measuring the length of a table with a ruler, you might get a value like 123.456 cm, but you don’t need to report all those decimals, because they are beyond the accuracy of your measurement. You can round the value to three significant digits, which is 123 cm, and still convey the same information.
In this article, we will show you how to round a number to a given number of significant digits in Excel using a formula. We will also explain the basic theory behind the formula, and provide a detailed example with real data.
To round a number to a given number of significant digits in Excel, you can use the following formula:
=ROUND(number, digits - (1 + INT(LOG10(ABS(number)))))
where:
number
is the value that you want to rounddigits
is the number of significant digits that you want to keepROUND
is a function that rounds a number to a specified number of digitsINT
is a function that returns the integer part of a numberLOG10
is a function that returns the base-10 logarithm of a numberABS
is a function that returns the absolute value of a number
The formula works by calculating the number of digits to the right or left of the decimal point that need to be rounded, depending on the magnitude of the number. This is done by using the LOG10
function, which returns the exponent of 10 that is equal to the number. For example, LOG10(1000)
returns 3, because 10^3 = 1000. The INT
function then trims off the decimal part of the exponent, and the ABS
function converts the number to a positive value, in case it is negative. The formula then subtracts 1 from the exponent, and subtracts the result from the number of significant digits that you want to keep. This gives the number of digits that need to be rounded by the ROUND
function.
For example, if you want to round the number 1234.567 to three significant digits, the formula would be:
=ROUND(1234.567, 3 - (1 + INT(LOG10(ABS(1234.567)))))
The formula would calculate the following:
LOG10(ABS(1234.567))
returns 3.0915, which is the exponent of 10 that is equal to 1234.567INT(LOG10(ABS(1234.567)))
returns 3, which is the integer part of the exponent1 + INT(LOG10(ABS(1234.567)))
returns 4, which is 1 more than the exponent3 - (1 + INT(LOG10(ABS(1234.567))))
returns -1, which is the number of digits to the left of the decimal point that need to be roundedROUND(1234.567, -1)
returns 1230, which is the number rounded to three significant digits
Procedures
To use the formula to round a number to a given number of significant digits in Excel, follow these steps:
- Select the cell where you want the rounded number to appear.
- Enter the formula
=ROUND(number, digits - (1 + INT(LOG10(ABS(number)))))
, wherenumber
is the cell reference of the original number that you want to round, anddigits
is the number of significant digits that you want to keep. For example, if you want to round the number in cell A1 to three significant digits, you would enter=ROUND(A1, 3 - (1 + INT(LOG10(ABS(A1)))))
. - Press Enter, and the cell will display the rounded number to the specified number of significant digits.
Example
Suppose you have a table of sales data for different products, as shown below:
Product | Sales |
---|---|
A | 1234.567 |
B | 456.789 |
C | 78.901 |
D | 9.012 |
You want to round the sales values to two significant digits, and display them in a new column. To do this, you can use the formula =ROUND(number, digits - (1 + INT(LOG10(ABS(number)))))
, as explained above. The result would look like this:
Product | Sales | Rounded Sales |
---|---|---|
A | 1234.567 | 1200 |
B | 456.789 | 460 |
C | 78.901 | 79 |
D | 9.012 | 9 |
To create the rounded sales column, follow these steps:
- Select the cell where you want the first rounded value to appear, such as B2.
- Enter the formula
=ROUND(A2, 2 - (1 + INT(LOG10(ABS(A2)))))
, where A2 is the cell reference of the original sales value that you want to round, and 2 is the number of significant digits that you want to keep. - Press Enter, and the cell will display the rounded sales value to two significant digits, such as 1200.
- Drag the fill handle down to copy the formula to the rest of the cells in the column, or use the keyboard shortcuts Ctrl+C and Ctrl+V to copy and paste the formula.
- The column will display the rounded sales values for all the products, as shown above.
Other Approaches
There are other ways to round a number to a given number of significant digits in Excel, such as using custom number formats, or using the ROUNDUP and ROUNDDOWN functions. However, these methods have some limitations or drawbacks, such as:
- Custom number formats only change the appearance of the number, not the actual value. This means that if you use the number in other calculations, it will still use the original value, not the rounded one. For example, if you format the number 1234.567 as 1200 using a custom number format, and then use it in a formula like
=A1*2
, the result will be 2469.134, not 2400. - The ROUNDUP and ROUNDDOWN functions can round a number up or down to a given number of digits, but they do not take into account the significance of the digits. For example, if you use the ROUNDUP function to round the number 1234.567 to two digits, you will get 1300, which is not the same as rounding to two significant digits, which would be 1200. Similarly, if you use the ROUNDDOWN function to round the number 456.789 to two digits, you will get 450, which is not the same as rounding to two significant digits, which would be 460.
Therefore, the formula =ROUND(number, digits - (1 + INT(LOG10(ABS(number)))))
is the most reliable and accurate way to round a number to a given number of significant digits in Excel.