在 arrayformula 中使用正则表达式匹配和过滤器(Google 张)
Using regexmatch & filter inside arrayformula (Google Sheets)
我有一个功能性的 Google Sheets 公式,我尝试对其进行修改,以便作为数组公式执行,这样我就不再需要在每个单元格中复制粘贴。你能帮忙吗?
我尝试通常的方法:
=arrayformula(if(len(A2:a)>0,iferror(transpose(filter(Dashboard!B:B, regexmatch(Dashboard!c:c, d2:d))),"-"),""))
但不起作用(我认为是在重复整列第一行的结果)。
简单版:
=if(len(A2)>0,iferror(transpose(filter(Dashboard!B:B, regexmatch(Dashboard!c:c, d2))),"-"),"")
阵列版本:.....?
=ARRAYFORMULA(IF(LEN(A2:A), IFERROR(VLOOKUP(REGEXEXTRACT(D2:D, TRANSPOSE(SUBSTITUTE(
TRIM(QUERY(TRANSPOSE(QUERY(TRANSPOSE(IFERROR(SPLIT(Dashboard!C2:C, ",")))
,,999^99)),,999^99)), " ", "|"))), TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(
TRANSPOSE(IF(IFERROR(SPLIT(Dashboard!C2:C, ","))<>"", "♠"&IFERROR(
SPLIT(Dashboard!C2:C, ","))&"♦"&Dashboard!B2:B, ))
,,999^99)),,999^99), "♠")), "♦")), 2, 0), "-"), ))
我有一个功能性的 Google Sheets 公式,我尝试对其进行修改,以便作为数组公式执行,这样我就不再需要在每个单元格中复制粘贴。你能帮忙吗?
我尝试通常的方法:
=arrayformula(if(len(A2:a)>0,iferror(transpose(filter(Dashboard!B:B, regexmatch(Dashboard!c:c, d2:d))),"-"),""))
但不起作用(我认为是在重复整列第一行的结果)。
简单版:
=if(len(A2)>0,iferror(transpose(filter(Dashboard!B:B, regexmatch(Dashboard!c:c, d2))),"-"),"")
阵列版本:.....?
=ARRAYFORMULA(IF(LEN(A2:A), IFERROR(VLOOKUP(REGEXEXTRACT(D2:D, TRANSPOSE(SUBSTITUTE(
TRIM(QUERY(TRANSPOSE(QUERY(TRANSPOSE(IFERROR(SPLIT(Dashboard!C2:C, ",")))
,,999^99)),,999^99)), " ", "|"))), TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(
TRANSPOSE(IF(IFERROR(SPLIT(Dashboard!C2:C, ","))<>"", "♠"&IFERROR(
SPLIT(Dashboard!C2:C, ","))&"♦"&Dashboard!B2:B, ))
,,999^99)),,999^99), "♠")), "♦")), 2, 0), "-"), ))