+ Reply to Thread
Results 1 to 3 of 3

Converting Vertical Records to Horizontal

Hybrid View

  1. #1
    Registered User
    Join Date
    11-20-2005
    Posts
    33

    Converting Vertical Records to Horizontal

    Not sure if I have asked this question correctly, so let me explain:

    I would like to convert data that I have been given, that is in this kind of format:

    Forename: John
    Lastname: Smith
    Employee #: 62537

    Forename: Fred
    Lastname: Bloggs
    Employee#: 63244

    Forename: Pete
    Lastname: Brown
    Employee#: 61123

    etc

    Into:

    Forename Lastname Employee#
    John Smith 62537
    Fred Bloggs 63244
    Pete Brown 61123

    ie the three pieces of information in row format, into a regular Excel column format

    Should I get rid of all the colons after each heading first, and maybe the spaces between the records?

    Any help appreciated

    Wibs

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Converting Vertical Records to Horizontal

    Assuming the original list is in A1:A1000, and If you put the headings, say in B1:D1

    Forename, Lastname and Employee# (as they appear in the original list)

    Then in B2 enter:

    =TRIM(MID(INDEX($A$1:$A$1000,4*(ROWS($A$1:$A1)-1)+1),LEN(B$1)+3,255))

    Change the $A$1:$A$1000 to suit the entire range of your original list.

    copy that formula across to C1 and D1...

    then in C1, change the first $A$1 to $A$2

    and in D1, change the same $A$1 to $A$3

    Then copy all 3 formulas down as far as you need.

    After done, you can copy all 3 columns, then Paste Special >> Values over them.. so that you can delete the original list if desired...
    Attached Files Attached Files
    Last edited by NBVC; 01-29-2010 at 11:41 AM. Reason: Attached sample
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting Vertical Records to Horizontal

    Hi,

    No leave the spaces we can use those. Assuming your list starts in A1 use the following formulae

    C1:
    =RIGHT(OFFSET(A$1,ROW()*4-4,0),LEN(OFFSET(A$1,ROW()*4-4,0))-SEARCH(" ",OFFSET(A$1,ROW()*4-4,0)))
    
    D1:
    =RIGHT(OFFSET($A$1,ROW()*4-3,0),LEN(OFFSET($A$1,ROW()*4-3,0))-SEARCH(" ",OFFSET($A$1,ROW()*4-3,0)))
    
    E1:
    =RIGHT(OFFSET($A$1,ROW()*4-2,0),LEN(OFFSET($A$1,ROW()*4-2,0))-SEARCH(" ",OFFSET($A$1,ROW()*4-2,0))-3)
    then copy this down for 1/4 of the total rows in column A

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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