Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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

share|improve this question
I you feel your question has been answered properly, please mark it as the accepted answer, see faq. – Jacob Jan Tuinstra Feb 5 at 21:56

1 Answer

up vote 3 down vote accepted

In Google Spreadsheets, OR is a function (with any numbers 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.

share|improve this answer
Great, thank you for all your help! – Djave Feb 5 at 16:26
Glad I could help! If you're happy with the answer, you could press "Accept". – Vidar S. Ramdal Feb 5 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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