在arrayformula中使用正则表达式和过滤器(Google表格)

时间:2019-05-31 06:25:30

标签: regex google-sheets google-sheets-formula array-formulas gs-vlookup

我有一个功能齐全的Google表格公式,我尝试对其进行修改,以便作为数组公式执行,这样我就不再需要在每个单元格中进行复制粘贴了。你能帮忙吗?

我尝试通常的方法:

-luis

但不起作用(我认为是在整个列的第一行重复结果)。

简单版本:

=arrayformula(if(len(A2:a)>0,iferror(transpose(filter(Dashboard!B:B, regexmatch(Dashboard!c:c, d2:d))),"-"),"")) 

数组版本:....?

1 个答案:

答案 0 :(得分:0)

=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), "-"), ))

0