ExcelTool.io

IF OR Generator

Return one value when any of your conditions is true, using IF with a nested OR.

IF OR

Return one value when any of your conditions is true, using IF with a nested OR.

Logic

A test that returns TRUE or FALSE. Text you compare against needs quotes.

The alternative test. Either one being true is enough.

Returned when at least one condition is true. Text needs quotes.

Returned only when every condition is false. Text needs quotes.

=IF(OR(B2="Overdue", C2>30), "Follow up", "OK")

Worked Example

Chase an invoice if it is either flagged Overdue or more than 30 days old.

=IF(OR(B2="Overdue", C2>30), "Follow up", "OK")

Returns: Returns "Follow up" when B2 reads Overdue OR C2 is greater than 30 (or both); returns "OK" only when neither is true.

Checks Before You Paste

  • OR is inclusive: it returns TRUE when one, several, or all of the tests pass. For exactly one of two conditions, use XOR instead, which exists in Excel 2013 and later and in Google Sheets - but note that with three or more arguments XOR returns TRUE when an odd number of them are true, not when precisely one is.
  • Testing one cell against a long list of values gets unreadable fast. =IF(COUNTIF($E$2:$E$20, A2)>0, "Follow up", "OK") replaces a dozen OR arguments and lets you edit the list on the sheet instead of in the formula.
  • When you mix AND with OR, the parentheses decide the logic - there is no operator precedence to fall back on. AND(A2="North", OR(B2>100, C2="VIP")) is a completely different rule from OR(AND(A2="North", B2>100), C2="VIP").

How IF OR works

Availability: IF and OR are in every version of Excel, Excel for the web, Google Sheets and LibreOffice Calc. XOR, mentioned below, needs Excel 2013 or later.

IF(OR(...)) returns one result when at least one of several tests passes and a different result only when every test fails. The OR lives inside IF's first argument: OR collapses however many tests you hand it into a single TRUE or FALSE, and IF then chooses between two outcomes. OR is inclusive, so one test passing and all of them passing give exactly the same answer.

Use this shape when several unrelated conditions should trigger the same outcome - escalate a ticket if it is marked critical, or the customer is on an enterprise plan, or it has been open too long. If every condition instead has to hold at once, swap OR for AND. If each condition needs its own distinct result, IF(OR(...)) is the wrong tool no matter how many conditions you add, because it can only ever produce two answers; IFS or nested IF is the right shape there. And when the real question is "is this value one of a list", a COUNTIF against a range on the sheet is far easier to maintain than fifteen OR arguments.

OR expects logical values. A comparison such as C2>30 produces one. A bare cell reference works only when that cell holds TRUE, FALSE, or a number, where zero counts as FALSE and any other number as TRUE. A cell holding text makes OR return #VALUE!, and an empty cell counts as FALSE - which is why rows with missing data quietly land in the value_if_false branch instead of being flagged for attention.

There is no short-circuit evaluation. Excel works out every argument before OR runs, so an error produced by the third test still surfaces even though the first test already returned TRUE. Text comparisons are also case-insensitive, so B2="paid" matches PAID and Paid; wrap the test in EXACT when case actually matters.

Syntax

=IF(OR(logical1, [logical2], ...), [value_if_true], [value_if_false])
ArgumentRequiredWhat it does
logical1RequiredThe first test OR evaluates. Normally a comparison such as B2="Overdue" or C2>30, which resolves to TRUE or FALSE.
logical2, ... logical255OptionalFurther tests, up to 255 arguments in total. OR returns TRUE if any one of them is TRUE and FALSE only if all of them are FALSE.
value_if_trueOptionalWhat IF returns when OR is TRUE. Optional in the sense that Excel accepts an empty argument, but an empty one returns 0, so in practice always supply it. Text needs quotes.
value_if_falseOptionalWhat IF returns when every test failed. Leave it out and the cell shows the literal word FALSE on every non-matching row.

More worked examples

A support queue: column B holds priority, column C the plan, column D hours open. Escalate a ticket if any one of three things is true.

=IF(OR(B2="Critical", C2="Enterprise", D2>48), "Escalate", "Standard")

Returns: With B2 = Low, C2 = Enterprise and D2 = 6, the formula returns "Escalate". Only the plan test passed, and with OR that is enough.

Adding a fourth reason to escalate is one more argument, not a rewrite of the logic.

Shipping cost: free over 50, and also free for members. B2 holds the order total, C2 the customer type.

=IF(OR(B2>=50, C2="Member"), 0, 5.95)

Returns: B2 = 42 with C2 = Member returns 0. B2 = 42 with C2 = Guest returns 5.95.

Two figures that are supposed to be filled in, B2 and C2, are both left empty.

=IF(OR(B2>0, C2>0), "Has data", "Empty")

Returns: Returns "Empty". An empty cell is read as 0, and 0>0 is FALSE, so both tests fail.

That is the correct answer here, but the same behaviour means a blank cell can never trigger a >0 test, so genuinely missing data looks identical to a real zero.

Common mistakes

A bare cell reference to text gives #VALUE!
=IF(OR(B2, C2>30), "Follow up", "OK") returns #VALUE! when B2 contains the word Overdue, because OR cannot convert text into TRUE or FALSE. Write the comparison out: OR(B2="Overdue", C2>30).
An error in any argument wins, even one OR never needed
=IF(OR(B2="Overdue", C2/B2>1), ...) returns #DIV/0! when B2 is 0, even on a row where the first test was already TRUE. OR does not stop early. Guard the risky test with IFERROR, or split the logic into nested IFs so the division is only reached when it is safe.
Blanks silently take the false branch
A row where nobody has entered the data yet fails every comparison, so it is reported as OK rather than as incomplete. If missing data matters, test for it first: =IF(COUNTBLANK(B2:C2)>0, "Incomplete", IF(OR(B2="Overdue", C2>30), "Follow up", "OK")).
Listing values instead of comparisons
=IF(OR(B2="North", "West"), ...) is a common shorthand attempt and returns #VALUE!, because "West" on its own is text, not a test. Every argument needs its own comparison: OR(B2="North", B2="West").
Missing the fourth argument
=IF(OR(B2="Overdue", C2>30), "Follow up") prints the word FALSE in every row that does not match, which then breaks any COUNTIF or filter built on that column. Supply value_if_false explicitly, using "" if you want the cell to look empty.

Frequently Asked Questions

Related Tools