How do you do an IF ... OR ... THEN statement in a Google spreadsheet? In PHP I would do this:

if($C7 == "U.S.A." || $C7 == "Canada"){ ...

How to do the same as a spreadsheet formula?

At the moment I have

= IF ( C7 = "U.S.A." , "The Americas" , "Europe" )

I'd like to say if C7 = "U.S.A." OR "Canada"...

NB: I should have been able to (and tried extensively to) Google this, but the search engine ignores the words IF and OR


2 Answers 2


In Google Spreadsheets, OR is a function (with any number of arguments), so you would write

IF (OR(C7 = "U.S.A."; C7 = "Canada"); "The Americas"; "Europe")

See the example spreadsheet I set up.

Also, check the Google Spreadsheets function list.

Note that my example code uses ; - you might have to use ,, depending on your locale settings.


If you have longer statement,you can use regexmatch() instead.


separated by adding | symbol.

For more complicated use,see the official documents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.