简体   繁体   English

在 VLOOKUP 中给出满足条件的 3 个最大值旁边的单元格值的公式

[英]Formula to give the value of the cell next to the 3 largest values that meet a criteria in VLOOKUP

I am creating a spreadsheet that is using VLOOKUP to give a bunch of data based on a dropdown box.我正在创建一个电子表格,该电子表格使用 VLOOKUP 根据下拉框提供一堆数据。

It is a fairly large list (the screenshot does not do it justice), and the data is part of a table that has new lines added regularly.它是一个相当大的列表(屏幕截图并不公平),并且数据是定期添加新行的表的一部分。 Because of this, when looking at the range, it will need to be in a format of "TABLE1[COLUMN1]" instead of "A1:A15" for example.因此,在查看范围时,例如需要采用“TABLE1[COLUMN1]”而不是“A1:A15”的格式。

Basically I am after 3 separate cells to display the cell next to the 3 highest values that meet the criteria.基本上,我在 3 个单独的单元格之后显示符合条件的 3 个最高值旁边的单元格。 For example, in the screenshot below A17 = AAA.例如,在下面的屏幕截图中 A17 = AAA。 Therefore I want cell C17 to show the value next to the highest value where TABLE1[COLUMN1] = "AAA".因此,我希望单元格 C17 显示最高值旁边的值,其中 TABLE1[COLUMN1] = "AAA"。 In this example, Cells C17:C19 will show "WWW", "XXX" and "VVV" respectively.在此示例中,单元格 C17:C19 将分别显示“WWW”、“XXX”和“VVV”。

I am not sure how well I explained this, as I am very new to excel.我不确定我对此的解释有多好,因为我对 excel 很陌生。 So if you need any further information, please do not hesitate to let me know!因此,如果您需要任何进一步的信息,请随时告诉我!

Thanks :)谢谢 :)

在此处输入图片说明

Using the New Dynamic Array Formula:使用新的动态数组公式:

=INDEX(INDEX(SORT(FILTER(Table1,Table1[COLUMN1]=F1),2,-1),0,3),{1;2;3})

place it in the first cell and Excel will fill it down.将它放在第一个单元格中,Excel 将填充它。

,2, in the sort refers to the 2nd column relatively in the table. ,2,在排序中是指表中相对的第2列。 Change that to the column number in the table which has the numbers.将其更改为表中包含数字的列号。 ,3 refers to the relative column to return, in my case the third. ,3指的是要返回的相对列,在我的情况下是第三个。

在此处输入图片说明


Without the Dynamic Array formula one needs to put this in the first cell and copy down:如果没有动态数组公式,则需要将其放在第一个单元格中并复制下来:

=INDEX(C:C,AGGREGATE(15,7,ROW(Table1[COLUMN2])/((Table1[COLUMN2]=AGGREGATE(14,7,Table1[COLUMN2]/(Table1[COLUMN1]=$F$1),ROW(1:1)))*(Table1[COLUMN1]=$F$1)),1))

在此处输入图片说明

This is the way that I use,这是我使用的方式,

=INDEX($E$2:$E$13,INDEX(MATCH($G$2&LARGE(($C$2:$C$13=$G$2)*$D$2:$D$13,ROW(A1)),$C$2:$C$13&$D$2:$D$13,0),0))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM