My goal is to select (count a number of rows with data) based on a condition. My query looks so basic but it does not work.

=query(A:B,"select count(B) where (A = '44')",)

My result is "count" as you can see on enclosed link.


1 Answer 1



=query(A:B,"select count(B) where (A = 44)",)


As the values on column A are numbers, QUERY set the column data type as number. Enclosing a number between single quotes/apostrophes makes it to be a string, so comparing a string to a number returns FALSE.

To remove the header try

=query(A:B,"select count(B) where (A = 44) label count(B) ''",)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.