Google Sheets: how to use is not null in a query of another sheet but referencing a cell in the formula sheet

36 views Asked by At

I am trying to get data from another sheet using the content of a cell where I have the formula but I need to avoid blank or 0s in that cell. Here is my formula:

=query(dataset!$D$3:$T$5004 , "select COUNT(T) where (O contains '"&F9&"') AND (T contains 'i/p') AND '"&F9&"' is not null label count(T) ''" , 0)

I get the following error:

No se puede analizar la cadena de la consulta para Función QUERY, parámetro 2: PARSE_ERROR: Encountered " "is" "is "" at line 1, column 69. Was expecting one of: "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "=" ... <OP_NOT_EQUALS> ... "<" ... "<=" ... ">" ... ">=" ... "=" ... <OP_NOT_EQUALS> ... "<" ... "<=" ... ">" ... ">=" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... 

Any help would be appreciated!

1

There are 1 answers

0
rockinfreakshow On

You may try with:

=query(dataset!$D$3:$T$5004 , "select COUNT(T) where (O contains '"&if(F9="","ΣΛ",F9)&"') AND (T contains 'i/p') label count(T) ''" , 0)

OR

=query(dataset!$D$3:$T$5004 , "select COUNT(T) where (O = '"&F9&"') AND (T = 'i/p') label count(T) ''" , 0)