Formula to sum every nth row but not all the nth row

Siyanna

Well-known Member
Joined
Nov 7, 2011
Messages
1,146
Hi

I have some numbers in column A (A1:A200)

I want to be able to add every 9 rows from A1 but not all the way

In cell C1 i have the number to determine how far i go down

so in this example say in C1 i have the number 1 the Return A2
if i have the number 2 then add A1 + A10
if i have the number 4 then add A1+A10+A19+A28 etc

hope this makes sense
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi
try the following macro codes
Code:
Sub siyanna()
Dim total As Integer, a As Integer
total = 0
    For a = 1 To Cells(1, 3)
    total = total + Cells((a - 1) * 9 + 1, 1)
    Next a
MsgBox "The total of " & Cells(1, 3) & " rows is " & total
End Sub
ravishankar
 
Upvote 0
can i do this with a formula please

Hi, here is one option you can try..

Code:
=SUMPRODUCT(--(MOD((ROW(A1:INDEX(A1:A200,((C1-1)*9)+1))-MIN(ROW(A1:INDEX(A1:A200,((C1-1)*9)+1)))+1)-1,9)=0),A1:INDEX(A1:A200,((C1-1)*9)+1))
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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