+ Reply to Thread
Results 1 to 3 of 3

SUMPRODUCT formula optimization for multiple criteria addition

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    Lithuania
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    13

    SUMPRODUCT formula optimization for multiple criteria addition

    Hello,

    I have been trying to create a formula that is going to return needed structure with data changing. Since the data is in another workbook, i have resorted to use SUMPRODUCT, because SUMIF cannot read closed workbooks and that workbook will not always be open but i need the formula to still work. The problem is, i need to sum multiple criteria and SUMPRODUCT formula structure is pretty long in itself. This means i result with this monster of a formula:

    =V157*(SUMPRODUCT(([IMPORT.xlsm]EU!$J$2:$J$10000="3212")*([IMPORT.xlsm]EU!$I$2:$I$10000))/(SUMPRODUCT(([IMPORT.xlsm]EU!$J$2:$J$10000="2441")*([IMPORT.xlsm]EU!$I$2:$I$10000))+SUMPRODUCT(([IMPORT.xlsm]EU!$J$2:$J$10000="3212")*([IMPORT.xlsm]EU!$I$2:$I$10000))+SUMPRODUCT(([IMPORT.xlsm]EU!$J$2:$J$10000="3213")*([IMPORT.xlsm]EU!$I$2:$I$10000))))

    First lets strip down the links and other unimportant part of formula here. This is where the core is:

    =SUMPRODUCT((J2:J10000="3212")*(I2:I10000))/(SUMPRODUCT((J2:J10000="2441")*(I2:I10000))+SUMPRODUCT((J2:J10000="3212")*(I2:I10000))+SUMPRODUCT((J2:J10000="3213")*(I2:I10000)))

    What i would like to as is if there is any way to sum the values in column I based on multiple possible matches in column J. Basically i would like to see something like

    SUMPRODUCT(J2:J10000="3212")*(I2:I10000)/SUMPRODUCT((SOMETHING HERE)*(I2:I10000)

    That would give the same result.

    I have tried using the OR function, but it only returns 0 in that case.

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: SUMPRODUCT formula optimization for multiple criteria addition

    So.... something like this?

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-18-2013
    Location
    Lithuania
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    13

    Re: SUMPRODUCT formula optimization for multiple criteria addition

    Thank you, this has worked. It never ceases to amaze me how strangely SUMPRODUCT logic works. Its the complete opposite of everything else in excel. I guess thats what i get for working with IFs for a decade.

+ 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. Sumproduct - the addition of new criteria
    By C_P in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2015, 09:47 AM
  2. Sumproduct formula optimization
    By sinspawn56 in forum Excel General
    Replies: 4
    Last Post: 11-06-2012, 02:23 PM
  3. [SOLVED] SumProduct Formula with Multiple Criteria
    By krunk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-08-2012, 07:56 AM
  4. How to add multiple criteria to a sumproduct formula.
    By necht_angel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-06-2011, 11:32 AM
  5. Shorter SUMPRODUCT Formula (Multiple Criteria)
    By MobiusTrip in forum Excel General
    Replies: 5
    Last Post: 06-24-2010, 02:13 AM
  6. Replies: 8
    Last Post: 10-02-2009, 03:50 PM
  7. sumproduct formula (multiple criteria)
    By Inter in forum Excel General
    Replies: 9
    Last Post: 05-18-2006, 07:50 AM

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