TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #3010 5.31K
๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:
You have 2 minutes to solve this Excel problem.

You have the following data:

Employee Department Salary

John IT 75,000
Sarah HR 60,000
Mike IT 82,000
David Finance 90,000
Alice HR 65,000


Find the employees whose salary is above the average salary of their department.

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

=C2>AVERAGEIF(B2:B6,B2,C2:C6)


๐Ÿ’ก Explanation:

The formula compares each employee's salary with the average salary of their own department.

โ€ข AVERAGEIF() calculates the average salary for the employee's department.
โ€ข B2 identifies the current employee's department.
โ€ข C2 is the employee's salary.

The formula returns TRUE when the employee earns more than their department average.


๐ŸŽฏ Expected Output Example

Employee Department Salary Above Dept. Average?

John IT 75,000 FALSE
Sarah HR 60,000 FALSE
Mike IT 82,000 TRUE
David Finance 90,000 FALSE
Alice HR 65,000 TRUE


๐Ÿš€ Bonus โ€” Return the Employee Name Only

In Excel 365:

=FILTER(
A2:A6,
C2:C6>AVERAGEIF(B2:B6,B2:B6,C2:C6)
)

This returns the employees whose salaries are above their respective department averages.


โค๏ธ React with โค๏ธ for more Excel interview challenges!
  • โค 24
More from @sqlspecialist
  1. Oct 7, 2026๐Ÿ“Š Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts The new Kandinsky 6.0 Vidโ€ฆ
  2. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions suchโ€ฆ
  3. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 5 Guys, let's continue our Data Analyst Interviewโ€ฆ
  4. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  5. Oct 7, 2026๐Ÿ”Ÿ What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns frโ€ฆ
  6. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 4 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 โ†’