3

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.

https://docs.google.com/spreadsheets/d/1JDY5AsKDrK-LNBHDN5JLwVuqhNgwga95a9V6w-ODKpo/edit#gid=0

3

Formula

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

Explanation

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, privacy policy and cookie policy

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