使用QUERY / FILTER从列表中填写表格

时间:2018-09-15 22:00:29

标签: google-sheets

有2个电子表格:

使用1个电子表格(MATCHES)作为源

player1  player2  set1  set2  set3
ivan     jhon     6 4   2 6   6 3
mikel    ivan     6 2   6 3
mikel    jhon     6 3   7 6

2个电子表格(TABLE)试图从源中填充

           ivan           jhon           mikel
ivan                  6/4 2/6 6/3       2/6 3/6
jhon    4/6 6/2 3/6                     3/6 6/7
mikel     6/2 6/3       6/3 7/6

试图做类似的事情(对于表TABLE中的每个单元格):

=IFERROR(QUERY(FILTER(MATCHES!A2:E100;MATCHES!$A$2:$A=$A2;MATCHES!$B$2:$B=B1);"SELECT C||"/"||D||" "||E||"/"||F||" "||G||"/"||H);"")

但没有任何结果。

1 个答案:

答案 0 :(得分:1)

我用textjoin处理了一个数组公式。

=arrayformula(textjoin(" ", true, if($A$2:$A$4=$G2, if($B$2:$B$4=H$1, substitute($C$2:$E$4, " ", "/"), ""), ""))&textjoin(" ", true, if($A$2:$A$4=H$1, if($B$2:$B$4=$G2, substitute($C$2:$E$4, " ", "/"), ""), "")))

根据玩家的相对位置逆转得分。

=arrayformula(textjoin(" ", true, if($A$2:$A$4=$G8, if($B$2:$B$4=H$7, substitute($C$2:$E$4, " ", "/"), ""), ""))&textjoin(" ", true, if($A$2:$A$4=H$7, if($B$2:$B$4=$G8, iferror(replace($C$2:$E$4, 1, find(" ", $C$2:$E$4), "")&"/"&replace($C$2:$E$4, find(" ", $C$2:$E$4), len($C$2:$E$4), ""), ""), ""), "")))

enter image description here

Shared spreadsheet