Count with grouping in Excel
Many ways.. simplest one (to my view) is to use a pivot table but it depends on your needs..
If you define your data table with a name then it will expand automatically as you add value and a refresh on the pivot will update the numbers
To find the Grand Total of Cat & Dog use the following Formula.
=SUMIF($B$2:$B$6,$B$8,$A$2:$A$6)
=SUMIF($B$2:$B$6,$B$9,$A$2:$A$6)
To find the Total of Cat & Dog use these Formula.
=COUNTIF($B$2:$B$6,$B$11)
=COUNTIF($B$2:$B$6,$B$12)
Check the screen shot.
I do hope this help you.