简体   繁体   中英

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


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 )

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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