respree
Active Member
- Joined
- Apr 14, 2003
- Messages
- 258
Does anyone know if Excel has a rounding problem?
I am taking a number, dividing it by 1000 and rounding it to 1 decimal point.
i.e. Cell A1 - 41349
Cell A2 - =round(a1/1000),1)
formula "appears to" correctly produces 41.4 as the answer
Cell B1 - 49199
Cell B2 - =round(B1/1000),1)
formula "appears to" correctly produces 49.2 as the answer
However, A2 minus B2 (formula in C2) doesn't produce the expected (7.8)
Its very close, but the actual answer when displayed in 14 decimal positions is (-7.80000000000001) - note the "1" in the 14th position.
This may seem like trivial rounding difference, but the reason I'm asking is because I'm trying to validate the answer by matching it against Cell C2, which has the formula: if(c2=-7.8,"true","false")
The answer 'should be' true, but instead its saying its false because of the 1 in the 14th position of the answer.
Is this a design flaw with Excel or does anybody know a way around this.
Thanks very much for your input.
I am taking a number, dividing it by 1000 and rounding it to 1 decimal point.
i.e. Cell A1 - 41349
Cell A2 - =round(a1/1000),1)
formula "appears to" correctly produces 41.4 as the answer
Cell B1 - 49199
Cell B2 - =round(B1/1000),1)
formula "appears to" correctly produces 49.2 as the answer
However, A2 minus B2 (formula in C2) doesn't produce the expected (7.8)
Its very close, but the actual answer when displayed in 14 decimal positions is (-7.80000000000001) - note the "1" in the 14th position.
This may seem like trivial rounding difference, but the reason I'm asking is because I'm trying to validate the answer by matching it against Cell C2, which has the formula: if(c2=-7.8,"true","false")
The answer 'should be' true, but instead its saying its false because of the 1 in the 14th position of the answer.
Is this a design flaw with Excel or does anybody know a way around this.
Thanks very much for your input.