+ Reply to Thread
Results 1 to 6 of 6

Sum of Product Multiple Columns/Multiple Sheets, Indefinite Range

  1. #1
    Registered User
    Join Date
    02-12-2007
    Posts
    4

    Sum of Product Multiple Columns/Multiple Sheets, Indefinite Range

    I am having trouble with a rather complicated function which, due to its ambiguous wording, I can find no documentation on in searching.

    I am trying to come up with a formula that will take the product of fields in 2 columns and sum them up as it goes. However, the actual number of rows will change dynamically, so I need it to perform this calculation on every row that has data.

    For example. Columns A and B have data in rows 1, 2, 3 and 4, and I need to get the sum of their products, e.g.: Sum(A1*B1)+(A2*B2)+(A3*B3)+(A4*B4). However, the number of rows change dynamically, so I need the formula to perform this calculation as far down as the 65356th row.

    How can I perform distinct, row based multiplications, summing each of them up in turn, with an indefinite range?

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    You most probably need a sumproduct() function which needs to assigned to row 1 to row 65356 ... you cannot define your range with A:A ...
    HTH
    Carim


    Top Excel Links

  3. #3
    Registered User
    Join Date
    02-12-2007
    Posts
    4

    Problem Solved.

    That worked amazingly.

    Thanks very much Carim, for the easy fix!

  4. #4
    Registered User
    Join Date
    02-12-2007
    Posts
    4

    A Little More Complicated

    OK, here it gets a bit more complicated it seems.

    Do you know of any way to do a "SUMIF" type conditional function, but with the SUMPRODUCT function instead?

    I have a column range and want the sum product for only those rows which contain the value "X".

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening

    Why? SumProduct is one of Excel's slower native functions. You're better off using SumIf, unless you have multiple conditions to test for, which SumProduct handles as a by-product of what it's actually intended for. And as Carim points out you can't specify whole columns with Sumproduct but you can with SumIf. But, just for the record, here's how you'd do it :

    =SUMPRODUCT(--(Sheet1!G10:G20="X"),(Sheet1!H10:H20))

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  6. #6
    Registered User
    Join Date
    02-12-2007
    Posts
    4
    DominicB,

    Thank you very much for your reply.

    If it is possible to get the sum of every product of two fields from each particular row in a column with SUMIF, rather that SUMPRODUCT - could you show me how such would be done?

    I am very open to suggestions.

    The SUMPRODUCT method you showed me (which I found elsewhere), does not seem to work with the latest OpenOffice. Perhaps I simply need to break down and get Microsoft Office.....

+ 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