+ Reply to Thread
Results 1 to 4 of 4

Concatenate based on text in a different column

Hybrid View

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Concatenate based on text in a different column

    Hi,
    I am trying to get a complete list of applications per device. I have the device list but it is broken down into seperate lines so i would like some sort of formula (not fussed what type as long as it gets the desired results!) that will look in column A and if the text is the same, to concatenate the info in column b, seperated by a comma. So for the first device (4d713006) i would get 1 cell that would have the list of all 52 applications in it seperated by a formula. This is so i can vlookup the device name from another sheet and pull through all the list of applications.
    I hope this makes sense and any help would be appreciated! I have atttached the data :-)
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Concatenate based on text in a different column

    I think to get the results in a single Cell Separated by commas you need to use VBA.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Concatenate based on text in a different column

    Hi - as hemesh says, this sort of thing is a bit complicated with formulas, although depending what you want to do with the end results you may be able to do it if you ignore the step of concatenating with commas.

    You could try getting morefunc and using the mconcat function but it tends to be a simple task in VBA, for example:
    Sub macro_11()
    Dim count
    For count = Range("A" & Rows.count).End(xlUp).Row To 2 Step -1
        If Range("A" & count) = Range("A" & count - 1) Then
            Range("B" & count - 1) = Range("B" & count - 1) & "," & Range("B" & count)
            Rows(count).Delete
        End If
    Next count
    End Sub
    would transform your example into comma separated lists, press alt+f11 to open the vba editor, click insert->module, then copy the code into the module window and run (F5 whilst the cursor is between the sub and end sub lines)

  4. #4
    Registered User
    Join Date
    03-24-2014
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Concatenate based on text in a different column

    That is brilliant, works better than i was hoping for as it consolidates the lines for me too! Thank you so much :-)

+ 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. Concatenate a column based on a column with matching rows
    By excelsior51 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-01-2013, 11:13 AM
  2. Pls help, can we concatenate text based on some criteria lik SUMIFS
    By Shermin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2013, 04:31 AM
  3. Concatenate values in a column based on value of previous column
    By CountySurveyor in forum Excel General
    Replies: 3
    Last Post: 10-02-2012, 06:38 PM
  4. Concatenate multiple rows based on column value
    By sbartlett1123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2012, 05:58 PM
  5. Concatenate based on unique column combination.
    By samford in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-03-2010, 06:51 PM

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