You are on page 1of 6

200 What Every Engineer Should Know About Excel

FIGURE 10.1

FIGURE 10.2

4. The resulting table will have either the default coloring (by pressing CTRL+t) or
the coloring chosen (clicking on HOME/STYLES/Format As Table), and it will
have auto- ltering enabled so that the user can sort and lter the columns of the
table (Figure 10.3).
Data Management Resources in Excel 201

FIGURE 10.3

FIGURE 10.4

5. To give the table the custom name Contacts, place the cursor on a cell in the table
and the Table Tools menu will appear on the ribbon bar. Navigate to the Table
Tools Design menu and note the upper-left corner of the ribbon bar. It should
appear as in Figure 10.3. To change the name of the table to Contacts, type over the
term Table 1 with the term Contacts. Navigate away from the table and back to it
to ensure that the name is preserved (Figure 10.4).

10.3 Filtering, Sorting, and Using Subtotals


10.3.1 Filtering
Filtering of data is an extremely useful feature, particularly when working with large
numbers of rows of data. In the situation of a contact list, imagine wanting to lter names
by zip code or country. A brute force method for performing such could be to sort the
202 What Every Engineer Should Know About Excel

data by either zip code or country and then hide the rows that don’t t with what you
seek. Alternatively, using Excel’s built-in ltering capabilities can automatically accom-
plish these steps.
The simplest way to engage ltering is to use the Auto-Filter facility of Excel. Highlight
the column headings and data you want to lter and navigate to DATA/SORT & FILTER
and click on Filter. Excel will enable a drop-down lter on each column from which you
can perform several actions. These potential actions include the following:

– Sort A to Z (ascending order)


– Sort Z to A (descending order)
– Sort by Color (if colors are enabled and used)
– Clear Filter from {column name}
– Filter by Color
– A Search box for values in that column
– A box that allows the user to select which values to show or hide

Consider the data in Figure 10.1. Enabling ltering on that data set and then selecting the
drop-down menu on the Street Address eld would appear as in Figure 10.5.
By unchecking the Select All value and then checking the 12345 North Main Street value,
the table of data will be reduced to only two rows with 12345 North Main Street as a value
for the Street Address column.

FIGURE 10.5
Data Management Resources in Excel 203

10.3.2 Sorting
As seen from the menu choices above, sorting can be accomplished using the ltering
drop-down menus on each column. If, however, nested sorting (sorting by value A, then
value B within value A, etc.) is needed, an alternative approach is needed.
Consider the data in Figure 10.6. Imagine that these data need to be sorted rst by Last
Name, then by First Name, and then by Middle Initial. To create a nested sort for these
data, perform the following steps:

1. Highlight the data to be sorted.


2. Click DATA/SORT & FILTER/Sort to bring up the dialog box in Figure 10.7.
3. Click on the My data has headers checkbox in the upper-right corner.
4. Click the Sort by drop-down box and pick Last Name as the rst sort item. Keep
the Sort on Values choice and keep the Order of A to Z.
5. Click on Add Level to add a next level sort. An additional row will appear in the
dialog box. For that new row, select First Name from the Sort by drop-down box
leaving the Sort on and Order options at their default values.
6. Click on Add Level again, this time picking Middle Initial from the Sort by drop-
down menu, again leaving Sort on and Order as their default values, resulting in
the dialog box in Figure 10.8.
7. Click on OK and the data will rearrange as shown in Figure 10.9.

FIGURE 10.6
204 What Every Engineer Should Know About Excel

FIGURE 10.7

FIGURE 10.8

10.3.3 Subtotals
Subtotals can be used in Excel to perform several operations on subgroups of data.
The data must be sorted by a value on which the data are grouped, and then subto-
tals can be employed on various other data elements. The operations that can be per-
formed on a subgroup of data are Sum, Count, Average, Minimum, Maximum, and
Product. Product is a multiplication operation, minimum is the identi cation of the
minimum value of a subgroup, and maximum is the identi cation of a maximum value
in a subgroup.
Consider the data in Figure 10.10. The data consist of a list of spare parts that might be
on hand with a present-day IT group for quick repair of problematic devices. Let’s say, for
example, that management would like to know how many devices are held per category
as well as the dollar value of that inventory. Using subtotals for summing the number of
items on hand as well as the value of those items would be very handy.
To perform such an operation on this sample data, perform the following steps:

1. Start by highlighting the data and column headings for which subtotals will be
created.
Data Management Resources in Excel 205

FIGURE 10.9

2. Sort the data by category to ensure that the line items are grouped together by that
column. This is accomplished using the DATA/SORT & FILTER/Sort menu item.
Make sure that My data has headers is selected and pick the Category column
name for the Sort by eld.
3. Engage the subtotaling facility via the DATA/OUTLINE/Subtotal menu choice,
and the dialog box in Figure 10.11 will appear.
4. Change the At each change in: drop-down value to be Category, and check the box
for Number on Hand in the Add Subtotal to: window. Both Number on Hand and
Ext. Cost should be checked for subtotals.
5. Click OK to see the result in Figure 10.12. Notice that Excel has inserted subtotal
lines for each category and has provided a subtotal of items on hand in that cat-
egory as well as the values of those items. In addition, a Grand Total is provided at
the bottom of the sheet.
6. Note that there are three columns numbered 1, 2, and 3 to the left of the row
numbers of the worksheet. These designate the levels of information in the data
set. Clicking on the number three shows all details of the data set. Clicking on the
number two will show just the subtotals and the Grand Total, and clicking on the
number one will show only the Grand Total. Figure 10.13 shows the result of click-
ing on the number two.

You might also like