Math & Trig
Round a number to N significant figures (scientific and lab precision)
Dynamically compute ROUND's decimal-places argument from INT(LOG10(ABS(x))) to round large integers, tiny decimals, and negatives to N sig figs.
Why fixed decimal places fail significant-figure rules
ROUND(x, 2) rounds to two decimal places regardless of scale: 12,847 stays numerically 12,847, while 0.004567 becomes zero. ROUND does not itself set the displayed number of decimal places.
INT(LOG10(ABS(x))) finds the order-of-magnitude power of 10 (4 for 12,847; -3 for 0.004567). Passing SigFigs - 1 - INT(LOG10(ABS(x))) as ROUND's second argument rounds 12,847 at -2 (hundreds -> 12,800) and 0.004567 at +4 (0.0046).
| Measurement (A) | SigFigs (B) | Order INT(LOG10) | ROUND Digits | Result |
|---|---|---|---|---|
| 12847 | 3 | 4 | 3 - 1 - 4 = -2 | 12800 |
| 0.004567 | 2 | -3 | 2 - 1 - (-3) = 4 | 0.0046 |
| -987.6 | 2 | 2 | 2 - 1 - 2 = -1 | -990 |
Zero-safe N significant figures formula
Always guard A2 = 0 first because LOG10(0) is mathematically undefined (#NUM!).
=IF(A2=0, 0, ROUND(A2, B2 - 1 - INT(LOG10(ABS(A2)))))Why INT beats TRUNC for sub-1 decimals
For 0.004567, LOG10 is -2.34: INT floors to -3 (giving 4 decimal places), whereas TRUNC would chop to -2 and lose a significant digit.
=INT(LOG10(ABS(A2)))Inputs and interpretation
Require a positive integer significance count within the spreadsheet’s numeric precision (typically no more than 15 decimal digits). This rounds a number; it does not preserve trailing-zero significance in its display. Use appropriate scientific formatting for values such as 12,800. The diagnostic LOG10 expression is undefined at zero; the main formula guards that case. Very large/small numbers and powers-of-ten boundaries remain subject to floating-point limits.
Try the example
Use the original values or change them to test your understanding.