=QUERY(A2:A, "
SELECT
A, COUNT(A)
WHERE
A IS NOT NULL AND
A != 'Others (Custom)'
GROUP BY
A
ORDER BY
COUNT(A) DESC
LABEL
COUNT(A)''
")
- Using the QUERY Function of Google Sheets
- The column or row of cells should be in your first parameter of this function
A2:A
is my column to sample the content from, starting from row 2 of column A to the last value
- Replace
A
to the desired column value that you are referencing
- Perform a
SELECT
query on column A's data, with a COUNT
column
WHERE
is also used to conditionally filter away empty content and content that you don't want to count
GROUP BY
, COUNT
and ORDER BY
can be used to emulate functionalities like sorting
LABEL COUNT(A)''
simply omits setting a label for the output count column by using the ''
empty string
- Try omitting it to see what happens