Celeb Glow
updates | February 28, 2026

How do I calculate the total difference between two columns of figures in Google spreadsheet/Excel?

Usually I would just calculate the difference of each row like this: =B1-A1

Then I would sum up the values of the column like this =SUM(C1:C10) and get my desired value.

I don't want the C-column. Is it possible to calculate it immediately?

For example I tried: =SUM((B1-A1):(B10-A10)) (which doesn't work)

Usually I can find the answers somewhere in the documentation, but my Math-English vocabulary is a little bit rusty and with German documentation I haven't found what I was looking for.

I know I could put 10 values manually inside the sum. But this doesn't scale gracefully, I want to be able to change only a few values in the formula instead of adding 1000.

0

3 Answers

The following should work for this case:

=SUM(B1:B10) - SUM(A1:A10)
5

If you want to calculate each value in turn, evaluate it as a positive number, THEN work out what that adds to then your best bet is an array formula.
These are entered not by pressing ENTER at the end, but CTRL+SHIFT+ENTER. When done, you will notice a pair of braces on either side ( { } ).
Note - you must use this method, you cannot type the braces and CTRL+SHIFT+ENTER etc in

=sum ( abs(b1:b10 - a1:a10) )

Clearly, you can replace sum with average if that better suits your needs.

Other threads suggest SumProduct, if any of the cells may be empty. A trick is used for one argument, and the other is the desired difference, eg: =SumProduct(--(b1:b10<>""), (b1:b10 - a1:a10)) where the trick is using -- to convert logical/boolean values to 1 or 0. However, Excel 2010 threw up a #VALUE! against that 2nd argument. An alternative: =(Sum(b1:b10)-SumProduct(--(b1:b10<>""),a1:a10))/Count(b1:b10) But that will result in #DIV/0!, if all the cells in the B range are empty.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy