๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐๐ฒ๐ฟ:
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!
Post #3010
5.31K
- โค 24