Excel Logical Functions

Logical functions in Excel — AND, OR, and NOT — are used to test multiple conditions at once. On their own, they return TRUE or FALSE. But their real power comes when they are combined with the IF function to create more sophisticated decision-making formulas.

The AND Function

What It Does

The AND function returns TRUE only when all of its conditions are met. If even one condition is FALSE, the entire result is FALSE.

Syntax

  =AND(condition1, condition2, ...)

Example 1: Standalone AND

  Cell A2: 75 (score)
  Cell B2: 85 (attendance %)

  =AND(A2>=60, B2>=80)

  → A2>=60 → TRUE (75 ≥ 60)
  → B2>=80 → TRUE (85 ≥ 80)
  → Both are TRUE → Result: TRUE

Example 2: AND inside IF

  A student must score ≥ 60 AND have attendance ≥ 80% to pass.

  Formula: =IF(AND(A2>=60, B2>=80), "Pass", "Fail")

  A2=75, B2=85 → "Pass"  (both conditions met)
  A2=75, B2=70 → "Fail"  (attendance condition fails)
  A2=40, B2=85 → "Fail"  (score condition fails)

Real-World Use

A loan approval system might use AND to check whether an applicant's income is above a threshold AND their credit score is above a minimum — both must be true for approval.

The OR Function

What It Does

The OR function returns TRUE when at least one of its conditions is met. It only returns FALSE when all conditions are FALSE.

Syntax

  =OR(condition1, condition2, ...)

Example 1: Standalone OR

  Cell C2: "Manager"  (job title)
  Cell D2: 8           (years of experience)

  =OR(C2="Manager", D2>=5)

  → C2="Manager" → TRUE
  → D2>=5 → TRUE (8 ≥ 5)
  → At least one is TRUE → Result: TRUE

Example 2: OR inside IF

  An employee qualifies for a senior badge if:
  - they are a Manager, OR
  - they have 5+ years of experience

  Formula: =IF(OR(C2="Manager", D2>=5), "Senior", "Junior")

  C2="Manager", D2=3 → "Senior"  (Manager condition is true)
  C2="Analyst",  D2=6 → "Senior"  (Experience condition is true)
  C2="Analyst",  D2=2 → "Junior"  (Neither condition is true)

Real-World Use

A discount program might offer a special price if the customer is either a returning customer OR a student. Only one of these needs to be true to qualify.

The NOT Function

What It Does

The NOT function reverses a logical value. If a condition is TRUE, NOT returns FALSE. If a condition is FALSE, NOT returns TRUE.

Syntax

  =NOT(condition)

Example 1: Standalone NOT

  Cell E2: "Inactive"  (account status)

  =NOT(E2="Inactive")

  → E2="Inactive" → TRUE
  → NOT(TRUE) → Result: FALSE

Example 2: NOT inside IF

  Flag accounts that are NOT "Active" for review.

  Formula: =IF(NOT(E2="Active"), "Review Required", "OK")

  E2="Active"   → "OK"
  E2="Inactive" → "Review Required"
  E2="Pending"  → "Review Required"

Combining AND, OR, and NOT

These functions can be combined with each other and with IF to handle complex business logic.

Example: Promotion Eligibility

  An employee is eligible for promotion if:
  - Score >= 80, AND
  - Years of service >= 3, AND
  - Status is NOT "On Probation"

  Cells:
  F2 = Score
  G2 = Years of service
  H2 = Status

  Formula:
  =IF(AND(F2>=80, G2>=3, NOT(H2="On Probation")), "Eligible", "Not Eligible")

  F2=85, G2=4, H2="Active" → "Eligible"
  F2=85, G2=4, H2="On Probation" → "Not Eligible"
  F2=70, G2=5, H2="Active" → "Not Eligible" (score too low)

Example: Discount Logic

  A customer gets a 15% discount if:
  - They are a member (column A = "Yes"), OR
  - Their purchase total (column B) is >= 1000

  Formula: =IF(OR(A2="Yes", B2>=1000), B2*85%, B2)

  A2="Yes", B2=500 → 500 × 85% = 425   (member discount applied)
  A2="No",  B2=1200→ 1200 × 85% = 1020 (high purchase discount)
  A2="No",  B2=300 → 300              (no discount)

Quick Reference

  Function | Returns TRUE when...
  ---------|--------------------------------------------------
  AND      | ALL conditions are TRUE
  OR       | AT LEAST ONE condition is TRUE
  NOT      | The condition is FALSE (reverses the result)

Summary

  • AND returns TRUE only when every condition is met.
  • OR returns TRUE when at least one condition is met.
  • NOT reverses a logical result — TRUE becomes FALSE, and FALSE becomes TRUE.
  • These functions are most useful when combined with IF to build multi-condition decision formulas.
  • Multiple AND, OR, and NOT functions can be combined inside a single IF formula to handle complex rules.

Leave a Comment

Your email address will not be published. Required fields are marked *