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查询计数返回';计数';而不是数值_Google Sheets_Google Query Language - Fatal编程技术网

Google sheets Google Sheets查询计数返回';计数';而不是数值

Google sheets Google Sheets查询计数返回';计数';而不是数值,google-sheets,google-query-language,Google Sheets,Google Query Language,第一次查询用户,请原谅我的问题。我有一个带有多个标签的谷歌表单(文档)。我正在尝试在包含工作表的选项卡之间进行查询。我发现不需要导入IMPORTRANGE,因为数据来自同一来源(如果我错了,请纠正我) 查询,获取指定月份和年份的计数。emp1是源数据的选项卡名称: =QUERY('emp1'!B2:B,"Select COUNT(B) where month(B)=3 and year(B)=2019",0) 样本行数据(B2为起始数据行,跳过标题B1): 查询中的月从0开始,但没有零月(

第一次查询用户,请原谅我的问题。我有一个带有多个标签的谷歌表单(文档)。我正在尝试在包含工作表的选项卡之间进行查询。我发现不需要导入
IMPORTRANGE
,因为数据来自同一来源(如果我错了,请纠正我)

查询,获取指定月份和年份的计数。emp1是源数据的选项卡名称:

  =QUERY('emp1'!B2:B,"Select COUNT(B) where month(B)=3 and year(B)=2019",0)
样本行数据(B2为起始数据行,跳过标题B1):


查询中的
从0开始,但没有零月(一月是1),因此需要+1更正。这样做:

=COUNTA(IFERROR(QUERY(emp1!B2:B, "where month(B)+1=3 and year(B)=2019", 0)))

=COUNTA(IFERROR(QUERY(emp1!B2:B, "where month(B)+1=3 and year(B)=2019", 0)))