Sum a column that has positive and negative values

julhs

Active Member
Joined
Dec 3, 2018
Messages
471
Office Version
  1. 2010
Platform
  1. Windows
I’m flummoxed as to the correct formula that I need to return the expected/desired result.
“Total Owed” in D18 is the desired outcome but “Total Owed” in H14 is not giving the expected/desired result.
All data is entered as numbers and not text formatted as a number.
Accounts 2016 - 2019 Final Currant Master New New (Autosaved).xlsm
ABCDEFGHI
1
2
3
4
510.00-10.00
690.2190.21
789.9589.95
889.9589.95
9250.00-250.00
1089.9589.95
11126.19126.19
1289.9589.95
1350.0050.00
14886.20Total owed366.20
15
16-10.00
17-250.00
18Total owed626.20
19
20
Sheet3
Cell Formulas
RangeFormula
D14,H14D14=SUM(D5:D13)
D18D18=SUM(D14:D17)
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I don't see the issue.
Which value is wrong and what exactly do you expect it to be?
 
Upvote 0
Your two examples are not the same sum. On the left, you are reversing the sum of 10 and 250...so those effectively are zeroed out. On the right, you are actually subtracting 10 and 250...so 366.20 is correct. On the left, you would need to subtract another 10 and 250.
 
Upvote 0
I was looking for some mathematical/computational error and not finding one (because there isn't one).
Sounds like Kirk probably identified their misunderstanding of the situation/data, and shows why the two columns are not equivalent!
 
Upvote 0
If you are trying to sum the values as positive whether they are entered as positive or negative, then do this:

=SUM(ABS(H5:H13))
 
Upvote 0
This is a bit of a catch all reply.
I’m not sure how better to describe things, so excuse me for the simplicity.
Think of this like using a calculator.
1+1=2
you then subtract 3 and the result is “-1”
you then add 5 and the result is “4”
So it comes down to how the formula in H14 handles the minus values in the column and returns the same value that’s in D18.

Specifically to Scott.
Tried that previously but it returns a #Value error.
 
Upvote 0
Did you follow my post #3? In the column D calculation, you've added 10 and 250 to obtain a sum of 886.20. In column H, you've actually subtracted 10 and 250 (that is, you've added -10 and -250) to obtain a sum of 366.20. The point is that in the lower calculation in column D, if you want to obtain the same result of 366.20, you would not simply subtract 10 and 250....that only zeroes out the prior addition of those two numbers (10 and 250). You need to subtract them one more time...so 886.20-10-10-250-250=366.2. There is nothing unusual about how SUM is handling the values.
 
Upvote 0
This is a bit of a catch all reply.
I’m not sure how better to describe things, so excuse me for the simplicity.
Think of this like using a calculator.
1+1=2
you then subtract 3 and the result is “-1”
you then add 5 and the result is “4”
So it comes down to how the formula in H14 handles the minus values in the column and returns the same value that’s in D18.

Specifically to Scott.
Tried that previously but it returns a #Value error.
Per your example, the only way to get the same result is to ignore the negative values.. otherwise, the formula is working as it is intended to work.
 
Upvote 0
I appreciate all the advice so far, but I’m going to have to take a time out on it and come back to it tomorrow.
 
Upvote 0
In a nutshell, excluding the sums, the data in your two lists (columns) is NOT the same, as Kirk explained.
So it should not be returning the same result.

The formulas are all solid. Your logic/understanding is just a little faulty.
Maybe when you come back to it tomorrow with fresh eyes it will be more clear to you.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top