+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Text to columns

  1. #1
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Text to columns

    I have a text that I am trying to separate into two columns but the text is so inconsistent that when I try to to spilt the cells I can't get the text breaks in the right spot from one cell to another.

    The only constant between all the cells that I can see would be a way to detect where to insert the break is 5 spaces.

    I have pasted an example of what I am trying to do. I want to separate the part number from the qty in stock.

    Hope someone can help

    chsdjkthgkvndjkfgklsdjgkld 412 In-stock
    dfuisdfjsdklfj;sdiofuskldjfosdfjz 631 In-stock
    sdkusilckjskldfuskldcjsdklguklsddfkljgsd-dgjjkdfhsd 114 In-stock
    fhiasdjfklsdjfk dklgjudkldklgjdklfgj jkgkldfgjdkl+ 27 In-stock
    cjbklig;lfkv dfgidl;gkdfl;gil flgiglglkdlfgk++dfhdfjk 5 In-stock

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

    Re: Advanced text to columns HELP PLEASE

    A formula in next column like this will extract the numbers out...

    =LOOKUP(9.999999999E+307,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW($1:$30))))

    where A1 contains the first text string.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,296

    Re: Advanced text to columns HELP PLEASE

    Hi and welcome to the forum.

    If you want to extract the number to another cell, use this Array formula.(C+S+E)TOGETHER. nOT JUST eNTER.

    =SUM((MID(0&A1;LARGE(IF(ISNUMBER(MID(0&A1;ROW($1:$256);1)*1);ROW($1:$256);1);ROW($1:$256));1)*1)*10^ (ROW($1:$256)-1))

    yOUR TEXT IN a1

    Hope to helps you.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  4. #4
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    Hi and thanks.

    The problem here is that many of the part numbers have numbers in their description. The only identifier i can see woudl be the 5 spaces in between the part number and the qauntity.

  5. #5
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    sorry for the typos..

  6. #6
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    both formulas above are not working.

  7. #7
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    ok, I figured it out. I used this formula. It extracts the quantity in stock and puts it in it's own column.

    Can I delete this info from the original cell though?

  8. #8
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    =right(a1,15)

  9. #9
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,296

    Re: Advanced text to columns HELP PLEASE

    Melisa, take a look to the example. Works OK!

    cTRL+sHIFT+eNTER Together. Not just Enter.
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  10. #10
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Advanced text to columns HELP PLEASE

    You could use
    =-LOOKUP(2,-RIGHT(TRIM(SUBSTITUTE(A1,"In-stock","")),{1,2,3,4,5,6,7,8,9}))
    if the text is always "In-stock" exactly.
    Good luck.

  11. #11
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,616

    Re: Advanced text to columns HELP PLEASE

    In another column you can use formula like:

    =SUBSTITUTE(A1,B1,"")

    copied down

    Then you can copy this column and edit|paste special>>Values over the original.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  12. #12
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,616

    Re: Advanced text to columns HELP PLEASE

    In another column you can use formula like:

    =SUBSTITUTE(A1,B1,"")

    copied down

    Then you can copy this column and edit|paste special>>Values over the original.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  13. #13
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    This worked wonderfully - thanks.
    But now how can I delete the qty in stock from the original cell so just the part number shows?

  14. #14
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,616

    Re: Advanced text to columns HELP PLEASE

    Try:

    =LEFT(A1,MIN(FIND(0,SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},0)&0))-1)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  15. #15
    Registered User
    Join Date
    01-24-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Advanced text to columns HELP PLEASE

    Unfortunately that doesn't work because the part numbers are all different lengths.

+ 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.2.0