ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sum of digits in column not giving correct sum (https://www.excelbanter.com/excel-worksheet-functions/218377-sum-digits-column-not-giving-correct-sum.html)

Mary Beth

sum of digits in column not giving correct sum
 
My column of numbers is not giving the correct total. My formula for the
total is: =ROUND(SUM(A4:A15),2) The numbers I added are 6.30+1.74+1.24 and
got an answer of 9.27 (should be 9.28). The numbers I am adding are
formulated from another macro not just a number I inserted (it is a formula
to calculate the gst out of a number from another column) and this is why I
think I am getting a wrong answer but I don't know how to correct it.
Help please!


Michael Arch

sum of digits in column not giving correct sum
 
The problem you have is that the numbers have more than 2 decimals, so when
they are displayed they show an already "rounded" value, however, the round
formula picks all of the decimals and then the rounding occurs. So you could
display more than two decimals or ask the round to be 3 decimals and then
format the cell to show only two decimals.

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Mary Beth" wrote:

My column of numbers is not giving the correct total. My formula for the
total is: =ROUND(SUM(A4:A15),2) The numbers I added are 6.30+1.74+1.24 and
got an answer of 9.27 (should be 9.28). The numbers I am adding are
formulated from another macro not just a number I inserted (it is a formula
to calculate the gst out of a number from another column) and this is why I
think I am getting a wrong answer but I don't know how to correct it.
Help please!


Gary''s Student

sum of digits in column not giving correct sum
 
You are getting the "wrong" answer because the values you are adding are not
the values you see in the cells. The values you see are truncated by
formatting.

If you expand the formats of the cells being added to display more decimal
digits, you will see the answer is correct.
--
Gary''s Student - gsnu200829


"Mary Beth" wrote:

My column of numbers is not giving the correct total. My formula for the
total is: =ROUND(SUM(A4:A15),2) The numbers I added are 6.30+1.74+1.24 and
got an answer of 9.27 (should be 9.28). The numbers I am adding are
formulated from another macro not just a number I inserted (it is a formula
to calculate the gst out of a number from another column) and this is why I
think I am getting a wrong answer but I don't know how to correct it.
Help please!


Ron Rosenfeld

sum of digits in column not giving correct sum
 
On Thu, 29 Jan 2009 08:47:01 -0800, Mary Beth <Mary
wrote:

My column of numbers is not giving the correct total. My formula for the
total is: =ROUND(SUM(A4:A15),2) The numbers I added are 6.30+1.74+1.24 and
got an answer of 9.27 (should be 9.28). The numbers I am adding are
formulated from another macro not just a number I inserted (it is a formula
to calculate the gst out of a number from another column) and this is why I
think I am getting a wrong answer but I don't know how to correct it.
Help please!


IF you want your SUM to match the *displayed* value sum, then you need to round
before you SUM.

Try this **array** formula (confirmed with <ctrl<shift<enter):

=sum(round(a4:a15),2))

--ron


All times are GMT +1. The time now is 05:42 PM.

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