+ Reply to Thread
Results 1 to 8 of 8

How to Combine (Concatenate) Data from Multiple Rows into One Cell

  1. #1
    Registered User
    Join Date
    07-30-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    90

    How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Hi all,

    My problem is that in my excel worksheet of several thousand entries the item (eg AA number) is included in more than one row, with different attributes listed in the different rows. Aside from the title column, the content in the rows is not duplicated ie if value 1 has an entry for "LOC2/12345/2015/11223" in one row, it does not in the second row, which I hope will make the job of merging the two rows easier.

    Appreciate your experience sharing

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Is the test on Duplicate AA Numbers? Can you add more data to your example to clarify what you want.

  3. #3
    Registered User
    Join Date
    07-30-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    90

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Hi,

    Yes, the task is for duplicate AA number with difference attributes in the finding.

    I have update for more info to better view
    Attached Files Attached Files

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    It will need VBA as concatenate can not run with array formula.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    VBA version: requires sort on AANUMber


    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-30-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    90

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Any method beside VBA...
    I'm not very good with VBA actually

  7. #7
    Registered User
    Join Date
    07-30-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    90

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Hi all,
    I think my issue is from vlookup + Concatenate.

    Attached together workbook for easy understanding. Hope you could share your knowledge together

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: How to Combine (Concatenate) Data from Multiple Rows into One Cell

    Here an example of a non-VBA approach which I am not recommending. It requires using "helper" columns to extract the duplicate data and then concatenate the output.

    One issue is the number of duplicates vary so any solution would have allow for a maximum.

    The formula used to extract the data is..

    For column B data

    =IFERROR(INDEX(Amended1!$B$2:$C$30,SMALL(IF((Amended1!$A$2:$A$30=$B2)*(Amended1!$D$2:$D$30="Duplicates"),ROW($A$2:$A$30)-ROW($A$2)+1,""),COLUMNS($A$2:A2)),1),"")

    For column C data

    =IFERROR(INDEX(Amended1!$B$2:$C$30,SMALL(IF((Amended1!$A$2:$A$30=$B2)*(Amended1!$D$2:$D$30="Duplicates"),ROW($A$2:$A$30)-ROW($A$2)+1,""),COLUMNS($A$2:A2)),2),"")



    Both entered with Ctrl+Shift+Enter

    VBA is a much better solution.
    Attached Files Attached Files

+ 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: 6
    Last Post: 02-19-2014, 10:25 AM
  2. [SOLVED] Formula concatenate data in multiple rows based on match data in a different row.
    By kidkool in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2014, 11:01 AM
  3. Replies: 8
    Last Post: 11-25-2013, 10:26 PM
  4. Concatenate multiple rows and columns into 1 cell
    By mj44 in forum Excel General
    Replies: 19
    Last Post: 08-29-2013, 02:37 PM
  5. Trying to combine multiple rows of data into one
    By julhennessy in forum Excel General
    Replies: 6
    Last Post: 09-17-2012, 02:40 PM
  6. [SOLVED] How to Concatenate multiple Rows into 1 Column cell
    By rbapdx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-11-2012, 12:02 AM
  7. Combine Data from Multiple Rows
    By rhudgins in forum Excel General
    Replies: 3
    Last Post: 10-07-2011, 10:38 AM
  8. Concatenate (combine) Header Row with Variable Number of Detail Rows
    By cral17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2009, 09:19 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