+ Reply to Thread
Results 1 to 12 of 12

Summing duplicate values(matches) from hlookup, for EACH ROW.

  1. #1
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Summing duplicate values(matches) from hlookup, for EACH ROW.

    Dear Excel Legends,

    I have spent my whole day to solve this one but no luck. I've attached my dataset file.

    What I am trying to do here is that I want to come up with a function that can sum the 'count' for EACH 'category' for EACH ROW. This dataset unfortunately has to be in this format and cannot be combined, merged, or divided. So for example, if you look at the second row, you will be able to see that there are three occurrence of Category 1 (B2, D2, and J2) and what i want to do is essentially summing up the 'count' accompanied by the each cell. So here, I want to sum A2(=77), C2(=62), and I2(=71).

    I tried many things - the hlookup only gives me the first occurrence so failed, and when I tried to use SUMIF, SUMIFS, and IF, I couldn't figure it our as my 'Category' values are numeric, so I failed to distinguish the values.

    Basically I want to make a function to command 'sum the Count only if the Category is 1.' Any way to do this????
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    how about the null categories?

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Please Login or Register  to view this content.
    The routine above will sumup the categories and place the total in the appropiate column
    Yet there are categories that were left empty.

  4. #4
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Could you expand it a bit more??

  5. #5
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Oh I just saw this reply under your first one, and wow, this is just a magic!! Thank you so much. The beauty of VBA...

  6. #6
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Hi,

    I was writing some code in the attached workbook before you received your response, but figured I would post this anyway. The attached workbook has VBA code that is triggered when any of the values in the cells from Columns A thru T are changed and updates the totals. It only looks at Categories 1 - 10 since those are the categories that had headings.

    Thanks,

    Dan
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Formula solution
    put in V3

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by humdingaling; 05-06-2016 at 12:11 AM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  8. #8
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Quote Originally Posted by djbomaha View Post
    Hi,

    I was writing some code in the attached workbook before you received your response, but figured I would post this anyway. The attached workbook has VBA code that is triggered when any of the values in the cells from Columns A thru T are changed and updates the totals. It only looks at Categories 1 - 10 since those are the categories that had headings.

    Thanks,

    Dan

    Hi Dan, Thank you so much for your help. You guys are just legends...

  9. #9
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Quote Originally Posted by humdingaling View Post
    Formula solution
    put in V3

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Oh wow even without VBA works?? Thank you so much!! I really learned a lot from here

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Sorry forgot about the header
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-05-2016
    Location
    TORONTO, CANADA
    MS-Off Ver
    2013
    Posts
    6

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Quote Originally Posted by humdingaling View Post
    Sorry forgot about the header
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks so much!! One quick question, do you mind explaining a bit more about the 'COLUMN(A1)' part in the formula??

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Summing duplicate values(matches) from hlookup, for EACH ROW.

    Column(A1) = 1
    Column(B1) = 2
    .....

    saves me typing in = 1, = 2, = 3 for the corresponding category making it a PITA to update the formula

+ 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] Summing the matches of one column only if its corresponding description matches a list
    By bishop-jese-erl in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-19-2015, 04:26 PM
  2. hlookup and summing an array
    By pervina in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2014, 07:06 PM
  3. HLookup w/ Duplicate Values
    By jbaehmer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-31-2014, 08:17 AM
  4. Summing of Multiple Criteria sum but not counting Duplicate Values
    By chadman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2013, 07:34 AM
  5. Non exact matches in HLOOKUP
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-27-2009, 11:28 AM
  6. Summing HLookup Values
    By TomCat in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-23-2006, 10:00 PM
  7. [SOLVED] V-lookup and summing values if more than 1 matches criteria
    By holcay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2006, 11:55 AM

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