Excel,匹配查找数组以忽略隐藏行
注意:我使用的是Excel 2016,无法访问365中的好东西:(
我现在正在尝试构建一个汇总表。想法是过滤表格,然后选择汇总公式 ,我尝试使用 Aggregate 中的 Large 函数,这将帮助我忽略隐藏行,
同时还允许我提取第 n 个最大值。
为此 使用匹配来查找列中该值的行号,以便我还可以通过间接分配列字母来从同一行获取基于文本的值。
^这是我想要做的事情的关键^
代码目前看起来像这样...(销售是“R”列)
=MATCH(AGGREGATE(14,5,Table1[Sales],1),Table1[Sales],0)+62
然后将是
=INDIRECT("N"&MATCH(AGGREGATE(14,5,Table1[Sales],1),Table1[Sales],0)+62)
Aggregate(14 = Large*
Aggregate(,5 = 忽略隐藏行*
最后的 62 是当表中的数据开始时在第 63 行(使用 row() 使其更加稳健已在我的列表中,但尚未出现)。
我遇到的问题是 Match 函数 Table1[Sales]
中的查找数组似乎不存在。当表被过滤时,不会被过滤。
至少这就是我看到的结果向我表明的内容,因为我返回的行号不在过滤表中(即“匹配”返回隐藏的行号)。
我的问题是,是否有人知道如何做到这一点,以便在数组中只考虑可见行。
(如果我完全没有达到这个目的,并且有人对如何实现这个目标有更好的想法(而不必诉诸数组函数),我将非常感激)。
谢谢!
预期结果
行 | A | B |
---|---|---|
1 | Company A | 425 |
2 | Company B | 1500 |
4 | Company A | 1200 |
7 | Company C | 750 |
15 | Company B | 100 |
19 | Company A | 100 |
我正在寻找 B 列中的第 n 大值,例如 1200 (第二大)这个例子。
=MATCH(AGGREGATE(14,5,B:B,2),B:B,0)
=MATCH((1200),C:C,0))
=3
预期结果是第 4 行,但因为(似乎)查找数组不排除已过滤/隐藏的行,所以它返回第 3 行。
我希望这更清楚一点!
NOTE: I'm using Excel 2016, don't have access to the good stuff in 365 :(
I'm trying to build a summary sheet at the moment. The idea is to filter a table, then have the summary formulas pick out the top 5 values in a given column.
To do this I'm trying to use the Large function in Aggregate which will help me ignore hidden rows while also allowing me to extract the nth largest value.
From there I had thought to use match to find the row number of that value within the column so that I could also get text based values from the same row by assigning a column letter via Indirect.
^This is the crux of what I'm trying to do^
The code looks like this at the moment... (Sales is column "R")
=MATCH(AGGREGATE(14,5,Table1[Sales],1),Table1[Sales],0)+62
Would then go be
=INDIRECT("N"&MATCH(AGGREGATE(14,5,Table1[Sales],1),Table1[Sales],0)+62)
Aggregate(14 = Large*
Aggregate(,5 = Ignore hidden rows*
The 62 there at the end is there as the data in the table starts on row 63 (making it more robust with row() is on my list but not there yet).
The issue I'm having is it seems the lookup array in the Match function Table1[Sales]
isn't being filtered as the table is being filtered.
At least that's what the results I'm seeing are indicating to me as the row number I'm getting back isn't within the filtered table (I.e. Match is returning a hidden row number).
My question is if anyone has an idea about how make this so that only visible rows are considered within the array.
(If I've completely missed the mark with this and someone has a better idea about how to accomplish this goal (without having to resort to array functions) I'd be very grateful).
Thanks!
Expected results
row | A | B |
---|---|---|
1 | Company A | 425 |
2 | Company B | 1500 |
4 | Company A | 1200 |
7 | Company C | 750 |
15 | Company B | 100 |
19 | Company A | 100 |
I'd be looking for the nth largest value in column B, say 1200 (second largest) in this example.
=MATCH(AGGREGATE(14,5,B:B,2),B:B,0)
=MATCH((1200),C:C,0))
=3
The expected result is Row 4, but because (again, it seems) the look-up array isn't excluding filtered/hidden rows, it is returning Row 3 instead.
I hope this is a bit clearer!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论