Anda di halaman 1dari 10

Lesson 11 - Subtotals 127

Lesson 11 Subtota ls
Les s on Topics
Generating Subtotals
Creating Multiple Subtotals

Les s on Objectives
At the end of the lesson, you will be able to:
Sort rows into categories and then subtotal each category;
Collapse and expand a table of subtotals so you can focus
on a special section of subtotals;
Create subtotals for different fields of the same table.

Student Files Us ed
You will use the following files from your student folder:
Subtota ls Sa mple 1
Subtota ls Sa mple 2

Copyright © 1985-2007, Finney Learning Systems, Inc.


All rights reserved.
128 Microsoft Excel 2003 - Intermediate

Generating The Subtotals feature lets you quickly summarize a table by sorting
Subtotals rows into categories and then inserting a subtotal for each category.
For example, you might have a list of many orders, which you
could sort by date and then generate a subtotal for each month.

1. You are going to add subtotals to a table of orders.


Open Subtotals Sample 1.
Notice the table of orders. The important fields are
those named Date, Customer, and Amount. Currently
the table is sorted by Customer #.
To use the Subtotal feature, you have to begin by
sorting the field you are going to use to create
subtotals. In this case, it is the Customer field. You
are going to sort the table by customer and then
produce subtotals for each customer amount.
2. To select a column for sorting, you need only click in
one cell of that column.
Click any cell in the table in Column E. (Be sure the
active cell is in the table.)
3. On the Standard toolbar, click the Sort
Ascending button.
Notice that the table is sorted by customer name.
4. On the Data menu, choose Subtotals.
The Subtotal dialog box appears.

Notice that the entire table is selected in the


worksheet.
Lesson 11 - Subtotals 129

5. The At each change in box contains a list of all the


fields of the table. Remember that our objective is to
create a subtotal for each customer.
Click the At each change in box, and choose
Customer.
A subtotal will now be entered for each customer.
6. The Use function box lists the math operation that will
be used. This is usually Sum.
You will be calculating a Sum of the data in the
Amount column, so verify that Sum is displayed in
this box.
7. In the Add subtotal to box, verify that there is a
check mark next to Amount.
If you scroll the box, you will see that this is the only
field that has been selected. Excel has looked at the
data in the table and decided that this is the most
likely data to be subtotaled.
8. Below these items, verify that Replace current
subtotals and Summary below data are checked.
They will be discussed shortly.
You are finished choosing the subtotal information.
9. Click OK.
Notice the extra rows that have been inserted.
There is an Allison
Total, an Andy Total, a
Barb Total, etc. Also
notice that Excel has
added an additional
row at the bottom of
the table—Grand
Total. Excel has added the entire Amount column.
Notice that the subtotal and grand total rows have
been placed in the column they represent, Customer.
130 Microsoft Excel 2003 - Intermediate

The Outline At the left of the worksheet, notice that Excel has added a new
Feature feature. This is called the Outline feature, which lets you collapse
and expand the table.

1. At the top are three boxes numbered 1, 2 and 3.


There are three boxes because there are
three levels of information.
2. Click the 1 box — the first level. Notice
that the table has been collapsed so
only the Grand Total is displayed. The
other levels are hidden. Notice the gap
between row 1 and row 31. The rows in
between are hidden.
3. Click the 2 box — the second level.
Notice that the table has expanded so that the
subtotals are now displayed. Now only the data
rows are hidden.
4. Click the 3 box (the third level).
The table expands to full size.
5. Below the three boxes are items that let you collapse
and expand the rows selectively. Below the 1 box is a
long vertical line indicating that it encompasses all of
the rows.
Click the minus sign (-) at the bottom of the
vertical line below the 1 box.
Notice that the table collapses to only the Grand
Total row. In the Outline area there is only a single
plus (+) sign. A plus sign (+) indicates that the area
of the outline can be expanded. A minus sign (-)
indicates that this area can be collapsed.
6. Click the plus sign.
Notice that the table expands to full size again. All
the rows are displayed.
7. Click the 2 box again so only the subtotals are
displayed.
8. In the second row of the Outline, under the 2 box,
click the first plus sign (+) next to row 4.
Notice that the first two data rows (those for the first
customer) have expanded.
Lesson 11 - Subtotals 131

9. Click the next plus sign (+) next to row 6.


Notice how the next customer group expands. If you
were creating a report and wanted to highlight only
some of the detail information in the table, you
could use this feature to hide the information that is
not important.

Note: There are no plus or minus signs under box 3,


only dots, because there is nothing to expand.

More Practice You are going to sort this table by month and then create subtotals
for each month. First, you will remove the existing subtotals,
although as you will learn later, you can add your new subtotals to
the old ones.

1. Removing subtotals is easy.


Verify that the active cell is in the table. If it is not,
you will receive an error message. It does not
matter if some of the table is collapsed.
2. On the Data menu, choose Subtotals.
3. In the Subtotal dialog box, click the Remove All
button.
The subtotals are removed and the table appears
only with the data rows. The Outline feature is also
removed.
4. Currently the table is sorted by the Customer field. You
are going to sort by month and then create subtotals
for each month. If you sort the table by the Month
column, the months will not be in alphabetical
order—Feb will come before Jan. Therefore, you will use
the Date field.
Click in any cell in the table in column B.
(Remember, the cell in column B has to be in the
table itself.)
132 Microsoft Excel 2003 - Intermediate

5. On the Standard toolbar, click the Sort Ascending


button.
The table is sorted by date.
6. On the Data menu, choose Subtotals.
The Subtotal dialog box appears and the table in the
worksheet has been selected.
Remember that the objective is to create subtotals of
the Amount column for each month in the Month
column.
7. Click the At each change in box and choose Month.
8. In the Use function box, verify that Sum is selected.
As before, you will be calculating a Sum of the data
in the Amount column.
9. In the Add subtotal to box, verify that Amount is
selected.
You are finished choosing the subtotal information.
10. Click OK.
Notice the three subtotals and the grand total. Excel
places the Subtotal and the Grand Total rows in the
column they represent (Month). The totals are placed
in the Amount column.
Also notice the Outline bar to the left of the
worksheet.
11. Click the 1 box and notice the Grand Total.
12. Click the 2 box and notice the Subtotals.
13. Click the 3 box and notice the entire table.

Adding More You can add other subtotals to a table that already contains
Subtotals subtotals. You can also use functions other than SUM — Count,
Min, Max, and several others.

1. Once again, a table is selected if any cell in the table is


the active cell.
Verify that the table is still selected.
2. On the Data menu, choose Subtotals.
The Subtotal dialog box appears. At the bottom of
the dialog box, notice the option, Replace current
Lesson 11 - Subtotals 133

subtotals. This option allows you to remove any


subtotals that are currently in the table, and replace
them with other Subtotal lines (or Counts, etc.). If
you de-select this option, Excel will simply add new
Subtotal lines below the ones that already exist. This
is what you are going to do.
3. You are going to add a set of Count lines that will show
the number of orders in each month.
De-select the Replace current subtotals option.
This will add the new Count lines below the existing
Subtotal lines.
4. Click the Use function box and choose Count.
5. Verify that Amount is chosen in the Add subtotals to
box.
6. Click OK.
Notice the table with two subtotal lines below each
month such as Jan Total, Jan Count, Feb Total, Feb
Count, etc. Also, at the bottom, there are two grand
total lines — Grand Total and Grand Count. Also
notice in the outline bar that there is a fourth level
because you have added a new subtotal.

7. Close Subtotals Sample 1 without saving.

Creating You can also create subtotals for different fields.


Multiple
1. Open Subtotals Sample 2.
Subtotals
Notice the table. For each Series, there are two Shirt
Styles, and each style has four sizes. First, you are
going to create subtotals for each shirt style and then
later for each series. Notice that the table is already
sorted by Series Name, then by Shirt Style, and last by
Size. Always remember that the data must be sorted
134 Microsoft Excel 2003 - Intermediate

by any field you intend to use for the Subtotals


feature.
2. Verify that the table is selected. Any cell in the
table can be the active cell.
3. On the Data menu, choose Subtotals.
The Subtotal dialog box appears. The entire table is
selected in the worksheet.
4. In the At each change in box, verify that Series Name
is selected.
5. In the Use function box, verify that Sum is
displayed.
As you know, Sum is the default operator for the
Subtotals feature.
6. Verify that Gross Revenue is selected in the Add
subtotal to box.
Typically, tables contain “bottom-line” information
in the last column, which is the case in this table.
This helps Excel find the correct column to add for
the subtotal.
7. Excel lets you select more than one column to calculate
for the Subtotal. You are going to display both the
Gross Revenue subtotals and the Qty Sold subtotals.
In the Add subtotal to box, click Qty Sold.
Two items should be selected — Qty Sold and Gross
Revenue.
8. By default, the Summary below data option is selected,
so that Excel places the subtotal rows below the rows
that it uses for the calculation. You are going to change
this.
If necessary, de-select Summary below data.
9. Click OK.
Notice the table. Notice that Grand Total, Star Trek
Total and Star Wars Total appear above the data. This
is because you de-selected the Summary below data
option.
Also notice the information displayed in the subtotal
rows. Because you chose two column names in the
Lesson 11 - Subtotals 135

Add subtotal to box, there are two subtotals: Qty Sold


and Gross Revenue.

Next, you are going to add subtotals for the Shirt Styles.

1. Verify that the table is still selected with the active


cell somewhere in it.
2. On the Data menu, choose Subtotals.
3. When you are adding a subtotal to a table that already
contains subtotals, you must de-select the Replace
current subtotals option.
In the Subtotal dialog box, de-select the Replace
current subtotals option.
4. Click the At each change in box and choose Shirt
Style.
5. Verify that Sum is still selected in the Use function
box.
6. Verify that Qty Sold and Gross Revenue are still
selected in the Add subtotal to box and click OK.
The Shirt Style subtotals are added to the table. You
have summarized the information so you know the
number of sales and gross revenue for each series
and for each shirt style.
7. Notice the inserted rows, Scotty Total, Spock Total, etc.
Also notice the Outline bar — it now contains four
levels.
Click the 3 box in the Outline bar.
Notice the summary information. The Shirt Style
subtotals are “indented” below the Series Name
subtotals, because they appear in the Shirt Style
column.

8. You are going to remove the subtotals.


136 Microsoft Excel 2003 - Intermediate

On the Data menu, choose Subtotals.


9. In the Subtotal dialog box, click Remove All.
The subtotals are removed.
10. Close Subtotals Sample 2 without saving changes.

End of Lesson 11

Anda mungkin juga menyukai