Excel 2000 Data-Management
Excel 2000 Data-Management
Contents
Introduction ....................................................................................................................... 2
Objectives ......................................................................................................................... 2
Prerequisites ..................................................................................................................... 2
Related Training Available from ACS................................................................................ 2
Using Excel As A Database .............................................................................................. 2
Data Forms ....................................................................................................................... 6
Filtering Data..................................................................................................................... 8
Subtotals ......................................................................................................................... 11
Managing Windows......................................................................................................... 14
Linking Data .................................................................................................................... 15
Getting Additional Help ................................................................................................... 16
Introduction
This class is designed for students who want to learn how to sort, manage and filter data
in Excel. Students will also learn how to expertly use the lookup and database functions.
Objectives
The goal of this workshop is to use the database capabilities of the Excel program. After
today's workshop, participants will be able to:
• Sort a database
• Extract database information
• Use the subtotal function
• Adjust the spreadsheet windows
Prerequisites
It is assumed that the participants in this workshop have either taken the Excel
Introduction workshop or have equivalent skills.
Parts of a database/list
A database/list is made up of several parts. It is important to understand the terms
describing these parts:
Term Definition
Field Each column in a list is a separate field, and each of the cells within a
column is a field. A different field is used for each item that needs to be
accessed separately.
Field Name A field name is a name that identifies the data stored in a field. The top
row of a database must contain the field names.
Record A record is a single row in a database. Each record contains the same
categories of data as every other record in the database.
Creating a Database/list
After deciding on the design for a list, create the list by entering the data according to the
following guidelines:
List size: A list can be as large as an entire worksheet, but it is best to put only one list on
a worksheet. In addition make sure that there is a blank column and blank row between
the list and any other data on the worksheet. (This is not absolutely necessary but allows
Excel to select the list automatically.)
Field name location: The first row of the database must contain the field names.
Allowed values in field names: Field names must be text constants. If the field name
contains numbers, they must be formatted as text. Do not insert extra spaces at the
beginning of an entry into a field as this affects sorting and searching.
Field name length: A field name may contain a maximum of 255 characters. A field
name must not contain spaces.
Records: Every record must have the same fields, although data does not have to be
entered into each of the fields.
Capitalization: Use either uppercase or lowercase letters. Excel ignores capitalization
when searching a database.
Formulas: A field entry may include a worksheet formula that calculates field values
from other field values in the list.
Note: If you name the list ‘database’, Excel always identifies the first row of the
list as labels or field names. When working with the AutoFilter feature,
Excel automatically names the database for you so this step is not necessary.
To name a list:
1. Select the list area.
2. Click into the Name Box, and type
the name that you want to refer to the
list.
3. Press Enter to accept the change.
Note: If the column or row label of your worksheet is the same as the range name
you want to create, select the area and then choose Create… from the Name
submenu and Excel applies the appropriate label name to the range
automatically.
Sorting
After a database or list is created, Excel can organize or format the information quickly.
Sorting organizes the data in a list alphabetically, numerically, chronologically or in any
order you want. Sorting rearranges the rows (records) according to the contents of the
field (column). It is also possible to sort multiple fields as well as data within a single
column.
Note: If you sort data within a single column, it only sorts the data in that field. It
will not rearrange the rows.
Data Forms
Excel has a built in form feature that allows you to input data into a list. Let’s say that
you have a list of data that contains over 500 records. In order to add to the list you
would either have to scroll down to the bottom of the list or insert rows somewhere
within the list each time you wanted to add a new record. Let’s also say that there are
times when you quickly want to search for a record that you know meets a certain
criteria. Searching 500 records would be very time consuming. The built in form feature
can do away with that and help you easily input data as well as search for records
meeting criteria.
3. A data form will open and you’ll see the first record from your list in the form.
4. To add a record to the database list, click on the New button and the
fields will open up for you to type in your information.
5. To move from field to field, press the Tab key.
6. Once you’ve finished entering the first record, you can press Enter to enter another
new record or you can click the Close button to close the form.
Note: The Delete button will permanently delete the record that
is showing in the form. If you click this button, you will not be able to
use undo to retrieve the record.
6. Click on the Find Next to find the first record that meets your criteria.
Continue to click on Find Next until you have found the record(s) you want.
Note: You can also use the Find Previous button if you want to go
back up your list.
You cannot use this form to modify existing records when using the criteria
feature.
Types of Criteria
There are many different types of criteria you can use in your data form, including
operators. Here is a table of the different operators you can use and what they mean.
Operator Meaning
If you enter criteria into more than one field, Excel will use an implied And, which
means that the record must meet all of the criteria to be shown.
Filtering Data
One way of showing data from a list that meets certain conditions is by using filters.
Filtering extracts data from the list by identifying the subset of the data based on the
criteria you choose. There are two ways to filter for data in Excel, AutoFilter and
creating an Advanced Filter.
AutoFilter
A quick way to filter data contained in a list is by using AutoFilter. This filter
automatically provides certain criteria that can be used to extract a subset of data.
If the criteria provided do not list the options you need to create your data subset, it is
possible to create the criteria using the Custom… option. This option allows you to
customize your data so that you can display items that contain either of two values or
rows that contain values within a certain range. To create a filtered list using AutoFilter,
do the following:
1. Select any cell within your list.
2. Click on the Data menu, point to Filter, and choose AutoFilter from the submenu.
3. The AutoFilter will turn on and black drop-down arrows will automatically appear
beside every field name in your list.
4. Click on the drop-down arrow to choose filter criterion for a field.
5. When the criterion has been chosen, only rows that meet the criterion will be
displayed. The arrow beside the field name you chose and the numbers of the rows
will both turn blue.
Academic Computing Services -8- © 2003 The University of Kansas
A Division of Information Services
ACS Computer Training
Excel Data Management
6. If you need to filter for another field, you can continue to select criterion. Continuing
to do this creates an ‘and’ condition; therefore, in order for a row to show, it must
meet all of the criteria that you choose.
Once you have finished and are ready to display all of your data, click on the blue drop
down arrow of the field you had set criteria for and choose (All). If you chose more than
one criterion, you can click on the Data menu, point to Filter, and choose Show All.
Note: If you want to filter a list using only selected columns, choose only
those labels from those columns before applying the AutoFilter
command. You can only select adjacent columns.
Advanced Filters
Sometimes you might find the need to create more specialized filters that use the
operators “Or” or “And” and look for multiple criteria from several fields. Using
Advanced Filters in Excel can help you accomplish this. To create this type of filter in
Excel, you have to do two things: (1) set up the criteria and (2) execute the filter.
And
Sometimes you might find you need to find records that meet more than one criterion.
Anytime you place criteria on the same row, Excel uses the implied And operator. The
picture shown above represents the use of And. Here is another example as well.
Or
Another option is to search for records that meet any criteria that you choose. This is
useful when you want to search for multiple records that don’t necessarily have to meet
the same criteria. Using the above example, here is what changes it to an implied Or.
Notice that while the criteria and field names remained the same, the way in which the
criteria was created was changed. Instead of the criteria being on the same row, the
criteria for an implied Or was placed on different rows.
Complex Criteria
There might be times when you need to use both And and Or combinations in your
criteria range. For example, you might have the need to see employees from a certain
department that use the Lincoln Financial retirement plan or individuals from a different
department that use the TIAA-CREF retirement plan. Here is an example using our
movie data:
Note: If you choose to copy the filtered list to a different location, it must be
in the same worksheet that the original list is in. You cannot copy the
filtered list to a different worksheet.
Subtotals
Excel's Subtotal feature quickly summarizes data within a database or list. Based upon
the data you have selected, Excel can automatically calculate both subtotals and grand
totals within your list. Subtotals are based on organized or sorted groups of data.
Note: That does not mean the subtotal must be added to that column. It means that
for the At each change in: field, you must use the column name that you
sorted by.
Using the above example again, in this case, the column you would also apply the
subtotal to would be the department column. The number of times the department name
appears would tell you how many people worked in each department. Because you’re
subtotaling text (how many times the department name appears), you’re counting the
department name, so you would use the count function.
If you want to subtotal more than one column, use the second and third level sort options
to organize the list in the subtotal order.
Using the above example, you could count not only how many people are in each
department, but also how many people in a particular department use the Lincoln
Financial retirement plan. To do this, you would set the primary sort on department with
a secondary sort on retirement plans before using the subtotal feature. The first subtotal
would be based on a department field. The second subtotal would be based on a
retirement plan field, and would not replace the first one.
Displaying a Subtotal
Once you’ve organized your data, by at least a primary
sort, you’re ready to use Excel’s subtotal feature.
1. Select a cell within your list of data.
2. Click on the Data menu and click Subtotals….
3. In the At each change in: field, click on the drop
down arrow and select the field that is your primary
sort.
4. In the Use function: field, click on the drop down
arrow and choose which function you want to use.
This is the summary function you’d like to calculate
on your data.
5. To determine which values to calculate using the
function you selected, check one or more fields in
the Add subtotal to: field.
6. By default, Replace current subtotals and
Summary below data are checked. If you want the summary (total for each group)
to appear first and the details for each record appear next, uncheck the summary
below data box. If want to print each group on a separate page, check Page break
between groups.
7. Once you’ve selected your options, click OK.
Nested Subtotals
You can have multiple levels of subtotals, subtotals for smaller groups, within your
primary (original) subtotals groups. If you want another subtotal inside of the one you
just did, go back through steps #1 through #6, but for the At each change in: field,
choose the secondary sorted field. Also, make sure that you uncheck Replace current
subtotals so it doesn’t replace the one you previously did. These are called nested
subtotals.
Subtotal Outlines
When you subtotal, rows are added to display the subtotals, and the data list is organized
in outline format. At the top left, level markers display at the top of the worksheet
window and at the left, icons display that allow you to expand (+) and collapse (-)
individual groups.
Removing Subtotals
To remove subtotals from your database list, click on the Data menu and click
Subtotals…. When the subtotal dialog box opens, there is a Remove All
button at the bottom. When you click on this button, the dialog box will automatically
close and all of your subtotals will be removed.
Managing Windows
Every document is viewed in a window. There can be many windows for the same
document open on the screen or there can be one window for each of several documents
opened at the same time. When working with a database and using the Advanced Filter,
it is convenient to view the criteria in one window and the database in another.
To open another window for the same document:
1. Make sure that the window for the worksheet is active.
2. Choose New Window (Window menu). Excel uses the same worksheet name for
both the windows but adds a number to the name.
To activate a window, click anywhere in the window. All the windows that are
currently available are listed in the Window menu. Choosing any of these names
can also activate the window.
To move a window, drag it by its title bar. To move a window without activating it, hold
down the command key while dragging it by the title bar.
Note: If the document title bar is not visible, click the Restore button by the
menu bar to create a moveable window.
Splitting Windows
Rather than creating another window and scrolling each independently, a single window
can be split into panes by dragging either of the split bars to another location. Split bars
are located directly above the up arrow key on the vertical scroll bar, and directly left of
the left arrow key on the horizontal scroll bar. After splitting a window, its pane size
may be changed by dragging the split bar.
Remove a horizontal split by dragging the split bar to the top or bottom of the vertical
scroll bar. Remove a vertical split by dragging the split bar left or right on the horizontal
scroll bar.
Linking Data
If you want to link cells between spreadsheets, one way to do this is by using the Paste
Special dialog box.
1. Select the data you want to copy.
2. Use any copying commands or methods to copy the data to the clipboard (Ctrl -C,
Copy icon on toolbar, Edit menu).
3. Access the worksheet where you want to copy the data and select the appropriate cell.
4. Select the Edit command, select Paste Special, and click Paste Link button at the
lower right corner of the dialog box.
5. The link displays the value of the copied cell. Note however the formula in the
Formula bar. The formula displays the full path name of the copied cell.
Note: Linked cells are updated when the workbook that contains the linked cell is
opened.