Home > Software engineering >  Excel - how to calculate sum of multiple rows into different columns
Excel - how to calculate sum of multiple rows into different columns

Time:12-01

I don't know how to title this. However the question is similar but the output I need is different. Hopefully screen shot will show more clarity.

With formula showing:

with formula showing

What I'm trying to do and hopefully is able to do is, I need to do all those sum's and for the answers to be in the cells shown in total 1 and total 2. For those totals I did it manually, is there a way to do it automatically?

When I do subtotal for instance, I can do each block of sums, but I get the total answer for the whole table and not for each section as shown in the image. When I drag the sum down, I have to delete every other row. Is there a cleaner way?

Without formula showing:

without formula showing

Thank you for any help in advance.

CodePudding user response:

While I don't really understand what you are accomplishing with the formula in column E, this should solve your problem:

In Column E:

=IF(MOD(ROW(),2)=0,$C2,"")

In Column F:

=IF(MOD(ROW(),2)=0,SUM(D2,D3),"")

This will only populate on the even numbered rows.

CodePudding user response:

Select the block E2:F3 (4 cells) and drag down small green box at the right bottom corner of F3. This will copy the block through all the lines.

(Note: you should select two lines to copy the pattern)

CodePudding user response:

Use this in E2 : =IF(ISEVEN(ROW(),SUM(C2:C3)),"") You can drag it down and to column F.

Or dynamically: =IF(ISEVEN(ROW(),SUM(INDEX($A:$D,ROW(),COLUMN()-2):INDEX($A:$D,ROW() 1,COLUMN()-2))),"")

  • Related