search for multiple strings

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?
 
D

Dave Peterson

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.
 
D

Domenic

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)
 
L

Lea from CA

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top