If you’ve been subtotaling manually, you should know about the Subtotal tool. In Excel 2007/2010, you’ll find this button on the Data tab, Outline group.
Start by sorting what you want to subtotal. Then, click the Subtotal button. In the first field, at each change in: select the field you sorted by from the dropdown list. In the second field, Use function allows you to change what type of math you want to do at each break.
Add subtotal to: should show all the columns you’d like to subtotal. Click OK and subtotals are automatically added.