Google Sheets query function returning 0 when queried data returns empty and not treating it as ERROR

37 views Asked by At

I got a formula that checks wheather or not there is data between two dates (I use it for monthly count), and it uses sample data that wrapped inside a named range called 'data'.

I need it to show the value 0 (zero) when the output is empty. Hopefully there is a solution that does not involves IFERROR; might use IFNA but don't know if this might end in having a harder troubleshooting on future if there is an error in the use of the spreadsheet.

My formula:

=QUERY(data;"SELECT COUNT(Col1) WHERE Col5 >= date '"&TEXTO($A60; "yyyy-mm-dd")&"' AND Col5 <= date '"&TEXTO(FIN.MES($A60;0); "yyyy-mm-dd")&"' LABEL COUNT(Col1) ''";1)

Take into account that for my spreadsheet configuration, I use ';' instead of ',' for my formulas.

Hope it's clear to understand.

Thanks, Rodrigo R.

0

There are 0 answers