+ Reply to Thread
Results 1 to 12 of 12

Thread: 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 Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,786

    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 a dabbler in Cisco
    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 Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    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.
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and 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 Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,770

    Re: Substitute, find and mid

    was unable to suppress link parsing as expected
    [noparse]urls & other stuff[/noparse]
    Microsoft MVP - Excel
    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 Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,770

    Re: Substitute, find and mid

    No, carry on. I was just responding to 6SJ.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

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

    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)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    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

  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 Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,786

    Re: Substitute, find and mid

    probably you need ; not ,
    but
    here it is
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    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

  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
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    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.
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

+ 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