Sum Blocks of data. Function or VBA

excelnovi

New Member
Joined
Feb 10, 2011
Messages
6
Hi all,

I think il need VBA for this one. I would appreciate any help.

I have 100,000 rows of data in cell A1.

I want to sum 5 rows at a time and put the results in column B starting b1,b2,b3 etc

So the sum of a1 to a5 goes into b1, sum of a6 to a10 goes into b2 and so on.

Thanks for your help
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi all,

I think il need VBA for this one. I would appreciate any help.

I have 100,000 rows of data in cell A1.

I want to sum 5 rows at a time and put the results in column B starting b1,b2,b3 etc

So the sum of a1 to a5 goes into b1, sum of a6 to a10 goes into b2 and so on.

Thanks for your help
In B1 ente and copy down:

=SUM(INDEX($A$1:$A$100000,(ROWS(B$1:B1)-1)*5+1):INDEX($A$1:$A$100000,(ROWS(B$1:B1))*5))
 
Upvote 0
Welcome to the board...

Try

=SUM(OFFSET(A$1,(ROWS(B$1:B1)-1)*5,0,5,1))

Hope that helps.
 
Upvote 0
Thanks very much Jonmo works perfect!!

I am new to vba and have been trying to write this simple loop for a while now would rally like if someone could show me how to do it with VBA.
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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