+ Reply to Thread
Results 1 to 6 of 6

Question on using SEARCH formula to search for multiple strings in a cell

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Question on using SEARCH formula to search for multiple strings in a cell

    Hello, is it possible to use the OR operator in the "Find Text" value of a SEARCH formula? The formula below is what I am trying use, but it is returning "Active" because the inclusion of the OR operator causes an #VALUE! error. If this is not possible, is there another or better way to search a cell for either "archive" or "inactive" strings?


    =IFERROR(SEARCH(OR("archive","inactive"),H2),"Active")

    Thanks!
    Clayton Grove

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: Question on using SEARCH formula to search for multiple strings in a cell

    So let's say we have your string values in column A. In column B we want to put some functions to tell us if certain sub-strings exist in the A column data.

    You could use this
    Please Login or Register  to view this content.

  3. #3
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Question on using SEARCH formula to search for multiple strings in a cell

    see if this helps:

    =IFERROR(IFERROR(SEARCH("archive",A1),SEARCH("inactive",A1)),"active")

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Question on using SEARCH formula to search for multiple strings in a cell

    SEARCH() returns a numeric answer, so you really want to add an OR() and an ISNUMBER() test to see if any of them returned a number:

    =IF(OR(ISNUMBER(SEARCH({"archive","inactive"}, H2))),"Active","")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Question on using SEARCH formula to search for multiple strings in a cell

    Or...

    =IF(COUNT(SEARCH({"archive","inactive"},H2)),"Active","")
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  6. #6
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Question on using SEARCH formula to search for multiple strings in a cell

    Did these work?

+ 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