+ Reply to Thread
Results 1 to 8 of 8

Consolidate text data from rows into columns

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Consolidate text data from rows into columns

    Hi there, I've had a look around the forums for an answer to this but haven't found anyone with a similar issue. Apologies if it's been answered before.

    so what I have is a datasheet with five columns:

    A: User Id
    B: Category of item for sale
    C: Brand 1 of item for sale
    D: Brand 2 of item for sale
    E: Brand 3 of item for sale

    But what happens is I receive this data with only the first three columns filled out. That is, there are duplicates of the User ID in the rows, and these user IDs may have different categories and different brands. What I want is to consolidate the Brands into a single row for each User ID and Category of item.

    e.g. Raw data:

    A001 Category 1 Brand 1
    A002 Category 1 Brand 1
    A001 Category 1 Brand 2
    A001 Category 2 Brand 4
    A002 Category 1 Brand 2
    A001 Category 1 Brand 3
    A001 Category 2 Brand 5

    that I want to end up looking like this:

    A001 Category 1 Brand 1 Brand 2 Brand 3
    A002 Category 1 Brand 1 Brand 2
    A001 Category 2 Brand 4 Brand 5
    A002 Category 3 Brand 2


    I hope this makes sense. Is there any easy way of doing this? The Consolidate command only appears to work for numbers..

    Many thanks in advance!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Consolidate text data from rows into columns

    It will be good if you provide a sample file.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Consolidate text data from rows into columns

    see the attachment, it may help you
    Some helper columns were created
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Consolidate text data from rows into columns

    nflsales that looks exactly like what I need to do, but I can't get it to exactly work.

    arlu1201, please see the attached example. Sheet 1 has the raw data and Sheet 2 is what I would like it to look like.

    Thanks so much for your help!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Consolidate text data from rows into columns

    Hi I was just wondering if anyone had a solution for this problem

    thanks in advance!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Consolidate text data from rows into columns

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

  7. #7
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Consolidate text data from rows into columns

    I'm sorry I'm so late in replying here, but this is the PERFECT solution to my problem. Thank you SO much, you have no idea how much time you just saved me

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Consolidate text data from rows into columns

    Am glad its solved.

    I will mark this thread as solved for you.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ 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