+ Reply to Thread
Results 1 to 9 of 9

SUMPRODUCT - How to add multiple ranges in array

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    SUMPRODUCT - How to add multiple ranges in array

    Hi this may be an easy question but regarding the SUMPRODUCT function - I am trying to get a weighted average.

    The issue is in my array 1 part of the equation, I place a range of a column within in it, but lets say I want to omit certain cells within that range (e.g as oppose to A1:A5, I'd prefer - A1:A2,A4:A5)? How do I place that in one array as oppose to the SUMPRODUCT thinking its two arrays?

  2. #2
    Registered User
    Join Date
    01-23-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: SUMPRODUCT - How to add multiple ranges in array

    I'd like to note all my arrays contain equal number of columns

  3. #3
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: SUMPRODUCT - How to add multiple ranges in array

    It depends on the reason why you are excluding A3. If it was because it was too large, like you were wanting to exclude any number greater than 10 you would write it like this:
    =SUMPRODUCT((A1:A5)*(A1:A5<10))
    This would multiply the values in A1:A5 by 1 if they are less than 10 and by 0 if they are more then 10, then sum them. Since anything multiplied by 0 is 0 those items would be effectively excluded from the sum.
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: SUMPRODUCT - How to add multiple ranges in array

    You would try to write an expression as to why you want to exclude A3 or why you want to include A1:A2, A4:A5.

    A1 = 12
    A2 = 22
    A3 = 7
    A4 = 15
    A5 = 20

    =SUMPRODUCT(--(A1:A5>10)...

    A3 is excluded because it's value is 7.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: SUMPRODUCT - How to add multiple ranges in array

    Okay I'm understanding but lets say I want to carry this formula over the row BUT lets now say A3 - Z3 contains values as 1,2,3,...,n would I then require some form of an IF function I guess?

  6. #6
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: SUMPRODUCT - How to add multiple ranges in array

    Not necessarily. If you could upload a sample of the file you are working on (with any confidential data removed) with what you are trying to acheive clearly shown, we could give you more specific advice.

  7. #7
    Registered User
    Join Date
    01-23-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: SUMPRODUCT - How to add multiple ranges in array

    It's 2 MB and there's way too much going on with each sheet linked to another so I don't knwo if I should delete anything and send it... Hmmm here's the formula I'm using based on the advice above (I made the cell I want to omit as 0 for now):

    =SUMPRODUCT(((T28:T49)*(T28:T49>0))/(($B$72:$B$90)*($B$72:$B$90>0)),(($C$72:$C$90)*($C$72:$C$90>0)))/SUM(T28:T49/$B$72:$B$90)

    Essentially, I'm trying to get the weighted average from the above formula but I'm getting a DIV0 error including in cells where it is populated >0 value. Not sure why unless I wrote the condition wrong?

  8. #8
    Registered User
    Join Date
    04-21-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    17

    Re: SUMPRODUCT - How to add multiple ranges in array

    I think what you're trying to do, is what I'm trying to figure out as well.

    I want four different TOTALS for the four different columns that repeats itself indefinitely. Out-Ez/Out-Pink/In-Ez/In-Pink

    I don't know what I'm doing wrong but I'm trying to add all the "Out-Ez" from Rows: H20 and H35 while omitting totals from the other columns. I haven't gotten to the H35 Row yet because I'm still trying to figure out how to add ROW H20 first.

    =SUMPRODUCT(--(MOD((COLUMN(H20:FM20)),7)=0),H20:FM20)

    This Function isn't working....

    4212016_41524 PM.jpg
    Attached Images Attached Images
    Last edited by kevawo; 04-21-2016 at 05:57 PM.

  9. #9
    Registered User
    Join Date
    01-23-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: SUMPRODUCT - How to add multiple ranges in array

    I ended up creating a separate spreadsheet linking to my orginal data set but deleted cells I did not need THEN used the SUMPRODUCT function and then called out that value back into my original spreadsheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. COUNTIF or SUMPRODUCT? - Comparing multiple ranges
    By RockMonkey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-19-2014, 12:41 PM
  2. SUMIFS or SUMPRODUCT with multiple criteria including date ranges
    By baxcat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2013, 09:40 AM
  3. Replies: 6
    Last Post: 10-30-2012, 02:35 PM
  4. sumproduct sum range w/ multiple ranges
    By jw01 in forum Excel General
    Replies: 4
    Last Post: 10-25-2012, 08:51 PM
  5. Using multipel sum ranges in Sumproduct() & countif() in array
    By mubashir aziz in forum Excel General
    Replies: 16
    Last Post: 07-08-2009, 12:56 AM
  6. sumproduct using array of named ranges
    By Exceler in forum Excel General
    Replies: 1
    Last Post: 08-27-2006, 12:35 PM
  7. [SOLVED] Multiple dynamic ranges in a Sumproduct
    By mmartens12 via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-02-2006, 09:00 PM
  8. Multiple dynamic ranges in a Sumproduct
    By mmartens12 via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-01-2006, 11:30 PM

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