+ Reply to Thread
Results 1 to 6 of 6

Multiplying and summing every nth range

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    9

    Multiplying and summing every nth range

    Please help!

    I'm a newbie to all this and am struggling to write a function that will split a range into two and multiply the corresponding ranges together. I'm sorry the descritpion isn't any better but I don't know how better to explain it. Basically, I have this ugly formula being run at the moment:

    Please Login or Register  to view this content.
    And attempted to write a new function (that isn't working) that looks like this:

    Please Login or Register  to view this content.

    Any help would be awesome and if I could provide any further information, just ask.

    Thanks!
    Last edited by skimp; 04-30-2013 at 04:55 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Issue with function, please help!

    Your formula looks like the sum of products, so why not use SUMPRODUCT? Something like this:

    =SUMPRODUCT((B8:X8)*(C8:Y8)*(MOD(COLUMN(B8:X8),2)=0))

    Hope this helps.

    Pete

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Issue with function, please help!

    Try this elegant formula:

    =SUMPRODUCT(B8:X8,C8:Y8)

  4. #4
    Registered User
    Join Date
    04-29-2013
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Issue with function, please help!

    I tried that and it gives me this:

    B8 -5
    C8 -5
    D8 -5
    E8 -5
    F8 -5
    G8 -5
    H8 -5
    I8 - 5

    j8 - =SUMPRODUCT(B8:H8,C8:I8) = 175

    It's producing "175" when really it should be "100" (5*5+5*5+5*5).

    This function is ruining my mental health.....
    Last edited by skimp; 04-29-2013 at 10:00 PM. Reason: wrong result printed

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Issue with function, please help!

    IT WORKS!!!!!!

    Thank you so much for the assistance!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Issue with function, please help!

    Skimp,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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