+ Reply to Thread
Results 1 to 12 of 12

Sort Data from one column to Separate Columns

  1. #1
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Sort Data from one column to Separate Columns

    Hi Guys,

    This could be a real novice question but I can't say I am any sort of excel guru anyway.

    I have a list of data which runs as follows,

    A B
    First Hugh
    Last Jass
    Age 24

    First Amanda
    Last HugnKis
    Age 41


    This list repeats like this 200+ times and I need to change it into a format with is a bit more user friendly, so I can do Vlookup and If functions easier.

    Idealy

    First Last Age
    Hugh Jass 24
    Amanda Hugnkis 41


    I would like it in a new workbook refering back to the original. I have been playing around but can only get it to repeat once then it changes the cell reference and puts the data out of sync.

    Push comes to shove I will just make it =[book1[sheet1!$A$1 for each value however this will take me decades

    Any help please.

    Thank you in advance.
    Last edited by Griff0; 06-01-2010 at 08:15 PM.

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Can't Sort Data from a one column to Seperate Columns

    If your Names & Age are all seperated by one row,
    try this:

    Your Data in column A

    A
    1) First Hugh
    2) Last Jass
    3) Age 24
    4)
    5) First Amanda
    6) Last HugnKis
    7) Age 41


    In cell B1 enter the formula: =RIGHT(A1,LEN(A1)-FIND(" ",A1))
    In cell C1 enter the formula: =RIGHT(A2,LEN(A2)-FIND(" ",A2))
    In cell D1 enter the formula: =RIGHT(A3,LEN(A3)-FIND(" ",A3))

    Now select the range of cells B1 through D4

    In the lower right corner of your selected range is a small black square, grap this square and drag down, this will copy the formulas and the three blank lines.

    This should get you what you want.

  3. #3
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can't Sort Data from a one column to Seperate Columns

    Thank xenixman

    Unfortuantly my initial post doesn't really show the layout properly and after trying your formula I couldn't get it to work in this case.

    The top 2/3 of the attachment is an example of the current layout information in seperate columns. It repeats the same format continuously down to about 800 (stupid and annoying).

    The bottom 3 columns is how I would like it to look. Removing the first column all together (making it the column headings) and just having an easy to use table, that I can use as I wish with (vlookups, filters,pivot tables etc)

    There is more information invloved but provided a formula to work in this case, should mean I can apply it to the full table. I am not a total novice like I implied, normally I can work these things out but this has me stumped. Everything I try returns jumbled columns, #ref or #value as results.

    could a Macro be more effective in this instance?

    Thanks
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can't Sort Data from a one column to Seperate Columns

    Actually I guess my main problem is to skip cells that do not relate to the columns I have created. So say the First column relates to every 6th row in the initial date set.

    Something in regard to IF A1 is First name return B1? However because the the rows alternate I get this to work but in my new table the First name column has data in rows 1,6,12, the Last name column has data in rows 2,7,13 etc.. How can I get it to line up?

  5. #5
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Can't Sort Data from a one column to Seperate Columns

    I'm not sure what it is you want, but from the looks of your picture, the same logic applies, just modify the formulas a bit:

    H I
    3) First Hugh
    4) Last Jass
    5) Age 24
    6)
    7) First Amanda
    8) Last HugnKis
    9) Age 41

    In cell J3 enter the formula: =I3
    In cell K3 enter the formula: =I4
    In cell L3 enter the formula: =I5

    Now select the range of cells J3 through L6
    or if there are two spaces between sections, J3 through L7
    In the lower right corner of your selected range is a small black square, grap this square and drag down, this will copy the formulas and the three or four blank lines.
    Now you can do a copy & past special, values and delete the original configuration.

  6. #6
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Can't Sort Data from a one column to Seperate Columns

    It just occurred to me, do you want the Headings along with the Data?

    H I
    3) First Hugh
    4) Last Jass
    5) Age 24
    6)
    7) First Amanda
    8) Last HugnKis
    9) Age 41

    In cell J3 enter the formula: =H3
    In cell K3 enter the formula: =H4
    In cell L3 enter the formula: =H5
    n cell J4 enter the formula: =I3
    In cell K4 enter the formula: =I4
    In cell L4 enter the formula: =I5

    Now select the range of cells J3 through L6
    or if there are two spaces between sections, J3 through L7
    In the lower right corner of your selected range is a small black square, grab this square and drag down, this will copy the formulas and the three or four blank lines.
    Now you can do a copy & past special, values and delete the original configuration.
    Last edited by xenixman; 06-02-2010 at 08:03 AM.

  7. #7
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can't Sort Data from a one column to Seperate Columns

    thanks mate, I wasn't selecting the blank cells in between and therefore it was putting the values out of sync.

    I was hoping to avoid doing this way though, so I didn't have to delete all the blank cells in between. Really wanted to have the formula to select every cell that related to the first name without a gap of 7 or 8 cells in between. But all good I can fix it with a filter and work out a better way of doing it at a later stage.

    Thanks.

  8. #8
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Can't Sort Data from a one column to Seperate Columns

    Alright my thoughts over night have provided this

    In the first column (J3): =IF(H3="First",I3,"")
    Next column (K3): =IF(H3="First",I4,"").

    So on across the columns. The once it is dragged down the page the formula only returns values when there is information. Filtering out the blanks leaves me with the data I want. Saves you having to select from J3 to L6.

    Any Ideas on how to get it to disregard the blank cells so there is no need for a filter would be nice, because I have other sheets with the similar situations.

    Cheers for the help

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Can't Sort Data from a one column to Seperate Columns

    Griff0, welcome to the forum. If you want help with formulas, please don't post pictures. Post the workbook from which you took the image instead. That'll save us all a lot of typing.

    You can use one single formula if your data is evenly spaced. For example:
    =INDEX($C:$C,ROW(A1)*5-2+COLUMN(A1)-1)

    copy across and down. Adjust ranges to suit.

    see attached.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Sort Data from one column to Separate Columns

    Fantastic! Thats is exactly what I need Teylyn.

    I managed to apply it to the workbook I am using (little bit of trail and error) but I got there.

    This is my formula =INDEX(Sheet1!$C:$C,ROW(B5)*8-7+COLUMN(B5)-18) might not be right but it works

    I am curious now though, I understand the basic principles behind it and where it is relating too but the sections (*8-7) or (*5-4) in your case and the -18/-1 at the end of the formula I do not quite see where you get them from or how I should choose these in future.

    I thought the 5-4 in yours was becuase the 5th and 4th cells were blank but I have 3 empty cells between data. So I guess if you are able to provide it, could you please enlighten me a little in regard to the purpose of these parts, it would be greatly appreciated. As I am able to make the formula work using different figures in these spots.

    No worries on posting a workbook next time.

    So far the help has been great so I may become a bit of regular when I can't work it out myself.

    Cheers again.
    Last edited by Griff0; 06-03-2010 at 02:47 AM.

  11. #11
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Sort Data from one column to Separate Columns

    Griff, the other day I answered a question quite similar to yours and explained the concept of the Index formula. See here

    http://www.excelforum.com/excel-new-...ml#post2314982

    cheers

  12. #12
    Registered User
    Join Date
    06-01-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Sort Data from one column to Separate Columns

    Sweet

    Thanks

+ 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