+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : How can you extract a cell string based on a wildcard?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    2

    How can you extract a cell string based on a wildcard?

    Hi all,

    I want tot be able to capture a string value in Excel based on a wildcard. On this occasion the wildcard is a backslash. Here are some examples:

    The\cat\sat\on\the\mat
    The\cat\did not sit on the mat
    c:\program files\mysoftware\my super software

    I want to be able to capture the end of the string after the last backslash. In these examples the three values I would have returned is:

    mat
    did not sit on the mat
    my super software

    As the return value varies in length as well as the number of possible backslahes in the string it is a little more complicated than simply using the Excel "right" function. Can anyone help please.

    Thanks.

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

    Re: How can you extract a cell string based on a wildcard?

    With strings in A1, A2 etc

    B1:
    =TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",LEN(A1))),LEN(A1)))
    copied down

  3. #3
    Registered User
    Join Date
    11-05-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How can you extract a cell string based on a wildcard?

    That works great. Thank you very much.

+ 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