I just started using Google Spreadsheets.

I have a question concerning "counting" a specific word/item in cells.


Column A

 1. HAT
 2. HAT
 3. SHOE
 4. CANE
 5. SHOE
 6. HAT
 7. -
 8. -
 9. = A1 to A6 = 3 Hats
 10.= A1 to A6 = 2 shoes
 11.= A1 to A6 = 1 cane

See what I mean? How do I make it count the specific items in that specific column?



=query({A:A, A:A}, "Select Col1, count(Col2) where Col1 <>''group by Col1")

or if you don't want the header 'count':

=query({A:A, A:A}, "Select Col1, count(Col2) where Col1 <>''group by Col1 label count(Col2)''")

An alternative way would be:

=ArrayFormula({unique(A1:A6),countif(A1:A6, unique(A1:A6))})
| improve this answer | |

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.