试图返回匹配值的第二个最后位置

时间:2016-03-20 15:22:36

标签: arrays excel if-statement indexing match

因为很难理解这个问题。我上传了这张照片。它可以帮助您理解我的问题。请帮我解决一下。提前致谢 enter image description here

1 个答案:

答案 0 :(得分:0)

我无法调和为什么你想要在D列中使用该模式。似乎'查找前两个匹配的第一个位置,然后查找任何匹配的其余部分的渐进位置

以下是您问题的解决方案。

在D1中,作为标准公式,

=AGGREGATE(15, 6, ROW($1:$12)/(B$1:B$12=B1), COUNTIF(B$1:B1, B1)-(COUNTIF(B$1:B1, B1)>1))
'to retrieve the values from column A as,
=INDEX(A:A AGGREGATE(15, 6, ROW($1:$12)/(B$1:B$12=B1), COUNTIF(B$1:B1, B1)-(COUNTIF(B$1:B1, B1)>1)))

然而,我强烈怀疑它应该更接近于此(如在G1中),

=AGGREGATE(15, 6, ROW($1:$12)/(B$1:B$12=B1), COUNTIF(B$1:B1, B1)-(COUNTIF(B$1:B1, B1)>1))
'to retrieve the values from column A as,
=INDEX(A:A, AGGREGATE(15, 6, ROW($1:$12)/(B$1:B$12=B1), COUNTIF(B$1:B1, B1)-(COUNTIF(B$1:B1, B1)>1)))

weird_progressionG