Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets Google Sheets ArrayFormula问题_Google Sheets_Google Sheets Formula_Array Formulas - Fatal编程技术网

Google sheets Google Sheets ArrayFormula问题

Google sheets Google Sheets ArrayFormula问题,google-sheets,google-sheets-formula,array-formulas,Google Sheets,Google Sheets Formula,Array Formulas,在过去的几个月里,我一直在谷歌文档电子表格中使用以下公式。大约4周前它停止工作了。我不明白为什么——没有发现任何东西表明公式的工作方式发生了变化,也没有对我的数据进行修改 我得到的错误是: “错误:参数为空”,没有多大帮助 以下是公式: =arrayformula( sum( (Sheet1!$B$2:$B$100458=$A3) * (arrayformula( month(

在过去的几个月里,我一直在谷歌文档电子表格中使用以下公式。大约4周前它停止工作了。我不明白为什么——没有发现任何东西表明公式的工作方式发生了变化,也没有对我的数据进行修改

我得到的错误是:

“错误:参数为空”,没有多大帮助

以下是公式:

=arrayformula(
        sum(
            (Sheet1!$B$2:$B$100458=$A3)
            *
            (arrayformula(
                month(Sheet1!$A$2:$A$100458)
                )
                = month(C$1)
            )
            *
            (arrayformula(
                year(Sheet1!$A$2:$A$100458)
                )
                =year(C$1)
            )
        )
    )

它在第一列有一个唯一的ID,在第一行有一个日期(每个月的第一天)。然后遍历表1,查找月份和年份中与该ID匹配的记录数,并返回计数。有一段时间它工作得很好,不知道发生了什么。我甚至试着回到修订历史记录中,没有发现任何差异。

之前不确定为什么它会起作用,但在完成每个步骤后,我必须这样做才能让它起作用

=arrayformula(
    sum(
        iferror(
            arrayformula(Sheet1!$B$2:$B$100458=$A3)
            , FALSE
        )
        *
        iferror(
            arrayformula(
                month(Sheet1!$A$2:$A$100458)
                = month(C$1)
            )
            ,FALSE
        )
        *
        iferror(
            arrayformula(
                year(Sheet1!$A$2:$A$100458)  
                =year(C$1)
            )
            ,FALSE
        )   
    )
)
基本上是对一些arrayformula重新排序并添加iferror()函数。似乎arrayformulas在通过记录末尾时抛出了错误,而不是false,因此sum也抛出了错误。Iferro()解决了这个问题