Home > Blockchain >  Using a =IF(OR formula when I want a partial match
Using a =IF(OR formula when I want a partial match

Time:09-28

I've got the following formula, but it does not work as when I add the California around the name it just fails so it just tells me that everything is UK. How can I fix this?

=IF(OR(N10776="*California*",N10776="*San Francisco*",N10776="*New York*"),"USA","UK")

CodePudding user response:

This should work

=IF(OR(IFERROR(SEARCH("California",N10776)>0,FALSE),IFERROR(SEARCH("San Francisco",N10776)>0, FALSE),IFERROR(SEARCH("New York",N10776)>0,FALSE)),"USA","UK")

CodePudding user response:

Try below formula.

=IF(OR(ISNUMBER(SEARCH({"California","San Francisco","New York"},A1))),"USA","UK")

May need array entry CTRL SHIFT ENTER for older versions of Excel.

enter image description here

  • Related