COUNTA by month and by exclusion in Google Sheets

泪湿孤枕 提交于 2019-12-11 10:58:22

问题


HERE IS A SAMPLE SHEET WITH SOLUTION WORKING:
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. 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. 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)


回答1:


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)))


来源:https://stackoverflow.com/questions/58564930/counta-by-month-and-by-exclusion-in-google-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!