+ Reply to Thread
Results 1 to 2 of 2

from 1 column to 3 columns

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    north pole
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2011
    Posts
    1

    Smile from 1 column to 3 columns

    Hi All,

    I have 1 column like below:

    AAA
    999888
    BBB
    1111
    BBB
    2222
    AAA
    999777
    BBB
    3333
    AAA
    999666
    BBB
    4444
    CCC
    Doit
    ...

    1col.PNG
    ...
    Consider above up to a few thousand rows.
    I want to convert it to below 3 column table with rows from an AAA to the next AAA line:

    AAA BBB CCC
    999888 1111
    999888 2222
    999777 3333
    999666 4444 Doit


    3cols.PNG
    according to below pattern/rules: 1. there are 3 types of headers: AAA, BBB, CCC. Next line after them are their corresponding values.

    values of AAA and BBB (that is to say, next lines after them) are not null.
    ex:

    AAA
    BBB

    or

    BBB
    CCC


    cannot be seen. They will always have values after them.

    CCC column header may not be seen between 2 AAA entries as in the example above. From one AAA to the next AAA if there is no CCC, the new column of CCC will be empty for that row.
    What is the way to perform this in excel (any version 2007,2011 etc) or perl, shell, awk etc are all fine as well..

    Thx

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

    Re: from 1 column to 3 columns

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    images dont help and they have in your case different info
    "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)

Tags for this Thread

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