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
Google sheets 在谷歌表单中,当一个日期小于另一个日期时计数_Google Sheets_Formula_Google Sheets Formula_Countif - Fatal编程技术网

Google sheets 在谷歌表单中,当一个日期小于另一个日期时计数

Google sheets 在谷歌表单中,当一个日期小于另一个日期时计数,google-sheets,formula,google-sheets-formula,countif,Google Sheets,Formula,Google Sheets Formula,Countif,在Google Sheets中,当B列(实际)中的日期小于A列(预期)中的日期时,我想计算日期值的数量 我想有一个单元格中预期>实际的日期总数。 我相信谷歌表单中的公式看起来像这样,但我一直没能让它起作用 =COUNTIF('Sheet1'!A1:A500,">"&'Sheet1'!B1:B500) 确保您正在比较日期对象,而不是看起来像日期的文本。要检查值是否为日期,请执行以下操作: =isdate(A1) // returns true if the v

在Google Sheets中,当B列(实际)中的日期小于A列(预期)中的日期时,我想计算日期值的数量

我想有一个单元格中预期>实际的日期总数。 我相信谷歌表单中的公式看起来像这样,但我一直没能让它起作用

=COUNTIF('Sheet1'!A1:A500,">"&'Sheet1'!B1:B500)

确保您正在比较日期对象,而不是看起来像日期的文本。要检查值是否为日期,请执行以下操作:

=isdate(A1) //  returns true if the value in A1 is an actual date
通常,您可以将文本转换为日期:

尝试
更新日期

=COUNTIF(arrayformula(to_date(Sheet1!A1:A500)),">"&to_date(Sheet1!B1:B500))

datevalue

=COUNTIF(arrayformula(DATEVALUE(Sheet1!A1:A500)),">"&DATEVALUE(Sheet1!B1:B500))

请注意日期实际上是数字。
因此,像2020年9月23日这样的日期与44086年相同

除了Marios的正确答案,您还可以使用查询公式

如果只希望结果省略标题,可以使用

=QUERY(Sheet1!A1:B,"select count(B) where A>B label count(B) '' ")
=QUERY(Sheet1!A1:B,"select count(B) where A>B label count(B) '' ")