+ Reply to Thread
Results 1 to 7 of 7

Need to transpose one column into multiple with varying data

Hybrid View

Topher77 Need to transpose one column... 01-21-2014, 03:10 PM
Pete_UK Re: Need to transpose one... 01-21-2014, 03:13 PM
Topher77 Re: Need to transpose one... 01-21-2014, 03:21 PM
Pete_UK Re: Need to transpose one... 01-21-2014, 03:39 PM
Topher77 Re: Need to transpose one... 01-21-2014, 03:47 PM
Pete_UK Re: Need to transpose one... 01-21-2014, 04:27 PM
Topher77 Re: Need to transpose one... 01-21-2014, 06:06 PM
  1. #1
    Registered User
    Join Date
    01-17-2014
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need to transpose one column into multiple with varying data

    I have names and addresses in one column with about 15000 rows. Need the information transposed into 4-5 columns. Some addresses are 2 rows and others are 3 rows. Any help would be great.

    Example of data:

    Bob Smith
    123 South St.
    Anytown, NY 12345
    George Jetson
    5438 Main St.
    Apt. 2
    Smallville, GA 87654

    The data needs to be transposed into:
    Name/address1/Address2/City, ST Zip

    Thanks,
    Topher

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Need to transpose one column into multiple with varying data

    Do you always have a comma in the row which has the city and state, and is that the only place where a comma can appear?

    Pete

  3. #3
    Registered User
    Join Date
    01-17-2014
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to transpose one column into multiple with varying data

    Pete,

    Thanks for your help! Yes, this is the only place a comma will appear.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Need to transpose one column into multiple with varying data

    You say that you need the data transposed into 4-5 columns, but then your examples only need 3 and 4 and you state: Name/address1/Address2/City, ST Zip for 4 columns. I assume you will want the City state and zipcode aligned in the same column throughout, so what is the maximum number of columns you are likely to need?

    Pete

  5. #5
    Registered User
    Join Date
    01-17-2014
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to transpose one column into multiple with varying data

    Sorry about that. 4 columns would be the most I need.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Need to transpose one column into multiple with varying data

    The attached file shows how you can do this with a few formulae. I've put your example data (and some more made-up ones) in column A starting from A1, then inserted a new row 1 and put a single comma in the new cell A1. Then in B2 I put this formula:

    =IF(A2="","-",IF(ISNUMBER(FIND(",",A1)),INT(MAX(B$1:B1)/10)*10+10,B1+1))

    and copied this down beyond your data (the hyphens indicate how far it has been copied). This sets up a sequential numbering for each record (which will be identified by a number in increments of 10, i.e. 10, 20, 30 etc., and then each subsequent field will be identified by the record number plus 1, 2 or 3. (I did initially use integers for the record numbers and fractions for the field numbers, but I had to keep using ROUND( ...,1) in the exact matches, so it became very messy).

    Then in E2:H2 I have various formulae based around INDEX/MATCH which bring the appropriate fields across and take account of only 3- or 4-line records. These formulae can be copied down as far as you need them (until you start to get hyphens in column E).

    If you are not interested in retaining the original data in this file, then fix the values in columns E to H, delete columns A to D, then use File | Save AS to save the file with a different name.

    Hope this helps.

    Pete
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-17-2014
    Location
    Usa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to transpose one column into multiple with varying data

    Pete,

    Thank you for your assistance. That worked perfectly!

+ 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. Transpose Variable Data from Column A to Multiple Rows
    By downthesun in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-24-2013, 06:45 AM
  2. Transpose Data from Multiple Column to Single Column
    By smudger1989 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-12-2013, 04:38 AM
  3. how to transpose data from one column into multiple rows?
    By gabrielemucho in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-11-2012, 11:11 AM
  4. Move Multiple-Column Data to One Column (not Transpose)
    By CriticalEric in forum Excel General
    Replies: 5
    Last Post: 04-22-2012, 07:17 PM
  5. Transpose Data - Varying Range & Long Strings of Text
    By BluTalon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2010, 11:47 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