sum every four rows

yankee428

Active Member
Joined
Apr 12, 2004
Messages
348
column of 100 rows

i need to sum every fourth line. for example

1
2
3
4 sum = 10
5
6
7
8 sum = 26
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Insert a column. In the fourth row of the new column, put a formula that sums the cell to the left of it and the three cells above that one.
In the new column, highlight the cell with the formula and the three above it. Select Edit Copy. Starting with the cell just below it, highlight all the way down to the last row. Selecte Edit Paste.

hth,
Colbymack
 
Upvote 0
enter this:

=SUM(IF(MOD(ROW(A1:A100),4)=0,A1:A100))

and confirm with Ctrl+Shift+Enter (it's an array formula).

Best regards

Richard
 
Upvote 0
Parsnip said:
enter this:

=SUM(IF(MOD(ROW(A1:A100),4)=0,A1:A100))

and confirm with Ctrl+Shift+Enter (it's an array formula).

Best regards

Richard

I don't believe that meets OP's question.
 
Upvote 0
A non-array formula.


Put this formula in cell A4 and copy it down.

=IF(ROUND((CELL("row",A4)/4),0)=(CELL("row",A4)/4),SUM(A1:OFFSET(A4,0,0)),"")
Sum every 4 rows.xls
ABCD
11
22
33
4410
55 
66 
77 
8826
99 
1010 
1111 
121242
1313 
1414 
1515 
161658
Sheet1
 
Upvote 0
vane0326 said:
A non-array formula.


Put this formula in cell A4 and copy it down.

=IF(ROUND((CELL("row",A4)/4),0)=(CELL("row",A4)/4),SUM(A1:OFFSET(A4,0,0)),"")
...

Is that not too expensive and non-robust?
 
Upvote 0
Aladin Akyurek said:
vane0326 said:
A non-array formula.


Put this formula in cell A4 and copy it down.

=IF(ROUND((CELL("row",A4)/4),0)=(CELL("row",A4)/4),SUM(A1:OFFSET(A4,0,0)),"")
...

Is that not too expensive and non-robust?


Another way.


=IF(ROUND((CELL("row",A4)/4),0)=(CELL("row",A4)/4),SUM(A1:A4),"")


What do you think ?
 
Upvote 0
just_jon said:
=IF(MOD(ROW(),4)=0,SUM(INDEX(A:A,ROW()-3):A1),"")

In A1 copied down.


I like that ! :biggrin:



I would like to know how does this fit in your formula " : "

:A1
 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

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