TGViewer
MS Excel for Data Analysis MS Excel for Data Analysis @excel_analyst ยท 73.1K subscribers
Post #2231 3.13K
๐Ÿ“Š Excel Basics #15 โ€“ IF() Function

The "IF()" function is one of the most powerful and widely used functions in Excel. It allows Excel to make decisions based on a condition.

๐Ÿ“Œ What is the IF() Function?

The "IF()" function checks whether a condition is TRUE or FALSE and returns different results for each case.

Syntax:

=IF(logical_test, value_if_true, value_if_false)

๐Ÿ“Œ Example 1 โ€“ Pass or Fail

Student Marks

Rahul 85

Priya 42

Amit 67

Neha 30

Formula:

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

Result:

โ€ข Rahul โ†’ Pass

โ€ข Priya โ†’ Fail

โ€ข Amit โ†’ Pass

โ€ข Neha โ†’ Fail

๐Ÿ“Œ Example 2 โ€“ Bonus Eligibility

Employee Sales

Rahul 120000

Priya 85000

Formula:

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

โ€ข Rahul โ†’ Bonus

โ€ข Priya โ†’ No Bonus

๐Ÿ“Œ Example 3 โ€“ Discount Calculation

=IF(A2>=5000,A2*10%,0)

If the purchase amount is โ‚น5,000 or more, the customer receives a 10% discount; otherwise, the discount is โ‚น0.

๐Ÿ“Œ Nested IF()

You can use multiple "IF()" functions to test several conditions.

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

โ€ข 90 or above โ†’ A

โ€ข 75โ€“89 โ†’ B

โ€ข 50โ€“74 โ†’ C

โ€ข Below 50 โ†’ Fail

๐Ÿ“Œ Real-World Uses

โ€ข Calculate pass/fail status.

โ€ข Determine bonus eligibility.

โ€ข Assign grades.

โ€ข Check stock availability.

โ€ข Flag overdue payments.

โ€ข Categorize sales performance.

๐Ÿ“Œ Common Mistakes

โ€ข Missing commas between arguments.

โ€ข Forgetting quotation marks around text values.

โ€ข Using too many nested "IF()" functions, making formulas difficult to maintain.

โœ… Best Practices

โ€ข Keep "IF()" formulas simple whenever possible.

โ€ข Use descriptive text like "Pass" or "Approved" instead of numbers when appropriate.

โ€ข For multiple conditions, consider using "IFS()" or "SWITCH()" (available in newer versions of Excel).

โ€ข Test your formula with different inputs to ensure it works correctly.

The "IF()" function is the foundation of decision-making in Excel and is used extensively in dashboards, financial models, and business reports.

Double Tap โค๏ธ For More
  • โค 14
More from @excel_analyst
  1. Oct 9, 2026๐Ÿ‡ฎ๐Ÿ‡ณ ๐—š๐—ข๐—ฉ๐—˜๐—ฅ๐—ก๐— ๐—˜๐—ก๐—ง ๐—ข๐—™ ๐—œ๐—ก๐——๐—œ๐—” โ€” ๐—”๐—œ๐—–๐—ง๐—˜ ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ก๐—ฆ๐—›๐—œ๐—ฃ๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€โ€ฆ
  2. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  3. Oct 7, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 5 This part focuses on Tables, Filters & Data Analysis shortcutsโ€ฆ
  4. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  5. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  6. Sep 29, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 3 This part focuses on Formatting Shortcuts โ€” quickly format celโ€ฆ
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 โ†’