【问题标题】:Formula Parse Error with Filter Function in Google SheetsGoogle表格中带有过滤功能的公式解析错误
【发布时间】:2019-06-13 00:38:51
【问题描述】:

我正在尝试使用一个公式在名为 All Data 的工作表中搜索 2 个变量。一个是店铺名称,另一个是标识符支付方式。付款方式只有 2 个选项可用。另一件事是我希望它搜索多个位置并过滤到一张纸。

A2 = 贝弗利 B2 = 斯通汉姆

当我使用这个公式时,我得到一个解析错误。关于这个问题的任何想法?当我只使用一个过滤器时,它就可以工作。似乎是当我添加其他过滤器时它会出错。

=filter('All Data'!A:K,('All Data'!$B:B=A2,'All Data'!$E:E="EGFL")+('All Data'!$B:B=B2,'All Data'!$E:E="EGFL"))

这适用于从主工作表中提取所有数据

=filter('All Data'!A:K,('All Data'!$B:B=B2)+('All Data'!$B:B=A2)+('All Data'!$B:B=C2)+('All Data'!$B:B=D2)+('All Data'!$B:B=E2)+('All Data'!$B:B=F2))

我试过了

=filter('All Data'!A:K,('All Data'!$B:B=B2,'All Data'!$E:E="REPL")+('All Data'!$B:B=A2,'All Data'!$E:E="REPL")+('All Data'!$B:B=C2,'All Data'!$E:E="REPL")+('All Data'!$B:B=D2,'All Data'!$E:E="REPL")+('All Data'!$B:B=E2,'All Data'!$E:E="REPL")+('All Data'!$B:B=F2,'All Data'!$E:E="REPL"))

【问题讨论】:

    标签: filter google-sheets google-sheets-formula google-sheets-query


    【解决方案1】:

    像这样尝试:

    =QUERY({
     IFERROR(FILTER('All Data'!A:K, 'All Data'!B1:B=A2, 'All Data'!E1:E="EGFL"), 
     {"","","","","","","","","","",""}); 
     IFERROR(FILTER('All Data'!A:K, 'All Data'!B1:B=B2, 'All Data'!E1:E="EGFL"), 
     {"","","","","","","","","","",""})}, 
     "where Col1 is not null", 0)
    

    【讨论】:

    • 错误在 ARRAY_LITERAL 中,数组文字缺少一行或多行的值。这就是我用你上面的公式得到的......
    • 感谢您的回复.. 有效.. 次要问题... 这也会引发错误 =SUM(QUERY({ IFERROR(FILTER('All Data'!K:K, '所有数据'!B1:B=B1, '所有数据'!E1:E="EGFL"), {""}; IFERROR(FILTER('所有数据'!K:K, '所有数据'!B1:B =B2, '所有数据'!E1:E="EGFL"), {""}}, "其中 Col1 不为空", 0))))
    • 试试:=SUM(IFERROR(QUERY({ IFERROR(FILTER('All Data'!K:K, 'All Data'!B1:B=B1, 'All Data'!E1:E="EGFL"), {""}); IFERROR(FILTER('All Data'!K:K, 'All Data'!B1:B=B2, 'All Data'!E1:E="EGFL"), {""})}, "where Col1 is not null", 0)))
    猜你喜欢
    • 2014-11-11
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-22
    • 1970-01-01
    • 2020-06-03
    • 1970-01-01
    相关资源
    最近更新 更多