강인규
Nov 08, 2024Copper Contributor
Rounding issue with Excel
Why is the value of "=ROUND(((7614.23-7520.08)*30),0)" not 2825 but 2824?
process..
7614.23-7520.08 =94.15
94.15 * 30 = 2824.5
round(2824.5,0) => 2825
Why is the value of "=ROUND(((7614.23-7520.08)*30),0)" not 2825 but 2824?
process..
7614.23-7520.08 =94.15
94.15 * 30 = 2824.5
round(2824.5,0) => 2825
That's due to floating point arithmetic, causing minute rounding variances. Google on that term to learn more. The result you expect to be 94.15 is in fact:
Multiplied by 30, and it becomes 2824.49999999999
To avoid this, round the intermediate calculation to 1 decimal first, then round again to zero decimals.
=ROUND((ROUND((7614.23-7520.08)*30,1)),0)