I have data that I need to sort by groups.

Like:

xxxx yyaa
xxxx abcc

I need to sort to find all the yy's and count and then all the ab's and count?