+ Reply to Thread
Results 1 to 6 of 6

Text to column question

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Text to column question

    In the attached file I want to take the raw data (college basketball standings) and display the team record as a win-loss format rather than a date using text to colums without retyping the result. I have tried formating as text but the format disapears using text to colums.

    The file should explain it much clearer.

    Jim O
    Attached Files Attached Files

  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: Text to column question

    when you use the wizerd text to columns change the "column data format" from general to text before you complete finish
    you might be better using 3 formulas as text to columns will split
    1 Kentucky 6-0
    2 Ohio State 6-0
    differently


    in f2 =TRIM(LEFT(C2,2))
    in g2 =TRIM(MID(SUBSTITUTE(TRIM(C2)," ",REPT(" ",50)),48,25))
    in h2 =TRIM(RIGHT(SUBSTITUTE(TRIM(C2)," ",REPT(" ",50)),10))
    Last edited by martindwilson; 11-30-2011 at 06:56 PM.
    "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

  3. #3
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Text to column question

    Martin,

    The formulas work well but if the school has 2 names I only get the first name. See file.


    Jim O
    Attached Files Attached Files

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

    Re: Text to column question

    =if(len(trim(c2))-len(substitute(trim(c2)," ",""))=2,trim(mid(substitute(trim(c2)," ",rept(" ",50)),48,25)),trim(mid(substitute(trim(c2)," ",rept(" ",50)),48,100)))

  5. #5
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Text to column question

    Martin,


    That does the trick.

    If you dont mind I have a question. How does it work?

    Jim O

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Text to column question

    Also,

    F2,

    =TRIM(LEFT(C2,FIND(" ",C2)-1))

    G2,

    =TRIM(SUBSTITUTE(REPLACE(C2,FIND(H2,C2),250,""),F2,"",1))

    H2,

    =TRIM(RIGHT(SUBSTITUTE(TRIM(C2)," ",REPT(" ",50)),20))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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