如何在Excel中打印区域中的前3名员工? [英] How to print top 3 employees in a region in excel?
问题描述
我有一张表,该表包含三列,区域,emp_name,薪水.
I have a table with three columns, region, emp_name, salaries.
我想在excel中向该表再添加一列.
I want to add one more column to this table in excel.
该新列应为1或0.1表示基于特定区域的薪水排名前三位的员工之一.
That new column should have either 1 or 0. 1 indicates one of the top3 employee based on salaries in a particular region.
例如,Region1有7个雇员,即emp1,emp2,以此类推,例如emp7. emp2,emp4,emp7的薪水排名前三.
For example, Region1 has 7 employees, namely emp1, emp2, so on emp7. emp2, emp4, emp7 have top 3 salaries.
因此,在新列中,emp2,emp4,emp7必须具有1,其他必须具有0.假设此表包含n个区域.
So in the new column, emp2, emp4, emp7 must have 1 and others have 0. Let's say this table contains n number of regions.
推荐答案
将此内容放入D2并复制下来:
Put this in D2 and copy down:
=IF(C2>=AGGREGATE(14,7,$C$2:$C$1000/($A$2:$A$1000=A2),MIN(COUNTIF(A:A,A2),3)),1,0)
这篇关于如何在Excel中打印区域中的前3名员工?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!