Sum based on keyed in value, stupid decimals appear

R

revinfo

Consider the following group of numbers displayed out to how ever many
decimals that is. Now, consider a formula that sums these:
=sum(a1:a25). Note all of these are keyed numbers. The crazy part is
none of these have a non zero value beyond the 2nd decimal place.
However, the results of the sum was 8748.51999999999. I didn't believe
this colleague's results so he emailed me his worksheet and I keyed in
the exact same numbers in another column and copiedand I got the same
results. The reoccurrence of the value 95.23 is what caused this after
about the 11th time. If I change the 12th 95.23 to 95.31, I get the
same stupid rounding, but if I choose a whole number or most any other
number with two decimlas, I do not have this problem. Highlighting the
cells with sum in the bottom function yields the result with only two
decimal points.

Anybody have any great ideas, and I assure you these are keyed
numbers, not from formulas that have rounding in them that is not
being displayed.


548.240000000000000000000000000000
1,229.600000000000000000000000000000
1,316.520000000000000000000000000000
2,074.610000000000000000000000000000
538.480000000000000000000000000000
202.520000000000000000000000000000
199.200000000000000000000000000000
938.890000000000000000000000000000
166.000000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
100.990000000000000000000000000000
95.230000000000000000000000000000
100.040000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
95.230000000000000000000000000000
95.310000000000000000000000000000
95.230000000000000000000000000000
95.310000000000000000000000000000
95.230000000000000000000000000000
95.280000000000000000000000000000
 
B

Bob I

You are merely seeing the limitation of binary representation of
decimals, and it has been around as long as software has existed. The
issue is resolved by proper rounding.
 
S

ShaneDevenshire

Hi,

you already know why, now a second way to resolve the issue:
1. Either format the cell to 0 or 2 decimals or
2. Use the =ROUND(A1,2) function to actually round the numbers.

Excel has about 11 functions that do some type of rounding or related action.
 
R

revinfo

You are merely seeing the limitation of binary representation of
decimals, and it has been around as long as software has existed. The
issue is resolved by proper rounding.
I haven't ever run across something this flaky in Excel, binary or
not. If it never happens in one of my worksheets, then I can be happy
enough.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top