+ Reply to Thread
Results 1 to 6 of 6

Sumproduct using range as criteria to compare another range

  1. #1
    Registered User
    Join Date
    08-24-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Question Sumproduct using range as criteria to compare another range

    HI,

    I'm trying to use sumproduct across workbooks, one of them will be closed. Trying to sum a column matching, certain keyword list. Actually, criteria keywords
    should be an exclusion. In other words, I would like to sum column with rows which do not include the list of keywords. I'm using sumproduct vs SUMIF because of lack of connection with closed workbooks when working with SUMIFS.
    I would like to maintain keyword list in a separate column, which will be periodically updated. But I do not want to update numerous rows of SUMPRODUCT formulas, every time there is a new keyword.
    I'm not very proficient with VBA, but I would consider VBA code as an option as well.
    Any help is much appreciated.


    here is the working formula I have:
    Please Login or Register  to view this content.


    But here is what ideally I would like to have:
    Please Login or Register  to view this content.


    List of keywords would be in separate column:
    Exclusion keywords which has KEYWORDS as name range:
    Fee
    Subscription Fee
    Boat Fee
    Other
    Travel
    serving

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct using range as criteria to compare another range

    Try

    =SUMPRODUCT(--(ISNA(MATCH('[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$R$2:$R$500,KEYWORDS,0))),'[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$J$2:$J$500)

  3. #3
    Registered User
    Join Date
    08-24-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: Sumproduct using range as criteria to compare another range

    Jonmo1 I cannot THANK YOU enough. This worked. I was trying something similar, but I was listing KEYWORDS first and it was giving me error. This did the trick.

    I was trying below code and I was getting value error:
    Please Login or Register  to view this content.
    but moving KEYWORD as lookup-array did the trick:
    Please Login or Register  to view this content.


    thank you once again.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct using range as criteria to compare another range

    You're welcome.

    I was also thinking of an alternate way, with a kind of reverse logic..

    Instead of summing the ones that do not = keywords...
    Sum ALL of them, and subtract the ones that DO = keywords...

    =SUM('[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$J$2:$J$500)-SUMPRODUCT(SUMIF('[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$R$2:$R$500,KEYWORDS,'[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$J$2:$J$500))

    I know this is probably more work than the other way, but thinking further..
    You may want to have (or maybe you already do have) a formula that gives the overall sum of J, regardless of the values in R..
    And then maybe you want to have 2 more formulas, 1 to show the ones that DO = Keywords, and another to show the ones that do NOT = keywords..

    In this case, then this logic is actually quite usefull..

    In A1, get the overall sum of J regardless of values in R
    =SUM('[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$J$2:$J$500)

    Then in A2, get the value of the ones that DO = keywords
    =SUMPRODUCT(SUMIF('[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$R$2:$R$500,KEYWORDS,'[Global Chart 2016 1.1.16.xlsx]Raw Data 2016'!$J$2:$J$500))

    Then in A3, the the values of the ones that do NOT = Keywords
    =A1-A2

  5. #5
    Registered User
    Join Date
    08-24-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: Sumproduct using range as criteria to compare another range

    Jonmo1, that is a wonderful idea. I will definitely be using the alternative approach.

    Many many thanks

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct using range as criteria to compare another range

    You're welcome.

+ 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. [SOLVED] SUMPRODUCT if Fields Match a RANGE of Criteria
    By jtang128 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 08-24-2016, 10:39 AM
  2. [SOLVED] SUMPRODUCT with Date Range and a Criteria
    By Dhoang25 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2015, 02:48 PM
  3. Sumproduct using Name Range as Criteria
    By azaremb in forum Excel General
    Replies: 4
    Last Post: 07-15-2014, 11:40 AM
  4. [SOLVED] Sumproduct with a range and CountIf criteria
    By mhynson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-23-2014, 03:57 PM
  5. [SOLVED] Sumif/sumproduct with a range as a criteria
    By fukirua in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-05-2013, 07:58 PM
  6. Sumproduct for range compare issue
    By cvn in forum Excel General
    Replies: 14
    Last Post: 02-29-2012, 06:41 PM
  7. Multi criteria sumproduct name range query
    By noaman in forum Excel General
    Replies: 3
    Last Post: 03-17-2011, 06:17 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