IF, AND, and OR Functions in Excel 2021: Easy Guide with Examples

Microsoft Excel is one of the most powerful tools for organizing and analyzing data. Among its most useful features are logical functions like IF, AND, and OR. These functions help Excel make decisions based on conditions you set.

If you want Excel to automatically return results based on certain rules, these functions are extremely helpful. In this beginner-friendly guide, you will learn how the IF, AND, and OR functions work in Excel 2021, including simple explanations and practical examples.

What is the IF Function in Excel?

The IF function allows Excel to perform a logical test and return one value if the condition is true and another value if it is false.

In simple terms, the IF function works like asking a question:

If something is true, do this. If not, do something else.

IF Function Syntax

=IF(logical_test, value_if_true, value_if_false)

Explanation:

  • logical_test – The condition you want to check
  • value_if_true – The result if the condition is true
  • value_if_false – The result if the condition is false

Example 1: Simple IF Function

Imagine you have a list of student scores, and you want Excel to determine if the student passed or failed.

StudentScoreResult
Anna85
Ben60
Carla45

If the passing score is 50, use this formula:

=IF(B2>=50,”Pass”,”Fail”)

How it works:

  • If the score in B2 is 50 or higher, Excel returns Pass
  • If the score is below 50, Excel returns Fail

Result:

StudentScoreResult
John85Pass
Ben60Pass
Carla45Fail

This is one of the most common uses of the IF function.

What is the AND Function in Excel?

The AND function checks multiple conditions and returns TRUE only if all conditions are true.

If even one condition is false, the result will be FALSE.

AND Function Syntax

=AND(condition1, condition2, …)

Example 2: Using AND Function

Suppose a company gives a bonus only if:

  • Sales are greater than 5000
  • Attendance is 100%
EmployeeSalesAttendanceBonus
Rose6000100%
Lisa4000100%
Mark700090%

Formula:

=AND(B2>5000,C2=”100%”)

Results:

EmployeeSalesAttendanceBonus
Rose6000100%TRUE
Lisa4000100%FALSE
Mark700090%FALSE

Only Rose meets both conditions.

What is the OR Function in Excel?

The OR function checks multiple conditions and returns TRUE if at least one condition is true.

Unlike AND, OR does not require all conditions to be true.

OR Function Syntax

=OR(condition1, condition2, …)

Example 3: Using OR Function

Suppose students pass if they score 50 or higher in Math OR English.

StudentMathEnglishPass
Alex4560
Mia5540
Sam3035

Formula:

=OR(B2>=50,C2>=50)

Results:

StudentMathEnglishPass
Alex4560TRUE
Mia5540TRUE
Sam3035FALSE

Students pass if either subject meets the requirement.

Combining IF with AND and OR

The real power of Excel comes when you combine these functions together.

Example 4: IF + AND Function

A student passes only if:

  • Score is 50 or higher
  • Attendance is 80% or higher
StudentScoreAttendanceResult
Jake7590%
Ella6570%
Tom4585%

Formula:

=IF(AND(B2>=50,C2>=80),”Pass”,”Fail”)

Explanation:

  • If both conditions are true, Excel returns Pass
  • If one condition fails, Excel returns Fail

Results:

StudentScoreAttendanceResult
Jake7590%Pass
Ella6570%Fail
Tom4585%Fail

Example 5: IF + OR Function

Suppose employees receive a reward if they:

  • Achieve sales above 10,000, OR
  • Have 5 years of experience
EmployeeSalesExperienceReward
Ana120002
Ben80006
Carl70002

Formula:

=IF(OR(B2>10000,C2>=5),”Reward”,”No Reward”)

Results:

EmployeeSalesExperienceReward
Ana120002Reward
Ben80006Reward
Carl70002No Reward

Real-Life Uses of IF, AND, and OR in Excel

These functions are widely used in many situations, including:

  • Student Grading: Teachers can automatically determine pass or fail results.
  • Employee Performance Evaluation: Companies can evaluate staff based on sales targets and attendance.
  • Budget Tracking: You can check whether expenses exceed a certain amount.
  • Inventory Management: Businesses can determine when stock is low.
  • Data Validation: Excel can automatically check if multiple conditions are met before showing a result.

Tips for Using IF, AND, and OR in Excel

1. Always Check Your Parentheses

Logical formulas require proper parentheses to work correctly.

Example:

=IF(AND(A1>10,B1<20),”Yes”,”No”)

2. Use Quotes for Text Results

Example:

=IF(A1>50,”Passed”,”Failed”)

3. Test Your Logical Conditions

Make sure your condition actually returns TRUE or FALSE.

Common Mistakes to Avoid

Missing Quotation Marks

Incorrect:

=IF(A1>50,Pass,Fail)

Correct:

=IF(A1>50,”Pass”,”Fail”)

Incorrect Condition Placement

Wrong:

=IF(A1>50 AND B1>50,”Pass”,”Fail”)

Correct:

=IF(AND(A1>50,B1>50),”Pass”,”Fail”)

Final Thoughts

The IF, AND, and OR functions in Excel 2021 are essential tools for creating logical formulas and automating decisions in spreadsheets. Once you understand how these functions work, you can analyze data faster and reduce manual work.

  • IF helps Excel make decisions.
  • AND checks if all conditions are true.
  • OR checks if any condition is true.

By combining these functions, you can create powerful formulas that automatically process information based on your rules.

Whether you’re managing grades, tracking sales, or analyzing business data, mastering these logical functions will make your Excel skills much stronger.

Read: Microsoft Excel Free Course

Something to clarify? Write it below