FORMULAS & FUNCTIONS

How to Build an IF Formula with AND and OR in Excel

Build an Excel IF formula with AND and OR to test multiple conditions, return clear outcomes, and avoid unnecessary nested formulas.

← Tutorial HubFormulas & Functions

Core outcome: Show readers how to combine IF with AND and OR to test multiple business conditions without creating confusing nested formulas.

Excel IF with AND and OR hero showing Amount, Status, Approval, exact formulas, and the resulting Review, No review, Action needed, and Monitor labels

Decide whether the rule needs AND or OR

Before writing an IF formula, translate the business rule into plain language. Use AND when every condition must be true. Use OR when any one of several conditions is enough to trigger the result. The IF function then turns that TRUE or FALSE test into the label or value you want to return.

Assume Amount is in B2, Status is in C2, and Approval is in D2. If a record should be reviewed only when the amount is at least 1,000 and the status is Open, use:

=IF(AND(B2>=1000,C2="Open"),"Review","No review")

If action is needed when the status is Overdue or the approval is Escalated, use:

=IF(OR(C2="Overdue",D2="Escalated"),"Action needed","Monitor")
Excel IF formula support visual showing exact IF with AND and IF with OR formulas and when each logical function returns true

Read the formula from the inside out

In the first formula, Excel evaluates AND(B2>=1000,C2="Open") first. AND returns TRUE only when both tests are true. IF sees that TRUE result and returns Review. If either test is false, AND returns FALSE and IF returns No review.

The OR formula works differently. OR(C2="Overdue",D2="Escalated") returns TRUE when either test is true, including when both are true. IF then returns Action needed.

Condition ACondition BANDOR
TRUETRUETRUETRUE
TRUEFALSEFALSETRUE
FALSETRUEFALSETRUE
FALSEFALSEFALSEFALSE

Worked example with real outcomes

Consider four records:

AmountStatusApprovalAND resultOR result
1,250OpenNormalReviewMonitor
800OpenEscalatedNo reviewAction needed
1,500OverdueNormalNo reviewAction needed
600ClosedNormalNo reviewMonitor

The first row meets both AND conditions because 1,250 is at least 1,000 and Status is Open. The second row fails the amount test, so AND returns No review, but Approval is Escalated, so OR returns Action needed. The third row has a large amount but Status is Overdue rather than Open; it fails the AND rule but satisfies the OR rule.

Excel table showing Amount, Status, Approval, AND Result, and OR Result with consistent Review and Action needed outcomes

Combine AND and OR when the rule has two levels

Some business rules contain both required conditions and acceptable alternatives. For example: review the record when Amount is at least 1,000 and the Status is either Open or Overdue.

=IF(AND(B2>=1000,OR(C2="Open",C2="Overdue")),"Review","No review")

Here, OR handles the acceptable status alternatives, while AND requires both the amount threshold and one of those statuses. Parentheses show which tests belong together, so build and test the inner logical functions before adding IF.

Put thresholds and labels in cells when they may change

Hard-coding 1000 is fine for a fixed example, but a real workbook is easier to maintain when changeable thresholds live in labeled setup cells. If the review threshold is in H2, use an absolute reference when copying the formula:

=IF(AND(B2>=$H$2,C2="Open"),"Review","No review")

This makes the rule visible to users and avoids editing dozens of formulas when the threshold changes.

Handle blanks deliberately

A formula can classify an incomplete row unless you tell it what to do with missing inputs. If Amount and Status are required before the rule should run, add a blank check first:

=IF(OR(B2="",C2=""),"",IF(AND(B2>=1000,C2="Open"),"Review","No review"))

The outer IF leaves the result blank until both required inputs exist. Whether that is the right behavior depends on the workbook, but the decision should be explicit rather than accidental.

Watch for text inconsistencies

Logical formulas depend on the values they receive. A status list that contains Open, OPEN, trailing spaces, or misspellings can produce unexpected results. Data Validation is a good way to keep status and approval values consistent. If imported text may contain extra spaces, clean it before relying on the logical test.

Common IF, AND, and OR mistakes

MistakeWhy it matters
Using AND for acceptable alternativesThe formula becomes too strict because every alternative would need to be true.
Using OR when all requirements are mandatoryRecords can pass after meeting only one condition.
Building a long formula before testing each testIt becomes harder to find which condition is wrong.
Ignoring blanksIncomplete records can receive a real classification.
Hard-coding changeable thresholds everywhereFuture rule changes require editing many formulas.
Returning inconsistent labelsFiltering and summary reports become harder to maintain.

Test the rule at the boundaries

Do not test only obvious examples. For the 1,000 threshold, test 999, 1,000, and 1,001. Test a blank Amount, a blank Status, one row where only the first AND condition is true, and one row where only the second OR condition is true. This confirms that the comparison operators and logical grouping match the written rule.

Excel IF AND OR formula QA checklist covering the 1000 boundary, blanks, status spelling, AND-false, and OR-true test cases

Frequently asked questions

Can AND and OR be used in the same IF formula?

Yes. Nest them according to the business rule. Use parentheses to make the required groups clear and test the inner logical functions independently.

Should I use nested IF instead?

Use nested IF only when the result genuinely depends on several ordered decisions. For one TRUE/FALSE rule with several conditions, IF combined with AND or OR is usually easier to audit.

Why does a text condition appear to fail?

Check the actual source value for misspellings, extra spaces, and formulas returning empty strings. A controlled drop-down can prevent many status-text problems.

Can the formula return numbers instead of labels?

Yes. The value-if-true and value-if-false arguments can return numbers, cell references, calculations, dates, or text, depending on the result your workbook needs.

Continue building reliable Excel workflows

Browse more lessons in the OneXcel Tutorial Hub or explore free Excel resources.

Discover more from OneXcel Studio

Subscribe now to keep reading and get access to the full archive.

Continue reading