Excel - Finding nth largest value with duplicate data

别等时光非礼了梦想. 提交于 2019-12-12 03:59:10

问题


I have a the following table, it has more columns and is 40 rows long but this is an example of the data. The table is sorted by Team #

Data Table

I am trying to create a 2nd table that shows the top 10 teams that delivered gears. I want to do this for the other columns as well. I am trying to do this without VBA.
I used this function and it worked well:

=INDEX(TT_Team,MATCH(LARGE(TT_Tele_Gears,$A3),TT_Tele_Gears,0))

The problem is the duplicate data for the amount of gears delivered IF two teams have delivered the same number of gears I want to show them both, but do not care about which is #1 or #2 Currently I get this:

Top 10 Table

Any ideas on a fix ?

Thanks in Advance


回答1:


You could try a solution like this:

The formula in F2 copied down is just:

=LARGE(B$2:B$12,D2)

and in E2 as shown it's this:

=INDEX(A$2:A$12,LARGE(IF(B$2:B$12=F2,ROW(B$2:B$12)-ROW(B$2)+1),COUNTIF(F2:F$6,F2)))

confirm with CTRL+SHIFT+ENTER and copy down

It's the COUNTIF part at the end that makes the difference. This is counting from the current row, so for duplicates as you go down the column the COUNTIF value changes, so you get each duplicate



来源:https://stackoverflow.com/questions/42882196/excel-finding-nth-largest-value-with-duplicate-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!