A quicker way?

UpTheArgyle

Board Regular
Joined
Jan 12, 2006
Messages
179
Hi

I have a spreadsheet with a lot of lines of data - i now decide that in Line 1 i want to see a total of the values of column E, but i want to add up every 18th cell starting at E38.
Is there a quicker way to get this formula other than clicking in each 18th cell, pressing the + key and going onto the next 18th !?

=E38+E56+E74+E92+E110+E128+E146+E164+E182+E200+E218+E236+E254+E272+E290+E308+E326+E344+E362+E380+E398+E416+E434+E452+E470

I need this down to line 1000

thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You can do this with a MOD formula.

Unfortunately i am just learning it.

An MVP can answer this for you.
 
Upvote 0
I'd use a macro. Try:
Code:
Sub Sum18s()
Dim i As Long
Dim form As String
 
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With
 
form = "E"
i = 38
 
Do
    form = form & i & "+E"
    i = i + 18
Loop Until i > 1000
 
form = Left(form, Len(form) - 2)
Range("E1").Formula = "=SUM(" & form & ")"
 
With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
End With
 
End Sub
 
Upvote 0
Try:

=SUM(IF(MOD(ROW(E38:E1000),18)=2,E38:E1000,"")

Confirm entry with CTRL+SHIFT+ENTER to store this as an array entered formula. You will know it is entered properly when you see {brackets} around the formula.
 
Upvote 0
Is this what you're after? (confirm with ctrl+shift+enter)
=SUM(IF(MOD(ROW(E38:E1000)-2,18)=0,E38:E1000))
 
Upvote 0
This formula seems to work, but it's probably hightly inefficient and maybe even wrong.

Anyway here it is:

=SUMPRODUCT(--(MOD(ROW(E38:E1000),18)=2), E38:E1000)

This uses the row number but it might be worth checking to see if you can base the criteria for summing on something else.

PS I bet this can probably be done with SUMIF, or the new SUMIFS.
 
Upvote 0
Hi,

In cell F38 enter the formula:

=IF(MOD(ROW(),18)=2,E38,0)

and copy down as much as you like

Then sum based on column F

George

Hi

I have a spreadsheet with a lot of lines of data - i now decide that in Line 1 i want to see a total of the values of column E, but i want to add up every 18th cell starting at E38.
Is there a quicker way to get this formula other than clicking in each 18th cell, pressing the + key and going onto the next 18th !?

=E38+E56+E74+E92+E110+E128+E146+E164+E182+E200+E218+E236+E254+E272+E290+E308+E326+E344+E362+E380+E398+E416+E434+E452+E470

I need this down to line 1000

thanks
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,839
Members
452,948
Latest member
UsmanAli786

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