In Excel: use =OR(A2>100, B2="urgent") when ANY condition being true is enough, and =AND(A2>100, B2="urgent") when ALL of them must be true — both usually sit inside an IF.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
logical1 | required | The first condition to test. Anything that evaluates to TRUE or FALSE. |
logical2 … | optional | Further conditions, up to 255. OR is TRUE when any one is TRUE; AND is TRUE only when all are. |
Related functions
Decide the rule first: "any of these" is OR, "all of these" is AND.
Write the conditions as separate arguments — =OR(A2>100, B2="urgent") — not as one string.
Wrap the result in IF to return something useful: =IF(OR(…), "yes", "no").
Nest them freely; AND inside OR and OR inside AND are both legal and are how compound rules are expressed.
Use =NOT(…) to invert a verdict rather than rewriting every comparison.
In conditional formatting, put the whole OR/AND expression in the formula box — it already returns TRUE or FALSE, so no IF is needed.
What this does
OR and AND take the same arguments and differ only in the rule they apply. OR returns TRUE when at least one condition holds; AND returns TRUE only when every one does. On their own they return the bare words TRUE or FALSE, which is rarely the point — they are almost always the first argument of an IF, which turns that verdict into a useful result: =IF(AND(…), "Approved", "Review"). Both accept up to 255 conditions. Two extra facts matter in practice. NOT(x) flips a result, so =IF(NOT(OR(…)), …) reads as "if none of these". And multiplying conditions does the same job inside array formulas, where (A2:A100="North")*(B2:B100>500) behaves as AND and adding them behaves as OR. 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. For “use the or function in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
An order is flagged when it is either large or marked urgent: =IF(OR(C2>1000, D2="urgent"), "Flag", "") — a €1,200 standard order and a €40 urgent order both get flagged. Approval instead needs both conditions: =IF(AND(C2>1000, D2="urgent"), "Approve", "Review") flags only the order that is large AND urgent. Nesting them expresses "urgent, and either large or from a key account": =IF(AND(D2="urgent", OR(C2>1000, E2="key")), "Approve", "Review"). Every business rule more complicated than a single comparison is built from "all of these" and "any of these", and OR and AND are how you write that down in a way the next person can check. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
The standard worksheet functions used by this example are listed in Google Sheets. Check the cell references, argument separators and input types in the target spreadsheet, then compare the worked result. This formula-availability check does not establish identical menus, keyboard shortcuts or workbook features, and it is not a product execution test. 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 and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “use the or function in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Writing
=IF(A2>100 OR B2="urgent", …)as ifORwere an operator; in Excel it is a function that takes the conditions as arguments. - Reaching for
ORwhen the rule is really "all of these", which lets a single condition wave everything through. - Comparing text with = and forgetting it is case-insensitive — use EXACT inside the condition when case matters.
- Using
ORacross a range,=OR(A2:A100>100), and expecting one answer per row; it returns a single TRUE for the whole range. - Leaving a bare
=AND(…)in a report cell, which shows TRUE or FALSE where a reader expects a label.
Frequently asked questions
What is the difference between OR and AND in Excel?
OR returns TRUE when at least one condition is true. AND returns TRUE only when every condition is true. They take exactly the same arguments.
How do I use OR inside an IF?
Put it in the first argument: =IF(OR(A2>100, B2="urgent"), "Flag", ""). The IF turns the TRUE/FALSE verdict into the text or number you actually want.
Can I combine OR and AND?
Yes, nest them: =IF(AND(D2="urgent", OR(C2>1000, E2="key")), "Approve", "Review") means urgent, and either large or a key account.
How many conditions can they take?
Up to 255 each. Beyond a handful, a helper column or a lookup table is usually easier to read and to audit than one long formula.
Other ways people ask this
This is also commonly searched as “excel or function”, “or functions in excel”, “excel functions or” and “excel function or”. 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 or function”, “or functions in excel”, “excel functions or” all point at the one operation explained on this page, which is why they all lead here.