If you layout the data in a structured format, then a Pivot table would do the trick for you.