SpreadsheetFormulas
intermediateIFANDOR

Combine AND with OR in a Single IF Formula

Your ticket queue rule isn't a simple either/or: a ticket needs review when it's still Open AND it's either been sitting more than 30 days OR it's marked High priority. Closed tickets never qualify, however old.

Quick formula
=IF(AND(A2="Open",OR(B2>30,C2="High")),"Review","OK")
Sample input
1StatusDays OpenPriority
2Open45Low
3Open10High
4Closed60High
Result
1StatusDays OpenAction
2Open45Review
3Open10Review
4Closed60OK

Excel & Google Sheets

=IF(AND(A2="Open",OR(B2>30,C2="High")),"Review","OK")

This formula works in both Excel and Google Sheets.

How it works

Read it from the inside out. OR(B2>30,C2="High") is the "either" part — aging or urgent, one is enough. That whole result becomes the second condition of AND, so the row must be Open and pass the OR. A Closed ticket fails AND immediately, no matter how old or urgent; a fresh Low-priority Open ticket fails the OR and stays OK. The structure mirrors the sentence: AND for the parts joined by "and," OR wrapped around the parts joined by "or." Write the rule in plain English first, then translate each connector.

A2="Open"
The must-have condition. Anything not Open is OK regardless of the rest.
OR(B2>30,C2="High")
The either/or group: more than 30 days old, or High priority — one suffices.
AND(…,…)
Requires the must-have AND the either/or group to both pass before Review fires.

When to use it

Use it for layered business rules: review open tickets that are old or urgent, chase unpaid invoices that are large or overdue, audit active vendors that are new or flagged.

Common mistakes

  • Flattening everything into one AND.

    AND(A2="Open",B2>30,C2="High") demands old AND urgent, so a 45-day Low ticket slips through. The either/or pair must sit inside its own OR.

  • Putting AND inside OR instead.

    OR(A2="Open",AND(B2>30,C2="High")) reviews every Open ticket and even some Closed ones. Match the nesting to the sentence: (Open) AND (old OR urgent).

  • Status text doesn't match the data.

    A2="Open" won't match "Open " with a trailing space or "Re-opened". Check the actual values, and TRIM the column if exports add spaces.

Did this formula help?

Engine-verified against the sample data aboveDownload the proof sheet (.xlsx)Last reviewed 2026-07-09