+ Reply to Thread
Results 1 to 8 of 8

extract text out of a string [SOLVED]

Hybrid View

hung2502 extract text out of a string... 01-18-2012, 06:35 PM
tom1977 Re: extract text out of a... 01-18-2012, 06:38 PM
hung2502 Re: extract text out of a... 01-18-2012, 06:47 PM
Fotis1991 Re: extract text out of a... 01-18-2012, 06:43 PM
hung2502 Re: extract text out of a... 01-18-2012, 06:48 PM
Haseeb Avarakkan Re: extract text out of a... 01-18-2012, 07:04 PM
hung2502 Re: extract text out of a... 01-18-2012, 07:09 PM
Fotis1991 Re: extract text out of a... 01-18-2012, 07:20 PM
  1. #1
    Registered User
    Join Date
    01-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    4

    extract text out of a string [SOLVED]

    A B
    1
    2 125 BUSINESS CENTER DR 125
    3 127 BUSINESS CENTER DR 127
    4 132 BUSINESS CENTER DR 132
    5 143 BUSINESS CENTER DR 143


    for the above table, I used the below code to extract numerical values in strings in column A and put the result in column B,
    "=LOOKUP(99^99,--(0&MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&1234567890)),ROW(INDIRECT("1:"&LEN(A2)+1)))))"

    Could you help me edit this code so that now the remainning texts will result in column C
    (i.e. C2 will be "BUSINESS CENTER DR")

    Thank you
    Last edited by hung2502; 01-18-2012 at 07:12 PM.

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: extract text out of a string

    If your data looks always like this you can use left and right functions
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    01-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: extract text out of a string

    no tom, it doesn't always look like this. Many different street names

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: extract text out of a string

    Hi and welcome to the forum

    Try this:

    =TRIM(MID(A2;MAX(ISNUMBER(MID(A2;COLUMN(1:1);1)*1)*COLUMN(1:1))+1;2^15))

    Array formula CSE. Not just Enter.

    Hope to helps you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    01-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: extract text out of a string

    Quote Originally Posted by Fotis1991 View Post
    Hi and welcome to the forum

    Try this:

    =TRIM(MID(A2;MAX(ISNUMBER(MID(A2;COLUMN(1:1);1)*1)*COLUMN(1:1))+1;2^15))

    Array formula CSE. Not just Enter.

    Hope to helps you.
    Sorry but I am lost. What u mean by "Array formula CSE. Not just Enter"

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

    Re: extract text out of a string

    it doesn't always look like this. Many different street names
    So please attach a dummy file with your possible different street names with expected results.

    This will work based on your sample

    B2, copy down...

    =LEFT(A2,FIND(" ",A2)-1)+0

    C2, copy down...

    =TRIM(SUBSTITUTE(A2,C2,""))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  7. #7
    Registered User
    Join Date
    01-18-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: extract text out of a string

    Quote Originally Posted by Haseeb A View Post
    So please attach a dummy file with your possible different street names with expected results.

    This will work based on your sample

    B2, copy down...

    =LEFT(A2,FIND(" ",A2)-1)+0

    C2, copy down...

    =TRIM(SUBSTITUTE(A2,C2,""))
    Thank you very much. This is all I am looking for.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: extract text out of a string [SOLVED]

    cse>Array formula,means, that when you copy the formula, dont click just enter, but Control+Shift+Enter >>ALL together!

+ 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