+ Reply to Thread
Results 1 to 3 of 3

search for text within text

  1. #1
    Registered User
    Join Date
    03-30-2004
    Posts
    31

    search for text within text

    I have a single cell that can contain up to 41 different text strings that are like this:

    text/text/Above 1/text where I can have Above 1, Below 1 or Below Ground



    I'm looking for a function that will tell me if that text sting contains a certain word (like "Above 1" in the example above). I want to use the result of that function as an argument for an IF function. I've already used a combination LEFT/SEARCH function, but since the text length before and after what I'm looking for (e.g. Above 1) varies, it isn't working.

    Any ideas?

    TIA

  2. #2
    Biff
    Guest

    Re: search for text within text

    Hi!

    Try one of these:

    =ISNUMBER(SEARCH("Above 1",A1))

    Or:

    =ISNUMBER(FIND("Above 1",A1))

    FIND is case sensitive, SEARCH is not.

    =IF(ISNUMBER(SEARCH("Above 1",A1)),do_something,do_something_else)

    Biff

    "BigDave" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a single cell that can contain up to 41 different text strings
    > that are like this:
    >
    > -text/text/Above 1/text- where I can have Above 1, Below 1 or Below
    > Ground
    >
    >
    >
    > I'm looking for a function that will tell me if that text sting
    > contains a certain word (like "Above 1" in the example above). I want
    > to use the result of that function as an argument for an IF function.
    > I've already used a combination LEFT/SEARCH function, but since the
    > text length before and after what I'm looking for (e.g. Above 1)
    > varies, it isn't working.
    >
    > Any ideas?
    >
    > TIA
    >
    >
    > --
    > BigDave
    > ------------------------------------------------------------------------
    > BigDave's Profile:
    > http://www.excelforum.com/member.php...fo&userid=7741
    > View this thread: http://www.excelforum.com/showthread...hreadid=485920
    >




  3. #3
    bobwhite
    Guest

    RE: search for text within text

    BigDave

    Consider "=FIND("Above 1",A1)". It will give you the position in the Text
    String where "Above 1" starts.

    "BigDave" wrote:

    >
    > I have a single cell that can contain up to 41 different text strings
    > that are like this:
    >
    > -text/text/Above 1/text- where I can have Above 1, Below 1 or Below
    > Ground
    >
    >
    >
    > I'm looking for a function that will tell me if that text sting
    > contains a certain word (like "Above 1" in the example above). I want
    > to use the result of that function as an argument for an IF function.
    > I've already used a combination LEFT/SEARCH function, but since the
    > text length before and after what I'm looking for (e.g. Above 1)
    > varies, it isn't working.
    >
    > Any ideas?
    >
    > TIA
    >
    >
    > --
    > BigDave
    > ------------------------------------------------------------------------
    > BigDave's Profile: http://www.excelforum.com/member.php...fo&userid=7741
    > View this thread: http://www.excelforum.com/showthread...hreadid=485920
    >
    >


+ 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