Forum Discussion

JDRAKE4524's avatar
JDRAKE4524
Copper Contributor
Nov 26, 2019
Solved

ISNUMBER(OR(SEARCH not producing expected results.

I am not sure why this is not working. I an no expert so bare with me.

I have a column of text entries. I can use

=ISNUMBER(SEARCH("CARD",D6))  to get a result TRUE/FALSE but I need to extend that to add a second value. So I have tried

=ISNUMBER(OR(SEARCH("PIN",D6),SEARCH("CARD",D6))) which returns only FALSE values and

=ISNUMBER(SEARCH(OR("PIN","CARD"),D6)) which also returns only FALSE values.

Where am I going wrong? Why is the OR not happening?

Thank you for your help.

John

 

 

 

  • JDRAKE4524 

    Practically the same

    =SUM(--ISNUMBER(SEARCH({"PIN","CARD"},D6)))

    or, if return to initial formula

    =OR(ISNUMBER(SEARCH("PIN",D6)),ISNUMBER(SEARCH("CARD",D6)))

     

     

7 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    JDRAKE4524 

    Practically the same

    =SUM(--ISNUMBER(SEARCH({"PIN","CARD"},D6)))

    or, if return to initial formula

    =OR(ISNUMBER(SEARCH("PIN",D6)),ISNUMBER(SEARCH("CARD",D6)))

     

     

    • JDRAKE4524's avatar
      JDRAKE4524
      Copper Contributor

      SergeiBaklan 

      Thank you for your assistance. The second option worked as how I was looking for the results to be. The first one gave a 0 return (as I would have guessed as a SUM function) and not a FALSE.

      Thank you again for your help.

      John

       

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        JDRAKE4524 

        John, you are welcome. In Excel FALSE and zero are equivalent, you may use any of them in condition.

  • Twifoo's avatar
    Twifoo
    Silver Contributor
    I haven’t tested, but you may try, this:
    =SUM(COUNTIF(D6,
    {“*Card*”,”*Pin*”}))>0
    • JDRAKE4524's avatar
      JDRAKE4524
      Copper Contributor

      Twifoo 

      Thank you for the assistance. This gave an error when entered as not a formula.

Resources