+ Reply to Thread
Results 1 to 14 of 14

Summing the matches of one column only if its corresponding description matches a list

  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Exclamation Summing the matches of one column only if its corresponding description matches a list

    I am definitely stuck and would really appreciate some help! I believe this may be the most complicated sumif/match formula I've tried putting together, so whoever can figure this out would help me tremendously. I have one column of phone numbers, some duplicates, some not. I need this column to look at another column of phone numbers that correspond to a certain value. If the first list matches any of the second list, then I need it to sum up all the matches (the values assigned to the phone numbers that are list beside in a third column, not the phone numbers themselves), even if they are duplicate numbers. I've attached an example worksheet (the two main columns i've reffering to are in different tabs, and the answer/formula is on a third tab).
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Summing the matches of one column only if its corresponding description matches a list

    Hi, welcome to the forum

    Try this...
    =SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0))),(COMPARE!$B$1:$B$14))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Thumbs up Re: Summing the matches of one column only if its corresponding description matches a list

    i think i love you!

    Thank you so much!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Summing the matches of one column only if its corresponding description matches a list

    haha thanks for the kind words, glad it worked for you

  5. #5
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Re: Summing the matches of one column only if its corresponding description matches a list

    EXAMPLE2.xlsxYour solution worked perfectly for the example I gave, so thank you for that very much. I would like to add a bit more complexity and have gotten close to the answer but am coming up short. I need there to be one more criteria to test against before summing up the numbers. I've tried adding another array to your solution but am not getting the right answer.
    Last edited by bishop-jese-erl; 02-17-2015 at 07:53 PM. Reason: added attachment

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Summing the matches of one column only if its corresponding description matches a list

    OK, shouldnt be too hard. You just need to add it in the same format...
    =SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0)))*(date_range=TODAY),(COMPARE!$B$1:$B$14))
    =SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0)))*--(name_range="Bobby"),(COMPARE!$B$1:$B$14))
    or some such.

    What are you adding, and what did you try?

  7. #7
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Re: Summing the matches of one column only if its corresponding description matches a list

    Thanks for the quick reply. I've attached another example to help with my description. I've tried adding another "isnumber(match" set but keep getting an N/A. Can you attempt a solution for me please?

    EXAMPLE3.xlsx

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Summing the matches of one column only if its corresponding description matches a list

    B
    C
    D
    E
    5
    55555
    66666
    88888
    99999
    6
    60
    20
    50
    40
    7
    170
    8
    9
    60
    20
    50
    40

    B6=SUM(SUMIFS(COMPARE!$B$1:$B$14,COMPARE!$C$1:$C$14,SUM!B$5),COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9)
    copied across
    If you want to sum all values that match all criteria...
    B7=SUM(SUMIFS(COMPARE!$B$1:$B$14,COMPARE!$C$1:$C$14,{55555,66666,88888,99999}),COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9)

    Or, you can stick with the SP version, bit I can only get it to calc per each type...
    B9=SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0))),(COMPARE!$B$1:$B$14),--(COMPARE!$C$1:$C$14=SUM!B$5))
    copied across

  9. #9
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Re: Summing the matches of one column only if its corresponding description matches a list

    WOW! thank you for these formulas. I've been playing with them and am very intrigued by the one step solution you came up with. However, I noticed it currently only sums up the values that match the added criteria but does not scrub against the phone numbers as before. I've attached another example with more detailed description of what I need. I really appreciate your help and couldn't have gotten this far without it, thank you!

    EXAMPLE4.xlsx

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Summing the matches of one column only if its corresponding description matches a list

    sorry about that. I think this does it...
    =SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0))),(COMPARE!$B$1:$B$14),--(ISNUMBER(MATCH(COMPARE!$C$1:$C$14,SUM!B5:E5,0))))

  11. #11
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Re: Summing the matches of one column only if its corresponding description matches a list

    I've put in a couple hours or so trying to get this formula to work in my actual worksheet. I've copied the formula exactly, I've quadruple checked. I can't seem to get around a #Value error on the newly added portion.

    =SUMPRODUCT(--(ISNUMBER(MATCH(COMPARE!$A$1:$A$14,SOURCE!$A$1:$A$9,0))),(COMPARE!$B$1:$B$14),--(ISNUMBER(MATCH(COMPARE!$C$1:$C$14,SUM!B5:E5,0))))

    The bold text reveals the #Value error I'm receiving when I go through the evaluate formula feature in excel. I also can't tell if the part right after, the SUM!B5:E5 in the example above, is actually pulling the data. Any ideas how what is going on or what I could try to fix it? Keep in mind I got it to work just fine the example4 spreadsheet, but when moving to the real worksheet I run into these errors, but I am positive the formulas match your formatting.

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

    Re: Summing the matches of one column only if its corresponding description matches a list

    Are there any #VALUE! errors in any of the referenced ranges?

    Are all the MATCH/SUM ranges the same size?

    COMPARE!$A$1:$A$14
    COMPARE!$B$1:$B$14
    COMPARE!$C$1:$C$14

    Those are all the same size but what about the formula in your real file?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  13. #13
    Registered User
    Join Date
    02-13-2015
    Location
    Greater Nashville
    MS-Off Ver
    2016
    Posts
    19

    Re: Summing the matches of one column only if its corresponding description matches a list

    I figured it out! It took me FOREVER to dig through everything. Apparently the newly added criteria was referencing a cell that contained a number, but this number, for whatever reason, had a hidden apostrophe at the beginning! Once i updated my lookup criteria by adding an apostrophe in front, the formula instantly worked!

    Now why in the world would there be a hidden apostrophe?! Curse the Punctuation Gods!!! No, really, why didn't excel show me there was an apostrophe in my source data???

    ALSO, I've notice very frustrating inconsistencies when referencing an array like the newly added criteria in example4. Why is it sometimes you must do this: {55555,66666,88888,99999} instead of the easier: (B5:E5) ?

    Thank you in advance, you all have a GREAT support forum here!
    Last edited by bishop-jese-erl; 02-19-2015 at 02:37 AM. Reason: ADDITIONAL QUESTION

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

    Re: Summing the matches of one column only if its corresponding description matches a list

    Quote Originally Posted by bishop-jese-erl View Post
    Why is it sometimes you must do this: {55555,66666,88888,99999} instead of the easier: (B5:E5) ?
    You shouldn't have to use the array constant: {55555,66666,88888,99999}.

    However, if using a range reference like B5:E5 then this must be used with functions that support array referencing or the formula must be array entered.

+ 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. Replies: 5
    Last Post: 05-03-2014, 03:00 AM
  2. Replies: 1
    Last Post: 09-26-2013, 12:16 PM
  3. [SOLVED] If Text Description matches info on w/sheet then enter corresponding $
    By marsham in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-10-2013, 01:31 AM
  4. Summing a column where matches adjacent column and colating results
    By rlamb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2013, 08:24 AM
  5. Replies: 0
    Last Post: 07-06-2011, 11:31 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