+ Reply to Thread
Results 1 to 3 of 3

Removing text after last \

Hybrid View

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    Brighton
    MS-Off Ver
    Excel 2003
    Posts
    21

    Removing text after last \

    Hi

    I have a load of file paths that need to be amended by removing the file name at the end.
    For example

    aaaaz\bbbbbb\aaaaa\aaaa\aaaa\iiii

    and to show as below

    aaaaz\bbbbbb\aaaaa\aaaa\aaaa\

    All of the file paths are different. Is their a formula or a bit of code I can use to remove everything after the last \

    Thanks
    Last edited by frostie77; 11-11-2010 at 01:35 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Removing text after last \

    Quite a few options here - assume original in A1 then:

    B1:
    =LEFT(A1,FIND("^^",SUBSTITUTE(A1,"\","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))

  3. #3
    Registered User
    Join Date
    08-12-2010
    Location
    Brighton
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Removing text after last \

    Thank you that worked perfectly

+ 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