+ Reply to Thread
Results 1 to 5 of 5

Sum every "n"th row

  1. #1
    Registered User
    Join Date
    10-28-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    78

    Sum every "n"th row

    I'm trying to sum every 4th row in a column. I have about 100 rows of data, and need to break it down. Is there a way to select the first, then do a count +1 or something to increment to the next row?
    Last edited by dta1984; 11-01-2011 at 05:12 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,739

    Re: Sum every "n"th row

    This formula will sum every 4th row of A2:A100 starting at A2

    =SUMPRODUCT(0+(MOD(ROW(A2:A100)-ROW(A2),4)=0),A2:A100)
    Audere est facere

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum every "n"th row

    Try the array formula

    =SUM(IF(MOD(ROW($A$1:$A$48),4)=1,$A$1:$A$48))
    For an array formula, enter with CNTRL SHFT ENTER instead of ENTER
    This formula will sum rows 1, 5, 9, etc
    Substitute = 2 for 2, 6, 10 etc
    =0 for 4, 8, 12, etc
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Sum every "n"th row

    check attachment
    Attached Files Attached Files
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  5. #5
    Registered User
    Join Date
    10-28-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Sum every "n"th row

    Quote Originally Posted by daddylonglegs View Post
    This formula will sum every 4th row of A2:A100 starting at A2

    =SUMPRODUCT(0+(MOD(ROW(A2:A100)-ROW(A2),4)=0),A2:A100)
    Exactly what I needed!! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1