+ Reply to Thread
Results 1 to 11 of 11

SUM Formula??

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    SUM Formula??

    I'm trying to create a formula on excel where it will give the SUM of every 4th cell in a row. I have tried using just a simple =SUM() formula and clicking on each cell indivdually but this comes back with an error due to the number of individual functions (there are 47 in total). Is there an easy way of doing this?

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: SUM Formula??

    Maybe something like this:

    =SUMPRODUCT(A1:Z1,--(MOD(COLUMN(A1:Z1),4)=0))

  3. #3
    Registered User
    Join Date
    04-13-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: SUM Formula??

    Hi Andrew,

    Thanks for the response. This doesn't appear to have given the desired results though. It still seems to take into account every cell in the row.

    Any more suggestions would be greatly appreciated.

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: SUM Formula??

    Try this:

    =SUM(--(MOD(COLUMN(A1:Z1),4)=MOD(COLUMN($A$1),4))*(A1:Z1)) and confirm with Ctrl+Shift+Enter

    And make the array in the formula fit your data, the COLUMN($A$1) part is the first cell from the left of your array.
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: SUM Formula??

    Hi

    My suggestion, is to take a look again, Andrew's formula.It's works for me.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: SUM Formula??

    coould you add a helper column that puts 1 (or anything you want) for every 4th row, and then ise a sumif() based on the helper col?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: SUM Formula??

    Cbell,

    Can you post a sample workbook so we can see your data, please?

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: SUM Formula??

    Andrews' solution is correct, but only allows for 26 columns begining with Column A, i.e. Column D is the first column counted.

    This should allow for as many columns as you need.
    =SUMPRODUCT(A2:INDEX(2:2,1,MATCH(99^99,2:2,1)),--(MOD(COLUMN(A2:INDEX(2:2,1,MATCH(99^99,2:2,1))),4)=0))

    If Column A isn't the first column with data, then change =0 to adjust the starting point.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Registered User
    Join Date
    04-13-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: SUM Formula??

    Hi, still struggling! Here is a sample of the data (obviously excluding anything sesitive). I'm looking to put the formula into cell HQ3 taking into account every 4th cell starting with A3 and ending with HM3. I would then want to copy this across into cells HR3, HS3 and HT3.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: SUM Formula??

    In HQ3:

    =SUMPRODUCT($A$3:$HP$3,--(MOD(COLUMN($A$3:$HP$3),4)=MOD(COLUMN(A:A),4)))

    And drag across.

  11. #11
    Registered User
    Join Date
    04-13-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: SUM Formula??

    Andrew-R thank you so much!! Most definitely an excel wizzard we've got here!

+ 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