+ Reply to Thread
Results 1 to 6 of 6

Find 2 different characters in text string

  1. #1
    Registered User
    Join Date
    12-10-2007
    Posts
    8

    Find 2 different characters in text string

    I have some data that I need to extract numbers from, I'm nearly there but don't know how to use the find function for more than one character that may be in the string, it will be either a "S" or "/". I can get it to find one of them but can't work out how to look for the possibility of either in the string?

    The attached sheet will help explain?

    Rgds
    Shane
    Attached Files Attached Files
    Last edited by shanevo6; 06-11-2011 at 11:22 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Find 2 different characters in text string

    Use formula in B2:

    =LEFT(A2,(FIND("/",SUBSTITUTE(A2,"S","/")))-1)

    and in D2:

    =RIGHT(A2,LEN(A2)-SEARCH("/",SUBSTITUTE(A2,"S","/")))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-10-2007
    Posts
    8

    Re: Find 2 different characters in text string

    Many thanks, is it possible to connect the formulas in cell B2 &C2 instead of having 2 seperate formulas?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Find 2 different characters in text string

    Yes, try:

    =IF(LEFT(A2,(FIND("/",SUBSTITUTE(A2,"S","/")))-1)>300,RIGHT(LEFT(A2,(FIND("/",SUBSTITUTE(A2,"S","/")))-1),3))

  5. #5
    Registered User
    Join Date
    12-10-2007
    Posts
    8

    Re: Find 2 different characters in text string

    Many thanks NVBC, I know I've marked as SOLVED but is it possible to limit the characters in D2 to 3 as I've just realised that some text has a letter at the end eg 8502/204W, I want to lose the 'W'.

    Thanks once again
    Shane

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Find 2 different characters in text string

    I just noticed that added request... usually it is best to post a new post rather than add to your last post, since most of don't look back unless an apparent new request has been made....

    Anyway, if you still need it.. If only a W can happen.. try:

    =SUBSTITUTE(RIGHT(A2,LEN(A2)-SEARCH("/",SUBSTITUTE(A2,"S","/"))),"W","")

    If it is always 3 digits, then

    =LEFT(RIGHT(A2,LEN(A2)-SEARCH("/",SUBSTITUTE(A2,"S","/"))),3)

+ 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