In Excel: combine IF and OR to return a result when at least one condition is true — =IF(OR(A1="Y",B1="Y"),"Yes","No") returns "Yes" if either cell contains "Y".
Formula: IF with OR
Identify which conditions, if any of them is true, should trigger the true-result.
Write =OR(condition1, condition2, …) and test it alone.
Wrap in IF: =IF(OR(condition1, condition2), value_if_true, value_if_false)
Press Enter and copy down.
To combine with AND: =IF(AND(A1>0, OR(B1="Yes", C1="Yes")), "Flag", "") requires A1>0 AND at least one of B1/C1 to match.
What this does
The IF/OR combination returns the true-value as soon as at least one of the listed conditions is met. OR() evaluates to TRUE if ANY of its arguments is true; wrapping it in IF() lets you act on that result. This is the Excel pattern for "any of the following" logic — flagging a record when it has at least one qualifying attribute, showing a discount when a customer OR their item belongs to a special category, or sending an alert when any column in a row meets a threshold. OR() accepts up to 255 arguments. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “if or formula”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. The point is a workflow that saves repeating the same clicks every week, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
Scenario: a survey response table uses columns A and B for two yes/no questions. You want to flag rows where at least one answer is "Y". Enter =IF(OR(A1="Y",B1="Y"),"Yes","No") in C1. If A1="Y" and B1="N", OR("Y"="Y","N"="Y") evaluates to TRUE (first argument is TRUE), so IF returns "Yes". If both are "N", OR evaluates to FALSE and IF returns "No". Copy down column C. To flag when all three columns match a value: replace OR with AND. Use IF/OR when any one of several conditions is sufficient to trigger the result. It is cleaner than chaining multiple nested IFs for the same purpose, and the intent is immediately readable: "if any of these, then this." Keep OR arguments to a manageable number (under 5–6) for maintainability; for more complex eligibility rules, consider a lookup table or a helper column. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “if or formula” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
Common mistakes
- Confusing
ORwithAND—ORneeds just one condition to be true;ANDneeds all. Choose based on whether the outcome requires any match or every match. - Nesting
ORinside anotherORinstead of adding arguments —OR(OR(A1="Y",B1="Y"),C1="Y")is equivalent toOR(A1="Y",B1="Y",C1="Y"); use the flat form. - Using
ORfor mutually exclusive conditions where nestedIFis clearer — if the conditions have different return values for each case, nestedIForIFS()is better than multipleORchecks.
Frequently asked questions
Can OR() handle more than two conditions?
Yes — OR() accepts up to 255 logical arguments. =IF(OR(A1="Y",B1="Y",C1="Y",D1="Y"),"Any Yes","All No") checks all four columns in one formula.
What happens when OR is used without IF?
OR() returns the text "TRUE" or "FALSE" in a cell. Use it inside IF to return a custom value instead, or use it in COUNTIF/SUMIF criteria arrays for conditional aggregates.
How do I combine IF, AND, and OR?
=IF(AND(A1>0, OR(B1="Yes", C1="Y")), "Approved", "Denied") is a typical combination — the outer IF acts on an AND of two sub-conditions, one of which is itself an OR. Build the inner AND/OR first, confirm it returns TRUE/FALSE correctly, then wrap in IF.
Other ways people ask this
This is also commonly searched as “excel if then or formula”, “if or excel function”, “excel formula if or then” and “if function or excel”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “excel if then or formula”, “if or excel function”, “excel formula if or then” all point at the one operation explained on this page, which is why they all lead here.