Have you considered using a pivot table? This is a bit overkill, but greatly simplifies what you want to do. Assuming you are using Excel 2007:
- Select a range of data, including column labels.
- Go to Insert → [Tables] → PivotTable.
- " ", "".
PivotTable .
- .
- .
- .
!