+ Reply to Thread
Results 1 to 4 of 4

isolating specified characters

  1. #1
    Registered User
    Join Date
    05-19-2008
    Posts
    3

    isolating specified characters

    Can anyone tell me how I can isolate specific text from a text string...
    there's a catch though ..

    I am trying to 'flag' specific commercial shipping information that has been entered onto an Excel sheet : ie.

    opt 6 mos - which means, literally, '6 month option'

    I want to isolate the 'opt' part and using something like
    =IF((SEARCH("opt",A10,1))>0,"EXT","")

    ..is only half the solution in that it WILL isolate the 'opt' but as I an using this in a whole column of similar entries that may/may not have 'opt' included, when there is NO 'opt' the SEARCH returns #VALUE!
    I want it to return either 'OPT' or a blank field. That's the first part of this query.

    The second part is that there is another condition that could arise (and I want to isolate also) - example is :

    ext 12 Mos - which means '12 months excepted'

    I need to isolate the 'ext' and display it as EXT (as in the SEARCH method above)

    Ideally I would want to cover both possibilities in a single combination of functions that would work alonf the lines of the following logic :
    IF <search for 'opt'> TRUE then display OPT,
    IF <search for 'ext'> TRUE then display EXT,
    otherwise display <blank>

    Any advice would be appreciated thanks.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, You could try this UDF:-
    Right click sheet tab, Click View code, Select Insert, Select Module, Paste in VB Editor window.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try...

    =IF(ISNUMBER(SEARCH("opt",A2)),"OPT",IF(ISNUMBER(SEARCH("ext",A2)),"EXT",""))

    Hope this helps!

  4. #4
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351
    This works too
    =IF(ISERROR(FIND("opt",A14)=3),"","opt")&IF(ISERROR(FIND("ext",A14)=3),"","ext")

    As in sheet attached
    Attached Files Attached Files
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

+ 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