Or you can use pivot table for that.

The pivot table can also be added on the same sheet (if wanted).