IF, AND & OR Function in Excel: Complete Tutorial with Examples

IF, AND & OR functions test multiple conditions simultaneously. Check if all requirements are met with AND, or any requirement with OR.

Need to test multiple conditions at once? Combining IF with AND or OR lets you build complex logic in a single formula. Check if all conditions are true with AND, or if any condition is true with OR.

What Makes IF, AND & OR Useful

These combinations handle real-world complexity:

  • Multiple requirements – Test several conditions simultaneously
  • Flexible logic – Use AND for “all must be true” or OR for “any can be true”
  • Complex decisions – Handle scenarios basic IF can’t solve
  • Business rules – Implement approval workflows, eligibility checks, or validation
  • Data quality – Flag records that meet (or fail) multiple criteria
The Core Functions

AND Syntax:

=AND(logical1, [logical2], ...)

Returns TRUE only if all conditions are true.

OR Syntax:

=OR(logical1, [logical2], ...)

Returns TRUE if any condition is true.

Combined with IF:

=IF(AND(...), value_if_true, value_if_false)
=IF(OR(...), value_if_true, value_if_false)

Example 1: Loan Approval with AND

Approve loans only if credit score is 700+ AND income is $50,000+:

Formula: =IF(AND(B2>=700, C2>=50000), "Approved", "Denied")

Result in D2: Approved

Alice and David meet both requirements. Bob and Carol fail one condition each, so they’re denied.


Example 2: Discount Eligibility with OR

Give discount if customer is VIP OR order exceeds $500:

Formula: =IF(OR(B2="VIP", C2>500), "Yes", "No")

Result in D2: Yes

John and Lisa get discounts (VIP status). Sarah gets one (order over $500). Mike gets neither.


Example 3: Performance Rating with AND

Rate “Excellent” if sales exceed $100K AND customer satisfaction is above 90%:

Formula: =IF(AND(B2>100000, C2>0.9), "Excellent", "Good")

Result in D2: Excellent

Tom and Sophie meet both criteria. Emma and Jack miss one requirement each.


Example 4: Alert System with OR

Flag orders that are overdue OR exceed $10,000:

Formula: =IF(OR(C2>0, B2>10000), "FLAG", "OK")

Result in D2: FLAG

Orders 001, 002, and 004 get flagged. Order 003 is fine.


Example 5: Combining AND with OR

Approve if (credit score 700+ AND income $50K+) OR existing customer:

Formula: =IF(OR(AND(B2>=700, C2>=50000), D2="Yes"), "Approved", "Denied")

Result in D2: Approved

Alice and Carol are approved (existing customers). Bob is approved (meets credit and income). Complex but powerful.


Example 6: Grade Assignment with Multiple ANDs

Assign letter grades based on multiple test scores:

Formula: =IF(AND(B2>=90, C2>=90), "A", IF(AND(B2>=80, C2>=80), "B", "C"))

Result in D2: B

Maya gets A (both 90+). Alex gets B (both 80+). Chris gets C (below 80 on one test).


Logic Comparison
Common Patterns

All conditions required:

=IF(AND(A2>100, B2="Yes", C2<50), "Pass", "Fail")

Any condition sufficient:

=IF(OR(A2>100, B2="Yes", C2<50), "Pass", "Fail")

Mixing AND with OR:

=IF(OR(AND(A2>100, B2="Yes"), C2<50), "Pass", "Fail")
Tips for Complex Logic

Keep It Readable

  • Break complex formulas across multiple cells if needed
  • Use helper columns for intermediate calculations
  • Comment your logic in nearby cells

Test Each Part

  • Write AND or OR alone first to see TRUE/FALSE
  • Then wrap it in IF once you’re confident
  • Check edge cases

Mind the Parentheses

  • AND and OR need their own parentheses
  • IF needs its own parentheses
  • One missing parenthesis breaks everything
Common Mistakes to Avoid

Wrong Syntax

  • =IF(AND(A2>50 AND B2<100), ...) is wrong
  • =IF(AND(A2>50, B2<100), ...) is correct
  • Use commas, not AND/OR words inside the function

Too Many Nested IFs

  • More than 3 levels gets confusing
  • Consider IFS function instead
  • Or use lookup tables

Forgetting Quotes

  • Text needs quotes: B2="Yes"
  • Numbers don’t: A2>100
Start Using It

Find data with multiple criteria. Think about what combinations matter. Start with simple AND or OR, then wrap it in IF. Test with a few rows before copying down.

These combinations turn Excel into a decision engine.


Questions about IF, AND & OR? Need help with complex nested logic? Let’s connect.