search for multiple strings

  • Thread starter Thread starter Lea from CA
  • Start date Start date
L

Lea from CA

Here is my current formula =IF(ISERROR(SEARCH("move",D4)),0,E4). Now I want
to also search for "carryforward" in cell D4. How can I do that?
 
Add another =search() to your formula.

But the next question is--what do you want to check for:
either/or/or both
Either/or, but not both (exactly one)
or none

=if(and(iserror(search("carryforward",d4)),ISERROR(SEARCH("move",D4))),
"neither","at least one")

You may want to use =isnumber() instead of =iserror(). That'll be true if the
string is in the cell.

And you may want to use =Or() instead of =And() in the formula.
 
Lea from CA said:
Here is my current formula =IF(ISERROR(SEARCH("move",D4)),0,E4). Now I want
to also search for "carryforward" in cell D4. How can I do that?


Here's another way...

=IF(OR(ISNUMBER(SEARCH({"move","carryforward"},D4))),E4,0)
 
It works! Thank you so much!

Gary Brown said:
=IF(AND(ISERROR(SEARCH("move",D4)),ISERROR(SEARCH("carryforward",D4))),0,E4)
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown
 
Back
Top