Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Summing every third cell

Well, I've tried several different things, but have not been successful.
I'm trying to sum every third row of a particular column (i.e.
A2+A5+...) What I have written so far is:

For n = 2 To 233 Step 3
For m = 4 To 15 Step 1
Cells(236, m).FormulaR1C1 = ??????
Cells(236, m).NumberFormat = "$#,##0_);[Red]($#,##0)"
Next
Next

Any help would be great. Thanks!

Jason

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Summing every third cell

Jason Hancock wrote:

Well, I've tried several different things, but have not been successful.
I'm trying to sum every third row of a particular column (i.e.
A2+A5+...)


Sub a()
Dim sSum As Double, i As Long
For i = 2 To 11 Step 3
sSum = sSum + Application.Sum(Range("A" & i))
Next
End Sub

Alan Beban
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Summing every third cell

Jason Hancock wrote:

Well, I've tried several different things, but have not been successful.
I'm trying to sum every third row of a particular column (i.e.
A2+A5+...)


Without using VBA you can insert the following in the first cell of an
empty column (say, Column N)

=INDIRECT("A"&3*ROW()-1)

Then in the first cell of the next column (say, Column O)

=SUM(N:N)

The desired result will be in Cell O1

Alan Beban
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Summing every third cell

I've put this together, however I'm getting a runtime error 1004.
Anything I'm missing?

For i = 2 To 233 Step 3
For n = 3 To 15 Step 1
Cells(236, n).Formula = sSum = sSum +
Application.Sum(Range(n & i))
Cells(236, n).NumberFormat = "$#,##0_);[Red]($#,##0)"
Next
Next


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Summing every third cell

Or in one cell:

=SUMPRODUCT((A3:A200)*(MOD(ROW(A3:A200)-ROW(A3),3)=0))

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Alan Beban" skrev i en meddelelse
...
Jason Hancock wrote:

Well, I've tried several different things, but have not been successful.
I'm trying to sum every third row of a particular column (i.e.
A2+A5+...)


Without using VBA you can insert the following in the first cell of an
empty column (say, Column N)

=INDIRECT("A"&3*ROW()-1)

Then in the first cell of the next column (say, Column O)

=SUM(N:N)

The desired result will be in Cell O1

Alan Beban



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Summing every third cell

Leo Heuser wrote:

Or in one cell:

=SUMPRODUCT((A3:A200)*(MOD(ROW(A3:A200)-ROW(A3),3)=0))

I take it that to sum A2,A5,A8,etc., it should be A2 instead of A3?

Alan Beban
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Summing every third cell


"Alan Beban" skrev i en meddelelse
...
Leo Heuser wrote:

Or in one cell:

=SUMPRODUCT((A3:A200)*(MOD(ROW(A3:A200)-ROW(A3),3)=0))

I take it that to sum A2,A5,A8,etc., it should be A2 instead of A3?

Alan Beban


You're not a man easily fooled <g
Thanks.

LeoH


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ignoring text data in a cell when summing values in the same cell FM New Users to Excel 2 February 24th 10 02:51 AM
Summing every third cell bthieson Excel Worksheet Functions 6 May 12th 06 05:47 AM
Summing every other cell in a column? RJH Excel Worksheet Functions 4 April 13th 06 03:19 AM
Summing Every 40th cell? Mutcluck Excel Worksheet Functions 4 April 2nd 05 05:40 PM
summing cell into one hueyncandi Excel Worksheet Functions 2 November 14th 04 12:32 AM


All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"