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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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