Logical

When either test may pass

Definition

Showing 1 when either of two tests passes means wrapping OR inside IF.

Syntax

=IF(OR(logical1, logical2),1,0)

Arguments

Argument Meaning
logical1 The first test, for example B2>50.
logical2 The second test, for example C2="yes".

Worked example

A desk flags a rush when quantity in B2 is over 50 or the vip cell in C2 is yes.

A: Ticket B: Quantity C: Vip
T-14 12 no
T-15 80 no
T-16 9 yes

Formula: =IF(OR(B2>50,C2="yes"),1,0)

Result: 0. 12 is not over 50 and C2 is not yes, so neither test passes.

Practice

Cell C2 holds 20. Cell D2 holds 1. In E2, write a formula that shows 1 when C2 is greater than 10 or D2 is less than 5, and 0 otherwise.

  1. In E2, write an IF formula that uses OR and shows 1 when C2 is greater than 10 or D2 is less than 5, and 0 otherwise.
Step 1 of 2
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…

Related functions

OR is the function that lets either test pass.

Common mistake

Leaving out the vip test, as in =IF(OR(B2>50),1,0): T-16 would show 0 even though C2 is yes.

Related functions

These links are related functions.