This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

Microsoft Excel 2008

Calculating Subtotals

Once you have sorted a data range into groups, Excel's Subtotal command can create a subtotal for each group, automatically inserting a new row and displaying the total for each line.

return to topAdding Subtotals

Subtotals are added using the Subtotal dialog box, which is accessed from the Data menu.

The Subtotal command is not available for Excel Databases. To find subtotals for Database data, you can convert it to a normal data range and then perform the Subtotal command.
The following graphics show a data range that has been sorted according to days of the week, and its corresponding Subtotal dialog box, which has been set to display subtotals for the total hours worked on each day of the week.

  1. Sort your data range

  2. Select a cell within the data range
    Sample data range

  3. From the Data menu, select Subtotals...
    The Subtotal dialog box appears.
    Subtotal dialog box

  4. From the At each change in pull-down menu, select the column containing data groups for which you want subtotals
    NOTE: It is important to have this column sorted into groups, because the Subtotal command subtotals numerical data at every change of group in the column.
    EXAMPLE: Select Day

  5. From the Use function pull-down menu, select the function that will be used to create subtotals
    EXAMPLE: Select Sum

adds the values for each data group

determines the number of records in each data group

finds the average value in each data group

finds the highest value in each data group

finds the lowest value in each data group

multiplies compounding values in each data group

  1. From the Add subtotal to scroll box, select the column with the numerical data you want subtotaled
    NOTE: The option is selected when a checkmark appears.

  2. OPTIONAL: From the bottom of the dialog box, select the appropriate options

  3. Click OK
    Subtotal lines are added according to the column you specified in the At each change in pull-down menu and the groups you sorted in that column.

return to topAdjusting Views with Subtotals

When you have applied subtotals to your data range, an outline bar appears to the left of the row numbers.

TheOutline levelspresents levels of detail in the view

Level 1: grand total

Level 2: subtotals and grand total

Level 3: all data in range


To expand the view one level:

  1. Click the plus signExpand button

To collapse the view one level:

  1. Click the minus signCollapse button

Example of outline levels

return to topRemoving Subtotals

If you no longer need subtotals, you can easily remove them without deleting rows.

  1. Select a cell within the data range

  2. From the Data menu, select Subtotals...
    The Subtotal dialog box appears.

  3. Click REMOVE ALL
    The subtotals are removed.

return to topRe-sorting the Data

If you re-sort a data range containing subtotals, Excel will warn you that it will remove the subtotals before re-sorting. After the data range has been re-sorted, you can add subtotals again.

Excellence. Our Measure. Our Motto. Our Goal.