+ Reply to Thread
Results 1 to 10 of 10

Need to convert the items to 1 item per line with the data in column B to the same row

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need to convert the items to 1 item per line with the data in column B to the same row

    Need assistance on how to convert a spreadsheet.
    I need to take the data in column A, multiple identical items with different data in column B, and convert to 1 line with the data from column B converted to that same line an put the column B data in the same row in consecutive columns.

    So for example on the first item I would like to convert looks like this:

    010220 GS05E4
    010220 GS09H1
    010220 PRU1A
    010350 GS05E2
    010350 PRU1A
    010350 TR06A3

    But I want to convert it so all the same item is on 1 line with the data in column B extended out in the same line like this:
    010220 GS05E4 GS09H1 PRU1A
    010350 GS05E2 PRU1A TR06A3

    Any assistance is greatly appreciated
    Thanks!!

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    In column D I copy / pasted the column A values and applied Remove duplicates.

    Then in E1 as below.

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    1
    010220 GS05E4 010220 GS05E4 GS09H1 PRU1A In E1 filled down and across
    2
    010220 GS09H1 010350 GS05E2 PRU1A TR06A3 =INDEX($B$1:$B$6,MATCH($D1,$A$1:$A$6,0)+COLUMNS($A:A)-1)
    3
    010220 PRU1A
    4
    010350 GS05E2
    5
    010350 PRU1A
    6
    010350 TR06A3
    Dave

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    Here is a VBA solution
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    07-24-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    Awesome!!! That is exactly what I needed.
    Thank you very much!!!!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    To which solution do you refer?

  6. #6
    Registered User
    Join Date
    07-24-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    I tried both options that you and Alan supplied.
    They both worked great and I got the result I was looking for from each one. By trying both options it gave me addition excel knowledge!
    Thanks again!!

    Quote Originally Posted by FlameRetired View Post
    To which solution do you refer?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    Good news, and thanks for the feedback.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    Thank you also for the feedback. Please mark your thread as solved. Go to thread tools at the top of the post
    Last edited by alansidman; 12-28-2015 at 12:42 PM.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    If this is a growing list of unknown limit, these formulae (expanded from FlameRetired) will accommodate this.
    First to get the list of values from column A without duplicates:
    Enter in D2 and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter in E2 and fill across and down. This will cut off the columns when the data runs out for the value in column A.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The second formula is derived from FlameRetired's formula
    A
    B
    C
    D
    E
    F
    G
    1
    10220
    GS05E4
    2
    10220
    GS09H1
    10220
    GS05E4 GS09H1 PRU1A
    3
    10220
    PRU1A
    10350
    GS05E2 PRU1A TR06A3
    4
    10350
    GS05E2
    1111
    xyz123
    5
    10350
    PRU1A
    12345
    YYY789 UYO897
    6
    10350
    TR06A3
    7
    1111
    xyz123
    8
    12345
    YYY789
    9
    12345
    UYO897
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Registered User
    Join Date
    07-24-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to convert the items to 1 item per line with the data in column B to the same row

    Thank You!!
    Very helpful!


    Quote Originally Posted by newdoverman View Post
    If this is a growing list of unknown limit, these formulae (expanded from FlameRetired) will accommodate this.
    First to get the list of values from column A without duplicates:
    Enter in D2 and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter in E2 and fill across and down. This will cut off the columns when the data runs out for the value in column A.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The second formula is derived from FlameRetired's formula
    A
    B
    C
    D
    E
    F
    G
    1
    10220
    GS05E4
    2
    10220
    GS09H1
    10220
    GS05E4 GS09H1 PRU1A
    3
    10220
    PRU1A
    10350
    GS05E2 PRU1A TR06A3
    4
    10350
    GS05E2
    1111
    xyz123
    5
    10350
    PRU1A
    12345
    YYY789 UYO897
    6
    10350
    TR06A3
    7
    1111
    xyz123
    8
    12345
    YYY789
    9
    12345
    UYO897

+ 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. [SOLVED] Calculate the total of a unique item and place in column G and make remaining items 0
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2015, 04:00 PM
  2. Replies: 1
    Last Post: 11-05-2015, 03:18 PM
  3. Macro to convert date range to individual line items (i.e. rows) in excel
    By violetmind in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-11-2014, 09:53 PM
  4. selected item from column to line
    By kuzna26 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2014, 06:31 AM
  5. Cross Reference item from one colum to items in a new column
    By mbrackey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2013, 03:36 PM
  6. Combining multiple line items into one line item based on column.
    By mguz018 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2012, 07:22 PM
  7. Convert Horizontal Line Items to Vertical?
    By evo420 in forum Excel General
    Replies: 1
    Last Post: 01-26-2011, 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