Google-sheets – Counting unique rows in Google sheets with row output plus count

google sheets

How do you COUNT the number of unique rows in Google Sheets?
I have searched the knowledge base here but no luck.

My table looks like this :

Inst       vCPU    RAM  OS
t2.large    2       8   Windows
t2.large    2       8   Windows
t2.medium   2       4   Windows
t2.small    1       2   RHEL
t2.micro    1       1   Linux
t2.micro    1       1   Linux

I would like an output like this:

Count  Inst       vCPU    RAM   OS
2      t2.large     2       8   Windows
1      t2.medium    2       4   Windows
1       t2.small    1       2   RHEL
2       t2.micro    1       1   Linux

Best Answer

This will be the easiest method.

=QUERY (A1:D7,"Select Count (A),A,avg(B),avg(C), max (D) group by A")