You frequently will need to organize the data in an Excel worksheet by one or more criteria. For example, you might have a worksheet in which you list yearly sales for each product you offer, with the products broken down by category. If your data is organized this way, you can have Excel calculate a subtotal for each category of products. When you create a subtotal, you identify the cells with the values to be calculated and the cells that identify the change from one category to the next; Excel will update the subtotal and grand total for you if the value of any cell changes.
Create a Subtotal
Click any cell in the range you want to subtotal.
Click the Data tab.
In the Outline group, click Subtotal.
Click the At Each Change In down arrow.
Click the value on which you want to base the subtotals.
Click the Use Function down arrow.
Click the subtotal function you want to use.
Select which columns should have subtotals calculated.