在单元格 W4 中试试这个公式:
=IF(V3=V4,INDEX(INDIRECT("I"&MATCH(W3,I:I,0)+1&":I26"),MATCH(V4,INDIRECT("R"&MATCH(W3,I:I,0)+1&":R26"),0)),INDEX($I$2:$I$26,MATCH(V4,$R$2:$R$26,0)))
该公式检查前一个国家/地区的得分是否与实际国家相同。在这种情况下,它会在列表中搜索前一个国家并重新定义要搜索分数的范围。这样,即使是整个列表中的完美平局也会产生一个独特的国家/地区列表。
您的公式没有解决您的问题,因为 INDEX 函数会搜索所搜索值的第一次出现。它不考虑是否在另一个单元格中已经运行了另一个 INDEX。通过根据先前的结果重新定义要搜索的范围,您将只删除您正在搜索的值的第一次(或第二次、第三次或其他)出现(以及您不关心的其他一些值)。
分解我们得到的公式:
=IF(V3=V4, 'Checks for a tie
'---------------------------------------------If it's a tie
INDEX( 'Use a index function to pick the result
INDIRECT( 'Use an indirect function to define the range to be searched
"I"& 'State the column of the range to be searched
MATCH(W3,I:I,0)+1& 'Use a match function to find the previous occurence of the score whithin the column of the range to be searched and add 1 to it to cut out that value (and any previous one)
":I26" 'State the closing cell of the range to be searched
),
MATCH( 'Use a match function to determine in what row of the defined range the score is occuring
V4, 'The value to be searched
INDIRECT( 'Use an indirect function to define the range to be searched
"R"& 'State the column of the range to be searched
MATCH(W3,I:I,0)+1& 'Use a match function to find the previous occurence of the score whithin the column of the range to be searched and add 1 to it to cut out that value (and any previous one)
":R26" 'State the closing cell of the range to be searched
),
0 'Specify that you want the the exact occurence
)
),
'---------------------------------------------If it's not a tie
INDEX( 'Use a index function to pick the result
$I$2:$I$26, 'State the range to be searched
MATCH( 'Use a match function to determine in what row of the range the score is occuring
V4, 'The value to be searched
$R$2:$R$26, 'State the range to be searched
0 'Specify that you want the the exact occurence
)
)
)