Select the data.
Click the Data tab. Use sort buttons to sort the column.
Click the Subtotal button.
Click the column to subtotal.
Click the summary function for the subtotals.
Select the check box for each column you want to subtotal.
To set automatic page breaks following each subtotal, select the Page break between groups.
To show or hide a summary row above the detail row, select or clear the Summary below data.
To remove subtotals, click Remove All.
Click OK.