+ Reply to Thread
Results 1 to 19 of 19

Concatenate based on Category

  1. #1
    Registered User
    Join Date
    12-05-2010
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Concatenate based on Category

    Hi,
    I'm trying to concatenate cells based on category. For example, if the category is 1, then the formula would look through the dataset for text values associated w/ the category 1 and concatenate them.

    For example...in the attached, the dataset would be in Cols A&B and the formula would be in Col E.

    Thank you so much!

    concatenate.xlsx
    Last edited by janeml; 11-13-2014 at 10:03 AM.

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

    Re: Concatenate based on Category

    Are you open/willing to use a VBA function?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    12-05-2010
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Concatenate based on Category

    Hi,
    Usually yes, but not for this case.

    Thanks!

  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: Concatenate based on Category

    OK, that makes things very difficult.

    How much data do you have? Is there a maximum number of times a category can appear?

  5. #5
    Registered User
    Join Date
    12-05-2010
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Concatenate based on Category

    We're looking at maybe 10,000 rows w/ no max. on the number of times a category can appear... basically we have a Deal ID that can appear multiple times...each row representing a single product. Therefore, if there were 5 products associated w/ a single Deal ID, then you're looking at 5 separate rows.

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

    Re: Concatenate based on Category

    No good way to do this with just formulas.

    Could there be dozens or 100's of entries per category?

  7. #7
    Registered User
    Join Date
    12-05-2010
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Concatenate based on Category

    It'd probably be in the dozens.

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

    Re: Concatenate based on Category

    That would mean you'd probably need 100's or even 1000's of formulas to do what you want.

    Here's a visual example of what would be needed...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Category
    Value
    ------
    Category
    Values
    ------
    ------
    ------
    ------
    Concatenate
    2
    1
    AA
    1
    AA
    AB
    AD
    EE
    AA, AB, AD, EE
    3
    1
    AB
    2
    EB
    B
    EB, B
    4
    1
    AD
    3
    A
    A
    5
    2
    EB
    4
    B
    C
    B, C
    6
    2
    B
    7
    3
    A
    8
    4
    B
    9
    1
    EE
    10
    4
    C


    You'd have to use helper cells to group the values according to category then do the concatenation from there.

    With the amount of data you have this would be very inefficient using just worksheet formulas.

    I strongly recommend using the VBA function to do this. No helper cells needed.

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Concatenate based on Category

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

    I have used a UDF named JoinR to make it much simpler..
    Please Login or Register  to view this content.
    Check the attached file..
    Attached Files Attached Files
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

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

    Re: Concatenate based on Category


  11. #11
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Concatenate based on Category

    Hi Tony Sir,
    whats wrong with mine..?
    Do you thing its slower than Sir Tiger's one...?


    Regards,

  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: Concatenate based on Category

    Haven't tried yours.

    The one I linked to can also return just the unique items which is a nice option to have.

  13. #13
    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,936

    Re: Concatenate based on Category

    Vikas, I dont think that was Tony's intent (to say anything was wrong with yours), if you look at the times, he posted 6 minutes after you, so it was probably just a timing thing

    Also, (to both of you) it seemed to me that the OP said they did not want VBA, UDF is VBA (kinda), isnt it?
    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

  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: Concatenate based on Category

    Quote Originally Posted by FDibbins View Post
    it seemed to me that the OP said they did not want VBA, UDF is VBA (kinda), isnt it?
    Yes, that's correct but using just worksheet functions and formulas is not practical in this application (too much data and too many corresponding items). (IMHO)

  15. #15
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Concatenate based on Category

    Sorry Fdibbins and Tony..
    My intention wasn't wrong..
    I supposed that if Tony had done any testing ( which he often does ).. then wanted to know which one is faster...
    so that I can correct mine...

    For the second part.. I agree with Tony..

  16. #16
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Concatenate based on Category

    Is add-in acceptable???
    Mconcat ???
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  17. #17
    Registered User
    Join Date
    12-05-2010
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Concatenate based on Category

    Hi all!

    Thank you so much for the help! I ended up solving it using the attached method:
    concatenate.xlsx

  18. #18
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Concatenate based on Category

    I inputed "1" in row 7. didn't work.

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

    Re: Concatenate based on Category

    Good deal. Thanks for the feedback!

+ 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. Look Up Category and Concatenate Them
    By navs8603 in forum Excel General
    Replies: 3
    Last Post: 09-28-2012, 12:52 AM
  2. Sum numbers based on a category of a category
    By mattjac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2012, 11:08 PM
  3. [SOLVED] Productsum: Highest Frequency Category, Specific Main Category, Frequency of Category
    By T86157 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2012, 12:43 PM
  4. Sum based on category
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2011, 12:07 AM
  5. Excel 2007 : Add Values Based on Category
    By blacklion2837 in forum Excel General
    Replies: 3
    Last Post: 11-10-2010, 03:44 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