TGViewer
Data Analytics Data Analytics @sqlspecialist · 111K subscribers
Post #3034 3.58K
This is extremely useful for business analysis.

1️⃣8️⃣ Understand IF vs IF Functions

This distinction is important.

IF()

Used to make a decision.

Example: =IF(C2>=50000,"High","Low")

SUMIF()

Used to calculate a sum based on a condition.

Example: =SUMIF(B2:B100,"IT",C2:C100)

COUNTIF()

Used to count records based on a condition.

Example: =COUNTIF(B2:B100,"IT")

AVERAGEIF()

Used to calculate an average based on a condition.

Example: =AVERAGEIF(B2:B100,"IT",C2:C100)

Think:

IF → Decision

SUMIF → Conditional Total

COUNTIF → Conditional Count

AVERAGEIF → Conditional Average

🧪 Practical Interview Challenge

Suppose you have:

Employee | Department | Salary

John | IT | 75,000

Sarah | HR | 60,000

Mike | IT | 82,000

David | Finance | 90,000

Alice | HR | 65,000

Your interviewer asks:

Q1. Is John earning more than ₹70,000?

=IF(C2>70000,"Yes","No")

Q2. How many employees are in IT?

=COUNTIF(B2:B6,"IT")

Q3. What is the total IT salary?

=SUMIF(B2:B6,"IT",C2:C6)

Q4. What is the average IT salary?

=AVERAGEIF(B2:B6,"IT",C2:C6)

Q5. How many IT employees earn more than ₹80,000?

=COUNTIFS(B2:B6,"IT",C2:C6,">80000")

Q6. What is the total salary of IT employees earning more than ₹70,000?

=SUMIFS(C2:C6,B2:B6,"IT",C2:C6,">70000")

🏆 Key Lesson

Understand the question first.

"Should I classify this record?"

→ IF()

"How much in total?"

→ SUMIF() / SUMIFS()

"How many?"

→ COUNTIF() / COUNTIFS()

"What's the average?"

→ AVERAGEIF() / AVERAGEIFS()

One condition?

→ IF version

Multiple conditions?

→ IFS version

Double Tap ❤️ For Part-5
  • ❤ 13
  • 👍 1
More from @sqlspecialist
  1. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  2. Oct 7, 2026🔟 What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns fr…
  3. Oct 7, 2026📊 Data Analyst Interview Series — Part 4 Guys, let's continue our Data Analyst Interview…
  4. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  5. Oct 4, 20269️⃣ How would you calculate month-over-month growth? Sample Answer: “I would first retriev…
  6. Oct 4, 2026📊 Data Analyst Interview Series — Part 3 Guys, let's continue our Data Analyst Interview…
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 →