+ Reply to Thread
Results 1 to 7 of 7

Extract Text after /thisword/

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    seattle
    MS-Off Ver
    Excel 2003
    Posts
    20

    Extract Text after /thisword/

    I am trying to extract all the text in this string which occurs after /en-us/


    http://advertising.microsoft.com/wwd...d-in/setup.exe

    so that it looks like this

    advertise/add-in/setup.exe



    If possible, from the remaining string, I would like to replace all forward slashes with a space and format all remaining words with the =Proper format.

    Any thoughts?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Extract Text after /thisword/

    If it's in cell A1, try:

    =PROPER(SUBSTITUTE(RIGHT(A1,LEN(A1)-FIND("en-us",A1)-5),"/"," "))

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extract Text after /thisword/

    My version:

    =MID(A1, FIND("/en-us/", A1)+7, LEN(A1))

    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Extract Text after /thisword/

    @JBeaucaire: well, it's shorter than mine ... but it doesn't do the formatting the OP asked for ;-)

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extract Text after /thisword/

    Heh, I completely missed the second question. your technique is best for that.

  6. #6
    Registered User
    Join Date
    02-09-2010
    Location
    seattle
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Extract Text after /thisword/

    thank you all!!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Extract Text after /thisword/

    You're welcome.

    If this has answered your question, please mark the thread as solved. See my signature for details or the FAQ.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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