Reputation: 2696
I am using the following formula to search for a string and return a value
IF(ISNUMBER(SEARCH("CHA*",B:B),"CINEMA","")
If I want to search for multiple strings whats the formula?, I've tried the following but it isn't returning anything
IF(ISNUMBER(SEARCH({"odeon*","vue*"},B:B),"CINEMA","")
Upvotes: 1
Views: 562
Reputation: 51
For starters, you're missing a )
on either formula. And for them to work anyway, you should, as Taosique pointed out, use =IF(OR(ISNUMBER(SEARCH(
if you need just one substring, or =IF(AND(ISNUMBER(SEARCH(
if you require both.
Good luck!
Upvotes: 0
Reputation: 7884
Try this:
=IF(COUNT(SEARCH({"odeon*","vue*"},B:B))>0,"CINEMA","")
Another way:
=IF(OR(ISNUMBER(SEARCH({"odeon*","vue*"},B:B))),"CINEMA","")
Use AND()
if you require ALL substrings to match:
=IF(AND(ISNUMBER(SEARCH({"odeon*","vue*"},B:B))),"CINEMA","")
Upvotes: 1