Google Sheets – Get Unique Rows and Their Count

google sheetsgoogle-apps-scriptgoogle-sheets-query

I have a sheet as below,

| A | B | C |
-------------
|abc|123|Yes|
|jkl|123|No |
|abc|123|Yes|
|abc|567|Yes|

I want to get the output like,

| A | B | C |Count|
-------------------
|abc|123|Yes|  2  |
|jkl|123|No |  1  |
|abc|567|Yes|  1  |

Best Answer

See if this helps ?

=ArrayFormula(query({A1:C,C1:C}, "select Col1, Col2, Col3, count(Col4) where Col1 <> ''group by Col1, Col2, Col3 label count(Col4)''"))