+ Reply to Thread
Results 1 to 12 of 12

Substitute, find and mid

  1. #1
    Registered User
    Join Date
    02-16-2010
    Location
    Tallinn, Estonia
    MS-Off Ver
    Excel 2003
    Posts
    11

    Substitute, find and mid

    I have image paths in a cell, I need to get the image names only to the other cell

    path
    http://bla-bla-bla/dir1/dir2/image_n...&variable2=456

    or

    http://bla-bla/dir11/dir22/dir33/image_name.jpg

    (the path names and structures vary)

    I need to get the image_name out into another cell. So I need a function which says 'remove everything starting from 5th "/" and everything starting from first "?".

    I was able to remove the first portion in one formula and the last portion in another one but couldn't combine them into one formula.

    Any help greatly appreciated!

  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: Substitute, find and mid

    got some proper examples in an excel sheet coz the forum truncates those . they show as this in properties but just what do you want from the first one the second is easier =TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",25)),20))
    xhttp://bla-bla-bla/dir1/dir2/image_name?variable=123&variable2=456x]
    http://bla-bla/dir11/dir22/dir33/image_name.jpg
    Last edited by martindwilson; 03-16-2010 at 02:30 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
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Substitute, find and mid

    Post deleted, was unable to suppress link parsing as expected
    Last edited by 6StringJazzer; 03-16-2010 at 02:25 PM.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    02-16-2010
    Location
    Tallinn, Estonia
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Substitute, find and mid

    I attatched the file instead.
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Substitute, find and mid

    was unable to suppress link parsing as expected
    [noparse]urls & other stuff[/noparse]
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    02-16-2010
    Location
    Tallinn, Estonia
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Substitute, find and mid

    I am sorry, I do not get this. I attatched the excel sheet instead, the links are not necessary anymore. Or should I post a new thread now?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Substitute, find and mid

    No, carry on. I was just responding to 6SJ.

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

    Re: Substitute, find and mid

    well if only in that format with following _ or ?
    =IF(ISNUMBER(FIND("?",B2)),TRIM(RIGHT(SUBSTITUTE(LEFT(B2,FIND("?",B2)-1),"/",REPT(" ",30)),25)),TRIM(RIGHT(SUBSTITUTE(LEFT(B2,FIND("_",B2)-1),"/",REPT(" ",30)),25)))

  9. #9
    Registered User
    Join Date
    02-16-2010
    Location
    Tallinn, Estonia
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Substitute, find and mid

    Thank you.
    It doesn't work for me, would you like to attach the file in here?

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

    Re: Substitute, find and mid

    probably you need ; not ,
    but
    here it is
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-16-2010
    Location
    Tallinn, Estonia
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Substitute, find and mid

    Now it works like a charm, thank you very much, highly appreciated!

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Substitute, find and mid

    Quote Originally Posted by shg View Post
    [noparse]urls & other stuff[/noparse]
    Just for the record, I quoted the original post then unchecked "Automatically parse links in text." However, the coding underlying the paste explicitly parsed the links anyway. When I tried to edit it, I discovered that the "Automatically parse links in text" option is not available in edit-existing-post mode. Didn't know about the noparse tag, much obliged.

    Sorry to derail the thread.

+ 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