+ Reply to Thread
Results 1 to 5 of 5

Finding a Keyword in a Cell

  1. #1
    Registered User
    Join Date
    12-05-2005
    Posts
    13

    Finding a Keyword in a Cell

    If I have a group of cells that have different text strings in them (differing in length as well), is there any easy way to write a formula that will tell if the cells have a certain word at any point in the string?

    i.e. if I am looking to flag any cells with the word "exempt" in them, how could you write a formula that would pick up if "exempt" were in the beginning, end, or somewhere in the middle of the cell?

    Thanks,
    Nick

  2. #2
    Gary''s Student
    Guest

    RE: Finding a Keyword in a Cell

    Select cell A1 and pull-down:
    Format > Conditional formating... > Equation is >
    =ISNUMBER(SEARCH("exempt",A1)) and pick a nice format

    Then copy the cell and paste/special format over the cells you want to
    investigate
    --
    Gary's Student


    "thekovinc" wrote:

    >
    > If I have a group of cells that have different text strings in them
    > (differing in length as well), is there any easy way to write a formula
    > that will tell if the cells have a certain word at any point in the
    > string?
    >
    > i.e. if I am looking to flag any cells with the word "exempt" in them,
    > how could you write a formula that would pick up if "exempt" were in
    > the beginning, end, or somewhere in the middle of the cell?
    >
    > Thanks,
    > Nick
    >
    >
    > --
    > thekovinc
    > ------------------------------------------------------------------------
    > thekovinc's Profile: http://www.excelforum.com/member.php...o&userid=29378
    > View this thread: http://www.excelforum.com/showthread...hreadid=543368
    >
    >


  3. #3
    Dave O
    Guest

    Re: Finding a Keyword in a Cell

    The SEARCH and FIND functions will do this for you- SEARCH is not case
    sensitive, while FIND is case sensitive. In your example if the word
    "exempt" does not appear in the cell, both SEARCH and FIND will return
    an error message, so you may need to nest them into an IF statement:
    =IF(ISNUMBER(SEARCH(A1,"exempt",1)),"Exempt","")
    ....to avoid the error.


  4. #4
    David Biddulph
    Guest

    Re: Finding a Keyword in a Cell

    "thekovinc" <thekovinc.280hbn_1147969500.9227@excelforum-nospam.com> wrote
    in message news:thekovinc.280hbn_1147969500.9227@excelforum-nospam.com...
    >
    > If I have a group of cells that have different text strings in them
    > (differing in length as well), is there any easy way to write a formula
    > that will tell if the cells have a certain word at any point in the
    > string?
    >
    > i.e. if I am looking to flag any cells with the word "exempt" in them,
    > how could you write a formula that would pick up if "exempt" were in
    > the beginning, end, or somewhere in the middle of the cell?


    =ISNUMBER(FIND("exempt",A1)) will return true or false and is case
    sensitive.
    =ISNUMBER(SEARCH("exempt",A1)) if you don't want it case sensitive.
    --
    David Biddulph



  5. #5
    Registered User
    Join Date
    12-05-2005
    Posts
    13
    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