ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   the decimals extends after the sum function (https://www.excelbanter.com/excel-worksheet-functions/239512-decimals-extends-after-sum-function.html)

hou

the decimals extends after the sum function
 
when I use the Sum function to calculate about 10,000 numbers, which have
been rounded to 2 decimals (using the round function in excel), the result of
sum came out with more than 2 decimals. It is eight decimals!
I don't know why, and I split the numbers into several groups. I find that
an interesting thing, the sum of Group A has two decimals, the same with
Group B. But when I calculate the sum of the two groups, the result also came
out with 8 decimals!!!...

joeu2004

the decimals extends after the sum function
 
"hou" wrote:
when I use the Sum function to calculate about 10,000 numbers, which have
been rounded to 2 decimals (using the round function in excel), the result
of
sum came out with more than 2 decimals.


The short answer is: you need to round the sum to 2 decimal places as well.


I find that an interesting thing, the sum of Group A has two decimals,
the same with Group B.


Just a coincidence. In fact, even those numbers are probably not accurate
to 2 decimal places. It just appears that way.


I don't know why


In general, numbers with decimal fractions cannot be represented exactly
because of the way that Excel (and most applications) do arithmetic on
binary computers. For more information, you might look at
http://support.microsoft.com/kb/78113 .


----- original message -----

"hou" wrote:
when I use the Sum function to calculate about 10,000 numbers, which have
been rounded to 2 decimals (using the round function in excel), the result
of
sum came out with more than 2 decimals. It is eight decimals!
I don't know why, and I split the numbers into several groups. I find that
an interesting thing, the sum of Group A has two decimals, the same with
Group B. But when I calculate the sum of the two groups, the result also
came
out with 8 decimals!!!...



Bernard Liengme[_3_]

the decimals extends after the sum function
 
I would very much like to see the data. Could you email me a file? Please
get my email from my website
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"hou" wrote in message
...
when I use the Sum function to calculate about 10,000 numbers, which have
been rounded to 2 decimals (using the round function in excel), the result
of
sum came out with more than 2 decimals. It is eight decimals!
I don't know why, and I split the numbers into several groups. I find that
an interesting thing, the sum of Group A has two decimals, the same with
Group B. But when I calculate the sum of the two groups, the result also
came
out with 8 decimals!!!...





All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com