简体   繁体   English

COUNTA 按月和 Google 表格中的排除

[英]COUNTA by month and by exclusion in Google Sheets

HERE IS A SAMPLE SHEET WITH SOLUTION WORKING:这是解决方案工作的示例表:
https://docs.google.com/spreadsheets/d/1Twc9i7D5rDvT_Q88thrwjV8E58Ja7c-ifdlCZDwu6Ok/edit?usp=sharing https://docs.google.com/spreadsheets/d/1Twc9i7D5rDvT_Q88thrwjV8E58Ja7c-ifdlCZDwu6Ok/edit?usp=sharing


I have a Google Sheet where I have registries that come from a Google Forms for some sort of Help Desk registry.我有一个 Google 表格,其中有来自 Google Forms 的注册表,用于某种帮助台注册表。 I'm trying to make a general report tab where things are count, in total and for the current month.我正在尝试制作一个通用报告选项卡,其中计算了当前月份的总数。

For example, I'm counting how many entries are classified as 'open' and 'ended'例如,我正在计算有多少条目被归类为“开放”和“结束”

For the global total of 'open' registries I have:对于全球“开放”注册表,我有:

=COUNTA(QUERY(INDIRECT("Responses!$N2:$N"), "where not N contains 'Ended'", 0))

And for the closed/ended registries I have:对于封闭/结束的注册表,我有:

=COUNTIF(INDIRECT("Responses!$N2:$N"),"Ended")

That works fine.这很好用。 Column "B" is a timestamp and Column "N" just lists the status as "Ended" or something else. “B”列是一个时间戳,“N”列只是将状态列为“已结束”或其他内容。 But when I try to count by month it fails.但是当我尝试按月计算时,它失败了。 I'm trying to use:我正在尝试使用:

    =COUNTA(QUERY(INDIRECT("Responses!$N2:$N"),
    "where not N contains Finalizado'",
    INDIRECT("Responses!$B2:$B"),
    ">"&EOMONTH(TODAY(),-1),INDIRECT("Responses!$B2:$B")," 
    <="&EOMONTH(TODAY(),0))")")

Can anyone pinpoint the error in the formula?谁能指出公式中的错误?

I also checked these but still no idea where exactly the error is: ( Google Sheets, increment cell by month ) ( Sum by month in Google Sheet ) ( Google Sheets =MONTH works but MONTH in QUERY does not ) ( Calculate number of rows with current month & year in Google Sheets or Excel )我也检查了这些,但仍然不知道错误到底出在哪里:( 谷歌表格,按月递增单元格)(谷歌表格中按月求和)( 谷歌表格 = MONTH 有效,但 QUERY 中的 MONTH 无效)( 计算行数Google 表格或 Excel 中的当前月份和年份

try like this:试试这样:

=COUNTA(IFERROR(QUERY(INDIRECT("Responses!B2:N"); 
"select N 
 where not lower(N) contains 'finalizado'
   and month (B)+1 = "&MONTH(TODAY()); 0)))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM