+ Reply to Thread
Results 1 to 3 of 3

Searching for specific text within a cell

  1. #1
    Registered User
    Join Date
    12-05-2006
    Posts
    29

    Searching for specific text within a cell

    Im looking for the function that looks in a cell and tells me if a certain word is contained within that cell. There are other words in the cells as well but I just want to denote in a new column the cells that contain the word dog etc. I've tried enclosing what I'm looking for in $, *, ~ in an IF statement, but it doesn't seem to work. Any ideas?

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by plannerg
    Im looking for the function that looks in a cell and tells me if a certain word is contained within that cell. There are other words in the cells as well but I just want to denote in a new column the cells that contain the word dog etc. I've tried enclosing what I'm looking for in $, *, ~ in an IF statement, but it doesn't seem to work. Any ideas?

    Thanks.
    Hi,

    try (for G9)

    =IF(FIND("DOG",G9&"DOG",1)>LEN(G9),"Is not contained","Is contained")

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    This will return TRUE if "dog" appears in A1

    =ISNUMBER(SEARCH("dog",A1))

    SEARCH is not case-sensitive so this returns TRUE if A1 contains "dog" or "DOG", if you want it to be case-sensitive use FIND instead of SEARCH

    note: this formula returns TRUE if cell contains "hotdog" or "doggone". If you don't want that, assuming cell contains just words with spaces between

    =ISNUMBER(SEARCH(" dog "," "&A1&" "))

+ 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