Reverse index match with multiple outputs

时间:2018-07-24 10:04:01

标签: excel

Given a matrix like the one shown below, I would like to be able to input a person's name and output every group the person is in.

Example matrix

I am OK with the reverse index match lookup but do not know how to amend the formula to produce an array that works. I have tried using SMALL/LARGE function but can't get it to work.

My formula for CELL C15 is

=INDEX($C$2:$I$2,,MATCH("ü",INDEX($C$3:$I$12,MATCH($B$15,$B$3:$B$12$,0),),0))

Any ideas?

1 个答案:

答案 0 :(得分:1)

在C15中使用此公式,然后向下拖动直到需要为止(使用ctrl + shift + enter键关闭)

=IFERROR(INDEX($C$2:$I$2,SMALL(IF(INDIRECT("C"&MATCH($B$15,B:B,0)&":I"&MATCH($B$15,B:B,0))<>"x",TRANSPOSE(ROW($1:$7)),""),ROW(A1))),"")

如果需要得到相反的结果(按组列出的人员)。用以下方法做同样的事情:

=IFERROR(INDEX($B$3:$B$12,SMALL(IF(INDIRECT(ADDRESS(3,MATCH($B$15,$2:$2,0))&":"&ADDRESS(12,MATCH(B$15,$2:$2,0)))="v",ROW($1:$10),""),ROW(A1))),"")