Top 5 using range in column A that matches values range of column B

前端 未结 2 479
醉话见心
醉话见心 2021-01-17 05:33
[A]  [B]  [C]  [D]  [E]
ABC  DFC  20
DE   DE   12
     GF   11
     ABC  19
     DE   17
     DE   15
     XE   14
     ABC  10

I would like to put

2条回答
  •  猫巷女王i
    2021-01-17 06:36

    The newer AGGREGATE function can help retrieve the appropriate values as well as passing their associated row numbers to an INDEX function to retrieve the names.

    In E2:F2 as standard formulas,

    =INDEX(B:B, AGGREGATE(15, 6, ROW(B$1:INDEX(B:B, MATCH(1E+99, C:C)))/(C$1:INDEX(C:C, MATCH(1E+99, C:C))=F2), COUNTIF(F$2:F2, F2)))
    =AGGREGATE(14, 6, C$2:INDEX(C:C, MATCH(1E+99,C:C ))/ISNUMBER(MATCH(B$2:INDEX(B:B, MATCH(1E+99, C:C)), A$2:INDEX(A:A, MATCH("zzz", A:A)), 0)), ROW(1:1))
    

    Fill down for four more rows.

            

    Note that I've changed one of your values to demonstrate how duplicates are handled.

提交回复
热议问题