Reputation: 1
Not sure this is even possible, but perhaps someone knows how to do it. I have a row with 6 columns (A-F). The first three columns are one set and the last three columns are a different set. I want to sum both sets and then find the difference between the sums. For example if the row is:
A1 A2 A3 A4 A5 A6
4 5 6 7 8 9
I want to add 4+5+6 and 7+8+9 and then find the difference between the two sums.
Upvotes: 0
Views: 14331
Reputation: 3
You can group each set and find their sum using =SUM()
. You also mentioned that there are 6 columns which is A-F and there are 2 sets, A-C and D-F, so it should be something like this:
=SUM(A1:C1)-SUM(D1:F1)
Or
=SUM(A1, B1, C1)-SUM(D1, E1, F1)
Upvotes: 0
Reputation: 12570
I think its something like this: =SUM(A1:A3)-SUM(A4:A6)
.
If you are only interested in the magnitude, you can put it in an absolute value: =ABS(SUM(A1:A3)-SUM(A4:A6))
.
[edited to match revised post]
Also, now that I read your post more carefully, you also mention you want to add items within columns as well. In that case, its the same formula, except you change the letters, not the numbers: =SUM(A1:C1)-SUM(D1:F1)
.
Upvotes: 2
Reputation: 42872
In the spirit of the previous answer, it's
=SUM($A$1:$A$3)-SUM($A$4:$A$6)
Another solution is:
=$A$1+$A$2+$A$3-$A$4-$A$5-$A$6
The dollars aren't necessary, but if you build this formula using the mouse, you will get them and they don't matter.
Upvotes: 0