
First, sort your worksheet by the data you want to subtotal. This will create an outline for our worksheet with a group for each T-shirt size and then count the total number of shirts in each group. In our example, we'll use the Subtotal command with a T-shirt order form to determine how many T-shirts were ordered in each size (Small, Medium, Large, and X-Large). Your data must be correctly sorted before using the Subtotal command, so you may want to review our lesson on Sorting Data to learn more.
It will create a hierarchy of groups, known as an outline, to help organize your worksheet. For example, the Subtotal command could help to calculate the cost of office supplies by type from a large inventory order. The Subtotal command allows you to automatically create groups and use common functions like SUM, COUNT, and AVERAGE to help summarize your data.