TGViewer
MS Excel for Data Analysis MS Excel for Data Analysis @excel_analyst ยท 73.2K subscribers
Post #2127 2.54K
๐Ÿš€ Excel Formulas Fundamentals โ€” Part 6

๐Ÿง  Logical Functions IF, AND, OR, IFERROR with Real-World Examples

Logical functions help Excel make decisions based on conditions.

๐Ÿ“Œ These functions are heavily used in:

Data Analysis

Finance

HR Reporting

Sales Dashboards

Business Rules

๐ŸŽฏ 1. IF Function

The IF function checks a condition and returns one value if TRUE and another if FALSE.

Syntax =IF(condition,value_if_true,value_if_false)

Example: Pass or Fail

Marks 75

Formula: =IF(A2>=50,"Pass","Fail")

Result: Pass

Business Example

Sales 120000

Formula: =IF(A2>=100000,"Target Achieved","Target Missed")

๐Ÿ”€ 2. Nested IF Function

Used when multiple conditions need to be checked.

Example: Student Grades

=IF(B2>=90,"A",IF(B2>=75,"B",IF(B2>=50,"C","Fail")))

Result

Marks Grade

95 A

80 B

60 C

40 Fail

๐Ÿ“Œ Useful for:

Employee ratings

Performance categories

Bonus calculations

๐Ÿ”— 3. AND Function

Returns TRUE only if ALL conditions are true.

Syntax =AND(condition1,condition2)

Example Student must pass both subjects.

=AND(A2>=50,B2>=50)

Combined with IF

=IF(AND(A2>=50,B2>=50),"Pass","Fail")

Example

Math Science Result

60 70 Pass

60 40 Fail

๐Ÿ”“ 4. OR Function

Returns TRUE if ANY condition is true.

Syntax =OR(condition1,condition2)

Example

=OR(A2>=90,B2>=90)

Combined with IF

=IF(OR(A2>=90,B2>=90),"Bonus Eligible","No Bonus")

Example

Product A Product B Bonus

95 40 Eligible

60 70 Not Eligible

โš ๏ธ 5. IFERROR Function

One of the most important Excel functions. Used to handle errors gracefully.

Without IFERROR

=A2/B2

If B2 is zero: #DIV/0!

With IFERROR

=IFERROR(A2/B2,"Invalid Data")

Result: Invalid Data

๐Ÿ“Œ Makes reports cleaner and more professional.

๐Ÿ” 6. Common Excel Errors

Error Meaning

DIV/0! Division by zero

N/A Value not found

VALUE! Wrong data type

REF! Invalid reference

NAME? Formula name error

Best Practice Wrap critical formulas with:

=IFERROR(formula,"Error")

๐Ÿ’ฐ 7. Real-World Scenario: Sales Bonus

Rule Sales โ‰ฅ โ‚น100,000 โ†’ Bonus, Otherwise โ†’ No Bonus

Formula: =IF(B2>=100000,"Bonus","No Bonus")

๐Ÿ‘จโ€๐Ÿ’ผ 8. Real-World Scenario: Employee Performance

Rule Score โ‰ฅ 90 โ†’ Excellent, Score โ‰ฅ 75 โ†’ Good, Score โ‰ฅ 50 โ†’ Average, Else โ†’ Needs Improvement

Formula: =IF(B2>=90,"Excellent",IF(B2>=75,"Good",IF(B2>=50,"Average","Needs Improvement")))

๐Ÿฆ 9. Real-World Scenario: Loan Eligibility

Conditions Salary โ‰ฅ โ‚น50,000, Experience โ‰ฅ 2 years

Formula: =IF(AND(B2>=50000,C2>=2),"Eligible","Not Eligible")

๐Ÿ›’ 10. Real-World Scenario: Discount Eligibility

Conditions Purchase Amount > โ‚น10,000 OR Premium Customer

Formula: =IF(OR(B2>10000,C2="Yes"),"Discount","No Discount")

๐ŸŽฏ Mini Practice Project

Create: Employee_Performance.xlsx

Data

Employee Score

Rahul 95

Priya 80

Amit 65

Neha 40

Tasks

โœ… Create Performance Rating

=IF(B2>=90,"Excellent",IF(B2>=75,"Good",IF(B2>=50,"Average","Poor")))

โœ… Create Bonus Eligibility

=IF(B2>=80,"Bonus","No Bonus")

โœ… Use IFERROR

=IFERROR(A2/B2,"Error")
  • โค 3
More from @excel_analyst
  1. Oct 13, 2026๐Ÿ“Š Excel Interview Questions โ€” Part 1 1๏ธโƒฃ What is the difference between VLOOKUP and XLOOKโ€ฆ
  2. Oct 13, 2026๐—ง๐—ข๐—ฃ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—ง๐—ข ๐—•๐—ข๐—ข๐—ฆ๐—ง ๐—ฌ๐—ข๐—จ๐—ฅ ๐—ฆ๐—ž๐—œ๐—Ÿ๐—Ÿ๐—ฆ ๐—œ๐—ก ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! Explorโ€ฆ
  3. Oct 12, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 7 This part focuses on Paste Special, Go To Special & Advanced Pโ€ฆ
  4. Oct 12, 2026๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ? Want to builโ€ฆ
  5. Oct 10, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 6 This part focuses on Worksheet & Sheet Management shortcuts โ€”โ€ฆ
  6. Oct 9, 2026Hey guys, Today, Iโ€™m covering some Excel interview questions that often pop up in data anaโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’