+ Reply to Thread
Results 1 to 5 of 5

Concatenate multiple cells based on specific criteria

  1. #1
    Registered User
    Join Date
    04-11-2008
    Posts
    5

    Concatenate multiple cells based on specific criteria

    Hello All,

    I have a spreadsheet with a row of ID #'s and another row that contains text. For each unique ID I want to concatenate the related rows of text. An example is below:

    ID Text
    1 CC
    2 CC
    2 TXT
    2 HC
    3 TXT
    3 SAT

    I want to combine the text so it looks like this:

    ID Text
    1 CC
    2 CC, TXT, HC
    3 TXT, SAT

    Where I am running into a problem is where there are 3 or more matching ID #'s. I do not know how to combine more than 2 rows of text for those id's that are the same.

    Any help would be greatly appreciated.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    With your original data in A1:B7, put

    Please Login or Register  to view this content.
    in C2 and copy down.

    Now extract a unique list of ID numbers into D1:D3 - i.e. 1,2,3 and in E1 enter:
    Please Login or Register  to view this content.
    and copy down .

    HTH

  3. #3
    Registered User
    Join Date
    04-11-2008
    Posts
    5
    Thank You!! That worked perfectly!

  4. #4
    Registered User
    Join Date
    04-11-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Concatenate multiple cells based on specific criteria

    this formula is good only if the ID column is sorted, can you help for the situation where the ID column is not sorted

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Concatenate multiple cells based on specific criteria

    3 year old thread! please start your own linking to this one if required
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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