+ Reply to Thread
Results 1 to 6 of 6

SUMPRODUCT on Non-Contiguous Cells

  1. #1
    Registered User
    Join Date
    03-30-2011
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    2

    SUMPRODUCT on Non-Contiguous Cells

    Hi!

    I'm trying to make a formula for the whole spreadsheet that adds up certain cells.
    The range of cells I want to add up start from C8 and then I want to add up every 12th row up to cell C596. Like {C8, C20, C32, C44 ... C596}

    I've tried =SUMPRODUCT((MOD((ROW(C8:C596)-8),12)=0)*(C8:C596))
    But it didn't work and what *(C8:C596) does I don't really understand.

    I'd be glad to hear how I could get it done, either by improving this formula or by a completely different way.
    Thanks!

    Eli
    Last edited by EliHolle; 04-08-2011 at 09:01 AM. Reason: problem solved

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: SUMPRODUCT on Non-Contiguous Cells

    Is this what you're trying for:

    =SUMPRODUCT((MOD(ROW(C8:C596)+4,12)=0)*(C8:C596))

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT on Non-Contiguous Cells

    That formula looks like it should work, unless you have text in any of those non-contiguous cells in the range. Then you would get the #VALUE! error.

    the first part of the formula produces an array of TRUE or FALSE to mark every 12 entry... the multiplication of the entire array is basically multiplying each TRUE and FALSE by each corresponding value in the range... a TRUE multiplied by a number produces that number, a FALSE multiplied by a number produces 0 so then the sumproduct adds these all up...to give result.

    If you have a text value in any of those cells that match up to a TRUE, you will get

    If you have text in there, try:

    =SUMPRODUCT(--(MOD((ROW(C8:C596)-8),12)=0),(C8:C596))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    03-30-2011
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: SUMPRODUCT on Non-Contiguous Cells

    Cutter, NBVC

    Thank you for your fast aswers and sorry for my late repy.

    The formula with (-- worked!! I had some text in the cells in this range and indeed got the #value error.

    I'm really amazed by your fast and accurate answers. Many, many thanks!!

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: SUMPRODUCT on Non-Contiguous Cells

    What does the 8 stand for in the formula???

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT on Non-Contiguous Cells

    subtracting 8 from each ROW in C8:C596, so the count will actually start from 0 on...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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