You are on page 1of 66

Lesson 1.

Explore formulas and functions


Lesson 2. Multiple worksheets: working in 3D
Lesson 3. Copy data and formulas
Lesson 4. Advanced formatting features
Lesson 5. Explore the charting feature
Lesson 6. Use Excel as a database
Lesson 1. Explore formulas and functions
Introduction

Microsoft Excel is an extremely powerful application,


not only for doing spreadsheet calculations, but also for
charting, data gathering, and creating interactive Web
pages. In this course you'll tap into some of that power
and put it to work in your own worksheets!

Who should take this course?

This is a course for people who are already familiar with


Excel's basic operations. This course covers a lot of
ground, so make sure that you have mastered the
following before participating:

 Entering and editing text and numbers


 Creating simple formulas, including functions
 Formatting text in cells with various fonts, sizes,
attributes, and colors
 Placing and removing borders and shading in
cells
 Adding, deleting, moving, and resizing rows and
columns
 Saving, opening, and printing worksheets

If any of these activities are not in your repertoire, you


might find the Basic Excel course a better fit for you.
You can certainly take both classes simultaneously, or
even forge on through this one, but you might need to
consult a reference book or Excel's Online Help as you
go to keep up to speed.

What you'll learn

When most people think of advanced topics for Excel, the first
thing that springs to mind is functions. Functions are predefined
math formulas that help users perform complex calculations
without having to manually type complex formulas. This course
gives you a healthy dose of formula and function work in Lesson
1; it also goes into many other interesting topics that you may find
equally useful. Some of these include working with multiple
sheets, creating absolute and relative cell references, and
building charts to strategically convey a certain message. You
also learn how to use Excel as a database application, and how
to create OLE links to share content between Excel and other
applications.

Be sure to follow along with the examples in each chapter, and to


use the sample spreadsheets provided for downloading in the
Assignments. This course moves quickly, and the samples help
illustrate the topics we discuss.

In this lesson, we start with some of the special formulas and


functions that can help you become an Excel power user.

formulas
You're probably already familiar with the basics of Excel formulas, Microsoft Excel 2002
but let's do a quick review to make sure everyone is up to speed.

formulas: a basic review

Formulas in Excel begin with an equal sign (=). The equal sign is
followed by a combination of digits, cell references, parentheses,
and math operators.

The following table shows some example formulas. » Microsoft® Excel 2002
The comprehensive tools in
Microsoft® Excel 2002 make
it easy to create powerful
Formula Result spreadsheets and work with
=2+3 Sums 2 and 3. others to review and analyze
them. Excel 2002
=A2+3 Sums the value in cell A2 and the number 3. incorporates the productivity
=A2 Displays the same value as is in cell A2. and collaboration innovations
=A2-B2 Subtracts the value in B2 from the value in A2. of Office XP, such as Smart
Tags and Task Panes,
empowering financial
professionals and everyday
Table 1-1: Some common Excel formulas. users alike to access,
organize and analyze critical
order of operations business data.

It gets more complex when you start throwing more than two values
into the mix, of course. That's where order of operations becomes
important. The rules in Excel are the same as the rules in
mathematics in general, so operations are performed in the
following order:

1. Exponentiation is done, represented by a ^ sign.


2. Multiplication (*) and division (/) are done.
3. Addition (+) and subtraction (-) are done.

You can override the order of operations using parentheses, as the


examples in the following table show.

Formula Action
=A2+B2*C2 Multiply B2 and C2 and then add A2
=(A2+B2)*C2 Add A2 and B2, and then multiply by C2

=((A2+B2)*C2)+12 Add A2 and B2, multiply by C2, and then


add 12 to the result.
Take A2 to the 3rd power, multiply B2
=A2^3+B2*C2
times C2, and then add the two results.
Add B2 and 3, use that value as an
=A2^(3+B2)*C2 exponent for A2, and finally, multiply the
result by C2.

Table 1-2: Using parentheses to change the order of


operations.

Understanding the math behind a formula is critical when you start


getting into complex calculations.

After you enter a formula into a cell and press Enter, the result of
the formula -- not the formula itself -- appears in the cell. You can
see the formula by clicking the cell and looking in the Formula Bar
at the top of the screen. Here's a shortcut to look at all the formulas
in the worksheet at the same time: press Ctrl+` (that's Ctrl plus the
backward single-quote character at the top-left corner of your
keyboard). The results are shown in Figure 1-1. Press that key
combination again to return to normal viewing.

Figure 1-1: You can display formulas within the worksheet to help
you check for errors more easily.

Common functions
You're probably also familiar with the basics of Excel formulas, but let's do a quick review of them to
make sure everyone is up to speed.

Functions: a basic review

As you probably already know, a function is a type of formula. It's basically like a regular formula
except it uses a special named command to substitute for the math operators. For example, the
following formulas are equivalent:

=A1+A2+A3
=SUM(A1:A3)

The key to working with functions is to remember how their syntax differs from regular formulas.
The following table helps you:
Formula Function
Uses math operators (+, -, *, /, ^) Does not use math
operators
Refers to individual cells by their Refers to a range of cells
individual names with a colon
Does not use any text (except letters Uses a text-based function
in cell references or named ranges) name
Uses parentheses only if needed to Requires a set of
change the mathematical order of parentheses following the
operations function name

Table 1-3: Differences in formula and function syntax.

In some cases, you can do the same thing with either a formula or a function. It's up to you. For
example, you can average a group of numbers either way:

Formula method: =(A1+A2+A3+A4)/4

Function method: =AVERAGE(A1:A4)

However, most of the functions provide some special service that it would be difficult or impossible
to do with regular math operators. For instance, the MIN function examines all the values in a
certain range and tells you which value is the smallest; that's not something you can do with regular
math formulas.

Function arguments

The parentheses that follow a function contain the function's arguments. The arguments consist of
the range of cells that should be included, but may incorporate other information as well. Excel
provides help on each function, including explaining its arguments, when you use Insert Function.

For example, the ROUND function rounds a value to a certain number of digits. In addition to
specifying the value to be rounded, you must specify the number of decimal places, like this:

=ROUND(B4,0)

This example rounds the value in B4 to the nearest whole number (zero decimal places). The
ROUND function requires both arguments; if you try to leave one of them out, an error appears.

A more complex example is the PMT function, which computes what the payment would be on a
loan. For this function, you need to provide the following:

* Interest rate (Rate) per month. You can use the yearly rate followed by /12 to
get the monthly rate.

* Number of payments (Nper).

* Present value (Pv).

* Future value (Fv), optional, assumed to be 0 if omitted.

* Type, indicating whether payment is at beginning of period (1) or end (0).


Assumed to be 0 if omitted.

The syntax for the PMT function is:

=PMT(Rate,Nper,Pv,Fv,Type)

Replace Rate, Nper, Pv, Fv, and Type with actual cell references or numbers. The Rate, Nper,
and Pv are required but Fv and Type are not.

For example, here's what you'd use to compute the payments on a $10,000 loan at 6 percent
interest for 60 months:

=PMT(6%/12,60,10000)

To use the monthly interest rate rather than the yearly, and to use decimal places instead of the
percent sign, the function would be

=PMT(0.005,60,10000)

Some people find it difficult to remember all the arguments for complex functions, such as PMT, but
rest assured that you don't have to. You can find the arguments for any function using the Insert
Function feature in Excel. To do so:

1. Click the cell that should contain the formula.


2. 2. Click the Insert Function button on the formula bar. (It's the fx button to the immediate
left of the Formula Bar. An Insert Function dialog box appears.
3. 3. Select the category of function you want, and then select the function itself. In Figure 1-
2, we select the PMT function. Click OK. A dialog box appears with specific help for that
function.

Figure 1-2: Select the function you want.

4. In the dialog box for that function, enter the arguments into the boxes provided, as shown
in Figure 1-3. Click OK to enter the function into the cell.
Figure 1-3: Fill in the arguments for the function.

The result is a negative number because a payment reduces the amount owed on the loan.

function practice
The following table shows some of the most popular functions, add some color to your
along with examples of how they work. life

Function Example What It Does


SUM =SUM(A1:A4) Sums the values in cells A1, A2,
A3, and A4
AVERAGE =AVERAGE(A1:A4) Adds the values in A1, A2, A3,
and A4, and then divides them by » color hp LaserJet printers
the number of values (in this From mobile color laser
case, 4). printers to high end color
laser printers, HP has the
MAX =MAX(A1:A4) Reports the largest value among
right printer for you.
the entries in cells A1 through A4.
MIN =MIN(A1:A4) Reports the smallest value among
the entries in cells A1 through A4.
need help choosing?
COUNT =COUNT(A1:A4) Reports the number of cells
containing numeric entries (not
text) in the range A1 through A4.
TODAY =TODAY() Reports today's date. Notice the
empty parentheses. That's
because every function requires
parentheses even if there are no » printers buying guide
arguments. The printers product buying
NOW =NOW() Reports the current date and guide was developed to assist
time. Like TODAY, it also has you in selecting the best
product for your needs.
empty parentheses after it.
Discover the latest in
technology and learn about
the key features to consider
Table 1-4: How functions work. when purchasing a printer.
You will also find important
Let's try some examples. Figure 1-4 shows the data for our links to special product offers,
examples. Re-create Figure 1-4 in an Excel spreadsheet to follow solution information,
along. technology tips, comparison
tools and more.

Figure 1-4: Create this worksheet shell for the examples.

1. In cell B1, use a function to display today's date.


2. In cell B8, use a function to sum B4:B6.
3. In cell B9, use a function to display the minimum value
from B4:B6.
4. In cell B10, use a function to display the maximum value
from B4:B6.
5. In cell B11, use a function to display the average value
from B4:B6.
6. In cell B12, use a function to count the number of
salespeople.

If you do it correctly, the results appear as in Figure 1-5. If your


numbers are different, check your work.

Figure 1-5: These are the results you'll get.

Figure 1-6 shows the formulas behind each of the cells. No peeking
until you've done the work, or you'll spoil your learning experience!
Figure 1-6: These are the functions you should have used.

using IF functions

An IF function can be especially useful in setting up a conditional statement. This is a very


common need in real-life Excel usage. For example, you might want to

 Calculate a bonus amount if a certain cell contains a number that is over a specified value;
otherwise, do not calculate a bonus.
 Mark a date entry as on time if it occurs before a certain date; otherwise, mark it as late.
 Mark a class as full if it has more than a specified number of students enrolled; otherwise,
mark it as available.

The IF function has these arguments:

=IF(condition, value_if_true, value_otherwise)

So, to multiply the value in cell A2 by 1.15 if the original value is over 1000, but otherwise do
nothing, use this formula:

=IF(A2>1000,A2*1.15,A2)

In other words, if A2 is greater than 1000, multiply A2 by 1.15; otherwise, simply repeat the value of
A2.

Suppose you want the words On Time to appear in cell B6 if the value in B5 is 06/01/03 or earlier,
and the word Late to appear in B6 if the value in B5 is 06/02/03 or later (greater). Use this formula:

=IF(B6<=06/01/03,"On Time","Late")

Finally, suppose the maximum number of students that can be enrolled in the class shown in Figure
1-7 is seven. We're using the =COUNT function in cell C16 to determine the number of students,
and we want the words Available or Full to appear in cell B3, depending on the count.
Figure 1-7: An IF function can be used to display text based on a value in some other cell.

Here's the function we want to use:

=IF(C16>6,"Full","Available")

functions that work with text


So far, the functions you've worked with act mainly on numbers. new products from hp
There's a whole set of functions designed to apply to text as well. In
this section, you learn about these functions.

count nonblank cells

» new products
As you learned earlier, the COUNT function counts the number of
Introducing the latest products
cells in a range that contain numbers. If you want to count all the
from HP that help you do your
cells that contain anything (text or numbers), you must use the
business better, faster and at
COUNTA function instead. This could be useful in the Figure 1-7
a lower cost. Take the time to
example, in which we counted the values in column C because browse the latest products
those were numbers. The primary purpose of column C was to give and see how they can make
us something numeric we could count. However, if we use the an impact on your business.
COUNTA function, we can count columns A or B instead.

To count the number of nonblank cells in the range C7 through


C15, for example, use the function

=COUNTA(C7:C15)
concatenate cell content

Let's say that you have people's first names in one column and last
names in another, but for some reason, you now need them to be
combined. You could use the CONCATENATE function to do just
that.
Suppose the first names are in column A and last names in column
B, starting with row 3. We'll create a function in cell C3, and then
copy it to the other cells in column C, as shown here.

=CONCATENATE(A3,B3)

This function works, but it runs the first and last names together
without a space. If you want a space between them, include
another value: a single space, in quotation marks, between them,
like this:

=CONCATENATE(A3," ",B3)

TIP
Suppose that you want to use the names from column C
somewhere else. If you use a simple copy-and-paste operation, you
copy and paste the functions in column C, rather than the data.
Instead, copy the data normally and then choose Edit > Paste
Special. A dialog box appears that allows you to select Values as
the object to paste.

compare text strings

It's easy to use math operators to see whether numeric values are
equal. With text, however, it's more difficult. The EXACT function
helps do it.

Let's say, for example, that you have a list of people's names, as
shown in Figure 1-8. You want to send mailings to everyone whose
status is Alumni. To do this, you enter the following in D3:

=EXACT(C3,"Alumni")

This function compares the value in the specified cell to a text


string, and displays either TRUE or FALSE in the cell. It's kind of
like an IF statement except you don't get to specify what happens
when the condition is true or false. You can also compare two
different cells' contents, rather than one cell and one text string.

Figure 1-8: You can use an EXACT function to compare the values
in column C to a specified text string and report TRUE or FALSE for
a match in column D.

Convert text case

If someone else does your data entry for you, you may find that the
capitalization entered is not the capitalization you would like. To fix
it, you can use the LOWER, UPPER, or PROPER functions.

For example, suppose the names in Figure 1-8 were inconsistently


capitalized. To consistently capitalize them, follow these steps:

1. In cell E3, enter =PROPER(A3).


2. In cell F3, enter =PROPER(B3).
3. Copy the contents of E3:F3 and paste them down to
E12:F12.
4. Copy E3:F12 to the Clipboard.
5. Use Paste Special to paste the values of the Clipboard
contents into A3:B12, overwriting the existing values.
6. Clear E3:F12.

Notice what's going on in these steps. First of all, you temporarily


create a duplicate of columns A and B, for working purposes. Then,
you copy that data to the Clipboard, and paste only the values. You
don't want to paste the functions because you're overwriting the
cells that contained the original data. Finally, you delete the your
temporary working area (E3:F12).

using nested functions


Sometimes in Excel you may want to do several calculations at once. Now and then it's easier to do
it in several steps, but other times you may want to combine it all into a single formula.

For example, suppose cells A3, B3, and C3 contain values, and you want to compute their average,
and then subtract that result from 1000. You could do it two different ways:

In D3, you could use =AVERAGE(A3:C3) to get the average, and then in E3 you
could use =1000-D3 to do the subtraction.

In D3, you could enter =1000-(AVERAGE(A3:C3)).

The key thing to notice is that there's no equal sign immediately preceding the word AVERAGE in
the second example. That's because even though we nearly always see = and the function adjacent
to one another, they actually are not directly related. In Excel, you start every formula with an equal
sign, and customarily the function name comes next. But as you can see in that second example, it
doesn't necessarily have to.

Let's look at a more complex example. Suppose you want to determine the average of A3:C3, and if
it is more than 400, you want to display Yes. Otherwise, you want to display No. This would
combine an AVERAGE function with an IF function like so:

=IF(AVERAGE(A3:C3)>400,"Yes","No")

Notice where the parentheses fall. The first (or outer) set is for the IF function; the second, inner
set is for the AVERAGE function.
moving on

In this lesson, you got to experiment with some of Excel's functions, including functions for financial
calculations, number comparisons such as minimum and maximum, and functions that help you
manage and compare text strings. The next lesson discusses how to work with data ranges on
multiple sheets in a workbook, for 3D calculations.

Before you go on to Lesson 2, don't forget to tackle the quiz and do the assignment. If you have any
questions, post them on the Message Board. Even if you don't have questions, it's worth visiting the
Message Board to touch base with your instructor and see what your fellow students are up to.

Question 1

If you entered the formula =3*2+2*6 in Excel, what result would you get?
A) 18
B) 72
C) 48
D) None of the above

Question 2

You want to add the contents of cells A1, A2, A3, and A4. Which of these are correct ways
of doing it?
A) =(A1:A4)
B) =SUM(A1:A4)
C) =SUM(A1 A2 A3 A4)
D) =A1+A2+A3+A4

Question 3

What are the arguments for the NPER function, in the correct order? (Hint: This question
tests whether you can look up a function's arguments in Excel; it does not expect that
you have them memorized.)
A) Pmt, Rate, Pv, Fv, Type
B) Pv, Pmt, Rate, Type
C) Fv, Pv, Type, Rate
D) Rate, Pmt, Pv, Fv, Type

Question 4

When writing an IF function with some other function embedded inside it, where do you
place the equal sign which indicates a function.
A) Before each function name
B) At the beginning of the IF function only
C) Nowhere; you omit it with IF functions
D) Can be any of the above depending on the situation

Question 5

What function do you use when you want to count nonblank cells in a range regardless of
their content?
A) COUNT
B) DCOUNT
C) ACOUNT
D) COUNTA
Lesson 2. Multiple worksheets: working in 3D
add and delete sheets
Most people are accustomed to working with Excel in two dimensions: across and down. But did
you know that, by default, each Excel workbook actually consists of three separate sheets? What's
more, you can add as many sheets as you need to the workbook. You can think of the Excel
workbook file as a ring binder that is almost infinitely expandable to hold more pages.

add a sheet

To add a sheet, do the following:

1. Select the tab for the sheet that the new one should be placed to the left of. This will be the
new sheet's initial location, but you can move it after inserting it as described later in this
lesson.
2. Right-click the tab of an existing sheet, and choose Insert. The Insert dialog box appears,
as shown in Figure 2-1.
3. Click Worksheet, and then click OK.

Figure 2-1: Insert a new worksheet into the workbook.

Notice in Figure 2-1 that there are other things you can insert besides worksheets. However, most
of these are rather specialized and there are other, easier ways of inserting them. For example, as
you'll learn in Lesson 5, there are better ways to create a new chart than using Insert.

Delete a sheet

When I'm using only one sheet in a workbook, I typically delete the remaining blank sheets. This
prevents potential problems if I give the workbook to a less-experienced user who might
accidentally click one of the other worksheet tabs and wonder where all the data went. You can also
delete a worksheet just because you want to get rid of whatever's on it.

WARNING
When you delete a worksheet, you delete everything on it automatically, and you cannot use the
Undo command to undo a sheet deletion. So don't get carried away and delete worksheets you
need to keep.
There are a couple of ways to delete a worksheet:

 Right-click the worksheet tab and choose Delete.


 Choose Edit > Delete Sheet.

If the sheet contains any data, a confirmation box appears and you must click the Delete button in it
to confirm the deletion. If the sheet is empty, there's no confirmation dialog box.

move and copy sheets


Worksheet tabs are arranged from left to right at the bottom of the convenience at your
workbook window, as you already know. When you insert a new fingertips
worksheet, it might not be exactly where you want it. That's okay,
though, because you can rearrange the stack of worksheets any
way you want them. You can also duplicate sheets--along with
their data--to save yourself some data-entry time when creating
several similar sheets.

move or copy a sheet within a workbook

» hp business solutions
To move a sheet's position in the workbook, or to make a copy of catalog request
it, do the following: For US customers who want
to buy direct from HP or from
a preferred local reseller, HP's
1. If you're copying (rather than moving) the sheet, hold catalog provides a selection
down the Ctrl key and keep it down. of best-selling products,
2. Point to the sheet tab you want to move, and then hold promotions, services, and free
down the left mouse button. The mouse pointer turns into online classes.
an arrow with a piece of paper on it. If you're copying, the
piece of paper has a plus sign on it.
3. Drag to the left or right to move the selected sheet to a
different position. As you drag, a black triangle shows
where the sheet will drop if you release the mouse
button, as shown in Figure 2-2.
4. Release the mouse button and then release the Ctrl key
if you were holding it down.

Figure 2-2: Move a sheet by dragging it to the left or right.

move or copy a sheet to another workbook

You can also move or copy a worksheet to another workbook, but


to do that, you must use a dialog box method. Here's how:

1. Right-click the worksheet tab and choose Move or Copy.


The Move or Copy dialog box, shown in Figure 2-3,
opens.
Figure 2-3: You can move or copy worksheets between
workbooks with this dialog box.

2. Open the To Book drop-down list, and select the


workbook in which to copy it. All open workbooks appear
on this list.
3. Click the sheet before which the new one should appear,
or click (move to end) if you want it to be the last one.
4. If you want a copy, mark the Create a copy checkbox.
5. Click OK. The worksheet is moved or copied.

name and color-code sheets


Each sheet starts out with a generic name like Sheet1, Sheet2, and amazing deals
so on. When you insert new sheets, their default names continue
with that naming convention. For example, in a workbook with three
sheets, the next new sheet is called Sheet4 (unless it were a copy
of some other sheet, in which case its name would be based on the
original.).

The location in which you insert a new sheet makes no difference


to its naming. For example, a sheet inserted to the left of Sheet2 » special offers -- desktops
would not be called Sheet1; it would be called Sheet4 or whatever
HP offers great deals on
the next available name was.
desktops. Browse our page of
top specials today.
Rename a worksheet

To rename a sheet, you can do either of the following:

 Double-click the sheet tab and then type a new name.


 Right-click the sheet tab, choose Rename, and then type a
new name.

The longer the name, the wider the tab is, so if you plan on having
lots of worksheets in the workbook, keep the tab names brief. If the
tabs take up more room than is available, a scroll bar becomes
active, enabling you to scroll right and left through the tabs, as
shown in Figure 2-4.
Figure 2-4: Scroll through the tabs.

View a larger version of this file.

TIP
Keeping worksheet names short helps you in several ways. It
makes it possible to see more tabs onscreen at once, and it also
means that you have less to type when referring to a sheet name in
a formula or function, for example.

color-code the worksheet tabs

Worksheet tabs are not colored by default, but can be changed to


any color you like. This can be useful for grouping worksheets into
logical categories, for example, or making a particular worksheet's
tab stand out from the rest.

To set the color for a worksheet tab, do the following:

1. Right-click the tab and choose Tab Color. The Tab Color
dialog box appears, as shown in Figure 2-5.

Figure 2-5: Select a tab color.

2. Click the color you want, and then click OK. The tab
appears mostly white with a thin strip of the color you
selected beneath it.
3. Click a different tab to send the one you just colored into
the background. Once in the background, its tab changes
to a solid version of the color you chose.

The text on the tab also may change color depending on the color
you chose. For light colors, it remains black, but for dark colors the
text changes to white when the tab is not selected.

refer to a cell or range on another sheet


A 3D reference is one that includes a reference to one or more cells that is not on the same
worksheet as the formula. For example, you might create a Summary sheet that pulls in totals from
each of several other sheets in the workbook.

You're already familiar with the way area codes in phone numbers work, right? When you're dialing
a number that's within your area code, you usually don't have to dial the area code. It's only when
you're calling outside it that the area code becomes necessary.

It's the same thing with sheet names. If a formula refers to a cell on the same sheet, the sheet
name can be left out; otherwise, it must be included.

Sheet names appear in formulas with an exclamation point after their names, like this:

Sheet1!

So, for example, if I want to refer to cell A2 on Sheet2, the full way of expressing that is

Sheet2!A2

Ranges work the same way. The range of A2:C6 on Sheet2 is

Sheet2!A2:C6

If you only want to repeat the value of whatever is in the cell, just precede it with an equal sign:

=Sheet2!A2

You can also use it in calculations, just like a normal cell or range. For example:

=SUM(Sheet2!A2:C6)

If you don't remember the sheet name and it isn't convenient to look it up, you can create a formula
by selecting instead. Let's say, for example, that you want to create the preceding formula example
by selecting. Here's how you would do it:

1. Click in the cell where the formula should appear, and type

=SUM(

2. Click the tab for the sheet containing the cells to which you want to refer. (In our example,
that's Sheet2.)
3. Select the cells you want to refer to. (In our example, that's A2:C6.)
4. Press Enter. You're returned to your original formula, with the sheet name and range filled
in.
5. Type ) -- the closing parenthesis -- and press Enter.

TIP
You can also use this process to refer to cells and ranges in other workbooks.

create a 3d range
A 3D range is a range that includes the same cell(s) on more than one sheet. This can be helpful
when you have multiple sheets that all contain basically the same information but for different
groups, people, organizations, months, or other distinguishing factor. You can use a 3D range to
perform calculations upon the same fields on each of the sheets.
For example, suppose you have 12 worksheets, one for each month of the year. On each sheet,
cell D12 contains the total sales. You could create a SUM function that uses as its range the
contents of cell D12 on each of the sheets.

To create a 3D range:

1. Start out your formula or function normally, until you get to the part where you would enter
the range.
2. Click the tab of the first sheet in the range.
3. Hold down the Shift key and click the tab of the last sheet in the range. All the tabs will
appear selected (white). Release the Shift key.
4. Select the cell(s) you want to refer to on each sheet, and then press Enter. You're returned
to the formula or function you were constructing in Step 1.
5. Finish the formula or function. For example, you might need to add a closing parenthesis
for a function.

You can also manually write a 3D range in a formula. Simply refer to the sheet names in a range,
with the first and last sheet names separated by a colon. For the earlier example with 12 months of
sheets and summing the values in D12, the formula would look like this:

=SUM(Sheet1:Sheet12!D12)

Of course, in real life, you'd probably have named the worksheet tabs for each month, so it might
look more like this:

=SUM(January:December!D12)
moving on

In this lesson you learned how to work with multiple sheets in a workbook, including how to refer to
specific sheets on formulas and functions. The next lesson covers how to move and copy data in a
workbook and includes the important topic of relative versus absolute cell references.

Before you go on to Lesson 3, don't forget to tackle the quiz and do the assignment. They help
reinforce what you've learned so far. Visit the Message Board to touch base with your instructor and
see what your fellow students are up to -- and post any questions you may have.

Question 1

When you add a new sheet by right-clicking an existing sheet tab and choosing Insert,
where does the new sheet appear?
A) To the right of the sheet tab you clicked
B) To the left of the sheet tab you clicked
C) Either to the right or left; a box prompts you to choose
D) At the far right of the existing tabs

Question 2

When deleting a worksheet, a confirmation box sometimes appears, but not always.
When does it happen?
A) It appears only if you have three or more worksheets already.
B) It appears only if the sheet being deleted contains references to other sheets.
C) It appears only if the sheet being deleted is not blank.
D) It appears only if you hold down F2 while issuing the Delete command.

Question 3
When copying a worksheet to another existing workbook, you must ______.
A) make sure the workbooks have the same name
B) create a new sheet in the destination workbook first
C) make sure they are both open
D) All of the above.

Question 4

After you color-code a worksheet tab, it appears as a white tab with a thin strip of color
under it. What is wrong?
A) You chose an invalid color.
B) You applied the color using the Fill command.
C) There's already another tab in the workbook with the same color.
D) Nothing is wrong, this is normal.

Question 5

What formula would correctly refer to cells D2:D8 on worksheets named Sheet2, Sheet3,
and Sheet4?
A) Sheet2!D2:Sheet4!D8
B) Sheet2:Sheet4!D2:D8
C) Sheet2-Sheet4:D2:D8
D) None of the above
Lesson 3. Copy data and formulas
copy cell content
In the preceding lesson, you learned about 3D references in worksheets, which enable you to work
with data among multiple sheets in a workbook. Now you're no longer limited to two dimensions!

In this lesson, you learn about copying data and formulas in a workbook, and the consequences of
doing so in various ways. This can be a challenging topic, not so much because of the actions you
take in Excel, but because of the thinking involved in knowing what actions to take. Make sure you
follow along with all the examples in this lesson, and don't hesitate to ask questions on the class's
Message Board.

copy data

The traditional way of copying data is with the Copy and Paste commands. It's quick, especially
when you use shortcut keys (Ctrl+C for Copy and Ctrl+V for Paste). You can use the Copy and
Paste commands from the Edit menu, the Copy and Paste buttons on the toolbar, or the shortcut
key methods. Copying data this way always results in an exact copy of any data (rather than a filled
series, as explained later); copying formulas this way changes any cell references in the formulas to
be relative to the new location (more about this in a moment).

Another quick way of copying is with drag-and-drop. Drag-and-drop typically moves things, rather
than copies them, but hold down the Ctrl key while you drag to make a copy.

use AutoFill

AutoFill provides a fast way of putting repetitive data into cells. This data can consist of the same
value in every cell, or it can consist of a series.

A fill series increments in a predictable way, such as counting by 1s (1, 2, 3, 4), counting by 3s (1,
4, 7, 10), listing the days of the week (Monday, Tuesday, Wednesday), or some other value that has
a regular interval.

The AutoFill handle is the black square in the bottom right corner of a selected cell or range.
Dragging that black square fills adjacent cells with the AutoFill content.

Depending on what you're filling, you'll get different results if you select a single cell and then drag
the AutoFill handle. That's because Excel tries to guess what you want:

 If the cell contains a word in a defined AutoFill series, such as Monday, dragging fills
adjacent cells with that series.
 If the cell contains a numeric value, dragging fills adjacent cells with that same numeric
value.
 If the cell contains text that is not part of a defined AutoFill series -- Steve, for example --
dragging fills adjacent cells with that word.
 If the cell contains a formula that refers to other cells by their addresses, dragging creates
copies of it in adjacent cells with the cell references changed to reflect the new position.
For example, if cell B3 contains the formula =B1+B2, and you AutoFill that formula into C3,
the formula changes to =C1+C2.

Here are some examples to try:

1. Enter your name in a cell, and then drag the AutoFill handle.
2. Enter Monday in a cell, and then drag the AutoFill handle. Then try it with January instead.
3. Enter 1002 in a cell, and then drag the AutoFill handle.
4. Enter 1002 in one cell, and then enter 1003 in an adjacent cell. Select both cells, and then
drag the AutoFill handle.
5. Enter A505 in one cell, and enter A510 in an adjacent cell. Select both cells, and then drag
the AutoFill handle.
6. Enter 01/15/2003 in one cell, and 01/21/2003 in an adjacent cell. Select both cells, and
then drag the AutoFill handle.
7. Start a new worksheet, and enter the data shown in Figure 3-1. Then in cell D2, enter a
formula that sums B2:C2.
8. Select cell D2 and drag its AutoFill handle down to cells D3 through D5. Then check out the
formulas that appear in those cells.

Figure 3-1: Use this data to practice copying formulas with AutoFill.

create a custom fill series


In the preceding examples, you saw that dragging January or Monday produced a fill series, but
dragging your name produced only identical copies of your name. That's because week and month
names are predefined fill series.

You can define your own fill series in Excel. For example, suppose your company has nine branch
offices in various cities; you could create a custom fill series consisting of the names of those cities.

To define a custom series:

1. Choose Tools > Options, and click the Custom Lists tab.
2. Click NEW LIST, and then enter the list items in the List Entries box, one per line, as
shown in Figure 3-2.
3. Click OK. Your list is created.

You don't have to name a list; its name is its list members. If you choose Tools > Options and click
the Custom Lists tab again, you see the list you just created.
Figure 3-2: Create a custom list.

You can also create a custom list based on data already entered in a worksheet; this saves you the
trouble of retyping it. To do this, follow these steps:

1. Open a worksheet that contains the data to be in the series in contiguous cells in a single
row or column. Make a note of the cell range.
2. Choose Tools > Options, and click the Custom Lists tab.
3. Enter the cell range in the Import text box; or click the Select button next to the Import text
box and then manually select the range and press Enter.
4. Click the Import button. The range is imported as a new custom fill series.
5. Click OK. Your list is created.

You can delete a custom fill series by selecting it on the list in the Options dialog box, as shown in
Figure 3-2, and clicking Delete. You can't delete the predefined series that come with Excel; you
can delete only series that you (or other users) created.

use absolute references


As you saw earlier in this lesson, when you copy a formula, Excel need more speed?
tries to change the cell references so that they are appropriate to
the new location. It does this whether you copy with AutoFill or
using more traditional methods such as Copy and Paste.

Most of the time, this is a good thing. However, sometimes you


might not want the cell references to change. For example,
suppose you put the current interest rate in cell F1, and you want » memory configurator
each formula in the worksheet to include it in its calculation. In a Working with large amounts
case like that, you would want F1 to remain F1 no matter where of data can drain your
you copied the formula. computer's resources. Boost
the performance of your
To "lock" a reference so that it won't change when you copy it to notebook, desktop, or server
another location, you use an absolute reference by adding a dollar by adding additional memory,
sign ($) before the row and before the column. So, for example, F1 or increase storage on your
becomes $F$1. If you want to lock only the row, use the dollar sign camera or PDA by adding a
only before the number, like this: F$1. To lock only the column, memory card. Use our
place the dollar sign only before the letter, like this: $F1. memory configurator to find
the right memory for your
product.
Sounds pretty simple, doesn't it? Yet for some reason absolute
references are difficult for many people to "get" conceptually.
Therefore, the rest of this lesson is devoted to giving you practice
using these references.

If you want to follow along with the examples, enter the text and
numbers shown in each figure and then follow the instructions.

Example 1: interest rate

Let's start by doing a simple amortization table for a loan using an


absolute reference.

1. Recreate the worksheet shown in Figure 3-3.

Figure 3-3: Use this data for the example.

2. In cell B2, enter =B1/12. This divides the annual


percentage rate by 12 to produce the monthly interest rate.
3. In cell B5, enter the beginning balance for the loan. (We'll
use $10,000 in this example, but you can use any amount
you like. You also can change the annual percentage rate
in cell B1 if you want to -- don't forget the percent sign.)
4. In cell C5, enter the amount you'll pay on the loan each
month. For our example, we'll use $300.
5. In cell D5, enter =B5*$B$2. This multiplies the current
balance by an absolute reference to B2.
6. In cell E5, enter =C5-D5. This deducts the interest paid
from the amount of the payment; the result is the amount
by which the principal should be reduced.
7. In cell B6, enter =B5-E5. This changes the balance by
subtracting the principal paid in the previous month.
8. Copy the contents of D5:E5 down through D24:E24 using
AutoFill.
9. Copy the content of C5 down through C24 using AutoFill.
(You have to do this separately from Step 9, or AutoFill
increments the payment, and you don't want that.)
10. Copy the content of B6 down through cell B24 using
AutoFill.

Figure 3-4 shows the result.

Figure 3-4: The finished example file.

More practice with absolute references


Let's look at some more examples of using absolute references, because understanding them
thoroughly is very important. By the time you're finished with this lesson and the assignment, you
should understand them thoroughly.

example 2: sale prices

For this example, we look at how some prices are affected by a certain percentage of markdown at
a retail store. Suppose you have been directed to create a price list for items that are going to be
discounted for a sales event.

Start by reproducing the worksheet shown in Figure 3-5.


Figure 3-5: Start with this worksheet data.

1. In cells A6 and A7, respectively, enter $1.49 and $1.99.


2. Select cells A6 and A7, and then fill the series down to cell A24. Cell A24 should show a
price of $10.49.
3. In cell B3, enter the percentage off the regular price that you want to discount the items.
For this example we use 25%. Don't forget the percent sign.
4. In cell B6, enter =A6-(A6*$B$3). This multiplies the original price by the percent off, and
then subtracts it from the original price to determine the new price.
5. Copy the formula in B6 down through B24 with AutoFill. If you do it correctly, the sale price
in B24 will be $7.87. Figure 3-6 shows the completed worksheet.
Figure 3-6: The finished example file.

example 3: investment income

If you place a certain sum of money today in a savings account, at a certain interest rate earned,
how much will you have in 1 year, assuming interest is compounded monthly? In this final example,
you answer that question.

Set up a worksheet that places the beginning balance and the interest rate in separate cells at the
top. You'll refer to them in other formulas in the worksheet. Figure 3-7 shows one way to do it, but
you'll need to figure out the formulas -- and which values should be absolute references -- on your
own.
Figure 3-7: See if you can figure out the formulas to use for this worksheet to produce these results.

moving on

In this lesson, you learned about copying data and formulas, and the consequences of using
relative and absolute references. Try your hand at the assignment next, and then test your
knowledge with the quiz. In Lesson 4, we talk about some advanced formatting features such as
Format Painter, conditional formatting, and custom number formats that help you make your
worksheets attractive with a minimum of effort.

Remember to check the Message Board to see what your fellow students are up to. The Message
Board is a great place to check in with your instructor and to post any questions you may have, too.

Question 1

What keys do you press to paste data from the Clipboard?


A) Ctr+V
B) Ctrl+P
C) Ctrl+Z
D) Ctrl+X

Question 2

The AutoFill handle is in which corner of a selected range?


A) Top right
B) Bottom right
C) Top left
D) Bottom left

Question 3

What menu command would you use to start setting up a custom fill series?
A) Data > Options
B) Data > Custom Series
C) Tools > Options
D) View > AutoFill

Question 4

Which reference to cell A1 would keep both the row and the column static when copied?
A) A$1$
B) $A1
C) A1$
D) $A$1

Question 5

If you wanted the row to stay static but the column to change when copied, what
reference would you use?
A) A$1
B) $A1
C) A1$
D) $A$1
Lesson 4. Advanced formatting features
Copy and clear formatting
In the last lesson, we covered copying, and the implications of relative and absolute references. In
this lesson, we focus on formatting. You probably already know about the basics of formatting such
as bold, italic, fonts, colors, and shading, but this lesson takes you one step farther.

automatic format copying

Excel sometimes copies formatting for you automatically. To try this out, perform the following
experiment:

1. In cell A1, type Spring.


2. In cell B1, type Fall.
3. Select A1:B1, and format them as Arial 12-point bold.
4. Insert a new column between the two columns, and in the new B1, type Summer. Notice
that Excel formats it the same as the cells that it's between.
5. Click on Fall (in cell C1), and press Tab. The cursor moves to D1.
6. Type Winter. Notice that Excel formats it the same as the other cells.

format painter

If Excel doesn't automatically copy the formatting the way you want, you can manually copy it with
Format Painter.

1. Click the cell containing the formatting to be copied.


2. Click the Format Painter button on the toolbar, as shown in Figure 4-1.

Figure 4-1: Click the Format Painter button to copy formatting.

3. Click the cell to receive the formatting, or drag across multiple cells to format them.

Format Painter then turns itself off. If you want it to stay on, double-click rather than click as in Step
2; it remains on and you can copy the formatting to multiple selections until you turn off Format
Painter manually by pressing Esc.

To try out Format Painter:

1. Type some text in cell B6, and then type some more text in D10.
2. Format the text in B6 with a border, some shading, and a different-color font.
3. Click on B6, and then click the Format Painter button.
4. Click on D10. The formatting is copied.

Clear formats

One way to put a cell's formatting back to normal is to use Format Painter to copy the formatting
from a cell that is not formatted to the cell that is.
Another way, perhaps a better way, is to clear formatting like this:

1. Select the cell that you want to clear.


2. Choose Edit > Clear > Formats.

Give this a try on some of the cells you've formatted in the preceding sets of steps.

Apply conditional formatting


Conditional formatting is formatting that appears different depending on what the cell contains.
One example of this is a cell that displays negative numbers in red and positive ones in black, but
the feature is very rich and can apply all types of formatting, not just colors.

Suppose you have a worksheet on which you enter monthly sales totals. If any salesperson's three-
month average falls below $10,000 at any point, you want that cell to appear shaded with yellow,
indicating that the salesperson is on probation. Figure 4-2 shows an example.

Figure 4-2: This worksheet uses conditional formatting to check for trouble with low productivity.

You could even go a step further with this example and set it up to show yellow if the value was
between $9,000 and $9,999, and red if it were less than $9,000.

To create a conditional format:

1. Select the cell(s).


2. Choose Format > Conditional Formatting. The Conditional Formatting dialog box opens.
3. Set up criteria for the first condition. The most common way is to set it up by cell value, as
shown in Figure 4-3. Make your selections from the drop-down lists. Then either enter a
fixed value to compare to, or enter a cell address.

Figure 4-3: Create a conditional format.

4. Click the Format button. The Format Cells dialog box opens.
5. Use the Format Cells dialog box to set up the formatting for the condition, as shown in
Figure 4-4. You can choose character formatting (Font tab), borders around the cell
(Border tab), and background shading for the cell (Patterns tab).
6. Click OK.

Figure 4-4: Specify the formatting for the condition.

7. If you want to set up another condition, click the Add button and repeat the process.
Otherwise click OK.
8. Test your formatting by changing the values to simulate the condition being triggered.

Work with standard number formats


Number formats are applied to cells and affect the way numbers appear in them. They don't affect
text entries in a cell. Examples of number formats include Currency, Date/Time, and Percent. The
number format determines the number of decimal places that are displayed, too, and whether
negative numbers appear in parentheses, in red, or both.

WARNING
Don't confuse a number format that makes negative numbers red with conditional formatting.
These are two different ways of accomplishing that same effect. The difference is that conditional
formatting is much more flexible; the regular number formats allow different color only in
differentiating between positive and negative.

The most common number formats -- Currency, Percent, and Comma -- have buttons on the
Formatting toolbar. You also can adjust the number of decimal places by using the toolbar's
Increase Decimal and Decrease Decimal buttons. Figure 4-5 shows these formatting buttons.

Figure 4-5: Number formatting buttons on the toolbar.

To be more particular about the number formatting you want, use the Format > Cells command (or
press Ctrl+1). In the Format Cells dialog box, click the Number tab, as shown in Figure 4-6. Click
the format category you want and define the precise options at the right. The options are different
for each category; Currency is shown in Figure 4-6.

The Currency Style button on the Formatting toolbar does not really apply the Currency style; it
applies the Accounting style. The difference between them is minor and lies in the positioning of the
dollar sign. Accounting left-aligns the dollar sign, whereas Currency places it flush against the
number.

Figure 4-6: Select a standard number format from the Format Cells dialog box.

Table 4-1 lists the available number formats and suggestions for their use.

Category Example Notes


General 12345 No specific format, no definable options.
This is the default number format.
Number 1,234.01 Like General except you can specify the
number of decimal places and whether to
use a comma separator. When you apply
the Comma number format from the
toolbar, you apply this format with its
default settings.
Currency $1,234.01 Use for monetary values. Other currency
symbols besides $ are available. You
choose the number of decimal places, and
how negative values should be formatted
(parentheses, red, or both).
Accounting $ Like Currency except the currency symbol
1,234.01 is left-aligned in the cell, and you cannot
specify a formatting for negative numbers.
When you click the Currency Style button
on the toolbar, you apply this format with its
default options.
Date 12/31/03 Use for dates. You choose the formatting,
which may include numbers plus slashes,
dashes, and/or words that represent
months or days of the week.
Time 12:03 AM Use for times. You choose the formatting,
which may include numbers, colons, and
AM or PM.
Percentage 25.2% You choose the number of decimal places
Fractions 23 1/2 You choose the denominator on the fraction
(halves, quarters, eighths, and so on).
Scientific 2.3E+06 Use for large numbers. The number
following the plus sign is the number of
places to move the decimal to create the
actual number. For example, the number
2.3E+06 would be 2,300,000 because you
move the decimal point six places to the
right.
Text 1235 Displayed exactly as entered, but treated
like text (that is, not calculated).
Special Varies Use these for number-like values that are
not calculated, such as ZIP codes, phone
numbers, and Social Security numbers.
This is optional; many people simply treat
such numbers as text by preceding them
with an apostrophe (').

Table 4-1: Excel's standard number formats.

We look at the final type, Custom, later in this lesson.

Date and time number formats


Most of the standard number formats are fairly self-explanatory, but the Date and Time formats may
require a bit of explanation.

To help you understand how they work, do the following:

1. In cell A1, enter 01/01/1900.


2. Select cell A1, and change its number format to Number. The number changes to 1.

Can you figure out why this happened?

Excel assigns a numeric value to each date you enter so that it can create formulas that use dates.
For example, you could write a formula that determined what a certain date would be that was a
certain number of days before or after the entered date. It starts with 1/1/1900 as its baseline, or 1.
Every other date is stored as a number that represents the number of days between it and
1/1/1900. So, for example, 12/31/1900 would be 366. (It was a leap year.)

Now try converting your birthday to a general number format:

1. In cell A2, enter your birthday (mm/dd/yyyy).


2. Format cell A2 using the General number format.

In real-life usage, you seldom need to change between dates and general numbers, so this exercise
is just to help you understand what's going on behind-the-scenes.
What about times? To answer this question, do the following:

1. Make sure cell A1 is still formatted with the Number format.


2. In cell A1, enter 1.55.
3. Change cell A1 to the Time format. As you're doing this, select the bottom item from the
Type list in the Format Cells dialog box, as shown in Figure 4-7.

Figure 4-7: Select a time format. The bottom two choices show the date as well.

The number 1.55 changes to 1/1/00 13:12. As this experiment indicates, the numbers to the right of
the decimal point represent time. The 1 to the left of the decimal still represents 1/1/1900, and the
55 represents 55 percent of the time between midnight and midnight: 1:12 PM, or 13:12 on a 24-
hour clock.

This experiment is useful mainly so that you understand how Excel deals with dates and times as
numbers; in reality, you'll nearly always be entering dates and times in their normal format, such as
12:30 PM or 13:30:05.

Custom number formats


This lesson's saved the Custom number format for last because it's the most complex and powerful.
With it, you can create your own number formatting rules.

First, the basic procedure:

1. Select the cell(s), choose Format > Cells, and click the Number tab.
2. Click Custom as the category, and then edit one of the existing custom formats or create
your own.
3. Click OK.

The key to custom number formats is not the simple process just described, of course. The
important part is to know how to construct the coding for various custom formats. There are different
symbols for numbers, colors, currency symbols, dates, and other uses.
TIP
For a complete education on custom number formats, look up Number Format Codes in Excel's
Help system. We present an abbreviated lesson on them here.

The following tables show the characters you need for custom number formats. You may want to
print these for later reference.

Symbol Example Purpose


# ####.## Shows significant digits but does not show
insignificant zeros. For example, if the number
were 0234.20, it would show it as 234.2.
0 0000.00 Shows all digits, including insignificant ones, up
to the number of digits in the format. For
example, if the number entered were
000234.200, it would show 0234.20.
? ####.??? Adds spaces for insignificant zeros so that
decimal points will align when formatted with a
fixed-width font. For example, if the number
were 1234.5, it would show it just like that but
would leave two blank spaces after the 5.

Table 4-2: Numeric symbols in custom number formats.

Symbol Example Purpose


Color [Black] Makes the number appear in the specified
name [Blue] color.
[Cyan]
[Green]
[Magenta]
[Red]
[White]
[Yellow]
* 0*- Repeats whatever character follows it until it
reaches the right margin of the cell. The
example shown here would fill any remaining
space in the cell with dashes.
_ _) Adds a space that is the same width as the
character typed after it would be. The example
shown here would leave a space that's the
same width as the close-parenthesis
character. This might be useful for making
numbers align where some of them are
negative in parentheses and some are not.

Table 4-3: Colors and spacing in custom number formats.

Symbol Example Purpose


Comma , Use to indicate the thousands separator
Percent % Displays the numbers as a percentage of 100.
For example, if you enter .04, it would display
as 4%. If you enter 2, it would display as 200%.
¢ Alt+0162 These alternative currency symbols cannot be
£ Alt+0163 typed normally on the keyboard, so you must
¥ Alt+0165 enter them via the numeric keypad with an
€ Alt+0128 ANSI code. To do so, hold down the Alt key,
type the number, and then release the Alt key

Table 4-4: Symbols in custom number formats.

Symbol Example Purpose


m Normally m stands for months, except when
used following an h; then it stands for
minutes.
m Months 1 through 12
mm Months 01 through 12
mmm Months as Jan-Dec
mmmm Months as January-December
mmmmm Months as the first letter of the month
d d Days as 1-31
dd Days as 01-31
ddd Days as Sun-Sat
dddd Days as Sunday-Saturday
y yy Years as 00-99
yyyy Years as 1900-9999
h h Hours as 0-23
hh Hours as 00-23
m m Minutes as 0-59
mm Minutes as 00-59
s s Seconds as 0-59
ss Seconds as 00-59
AM/PM h:mm If you don't use this, you'll get a 24-hour clock
AM/PM on the hours and minutes

Table 4-5: Dates and times in custom number formats.

You can also use math comparison operators in the custom number formats, to set up an "if-then"
condition. For example, you could use this to format a number in red if it is less than or equal to
100, or in blue if it is greater than 100:

[Red][<=100];[Blue][>100]
custom number formatting examples

Suppose you want to show numbers with a comma separator and exactly three decimal places, and
you want negative numbers to appear in green and to have parentheses around them. You would
write a custom number format with this syntax:
Positive numbers;negative numbers

For the positive portion, we'd enter this:

#,##0.000

This tells Excel that we want at least one digit to the left of the decimal point and at least three to
the right of it. The 0s stand for those required digits. The # signs stand for digits that will appear only
if they're significant. The # signs would not be necessary except that we need them as placeholders
to show where the comma goes.

For the negative portion, the same thing but with a color code, from Table 4-3, and the parentheses:

[Green](#,##0.000)

If we want the positive and negative numbers to align neatly in the column, we should add a spacer
to the positive numbers of the same width as the parenthesis (again see Table 4.3), so the positive
number would change to this:

#,##0.000_)

The complete number format would look like this:

#,##0.000_);[Green](#,##0.000)

Now let's try one with a date. Suppose you want the date to appear like this: 08/05/1964, and you
want the time to appear as 4:07 AM.

The date code would be:

mm/dd/yyyy

The time code would be:

H:mm AM/PM

Putting the two together, we get:

Mm/dd/yyyy h:mm AM/PM

This shows the time even if you do not input a time. If there is no time input, it shows 12:00 AM.

Use styles
If you have used styles in Word before, you already probably understand the concept of a style. A
style is a collection of formatting settings that you can apply all at once.

Styles are not quite as easy to use in Excel as they are in Word, unfortunately. There isn't an easy
drop-down list on the toolbar for applying them. Instead you must go through the menu system.

First, let's create a style:

1. Format a cell exactly the way you want the style to be. This can include border, shading,
number format, font, size, alignment, and so on.
2. Choose Format > Style. The Style dialog box opens.
3. Click in the Style name box, type the new style name, and then press Enter.

Nothing may appear to have changed after following these steps, but now you have a new style to
work with. To apply it to another cell:

1. Select the cell to receive the style's formatting.


2. Choose Format > Style.
3. Open the Style name drop-down list, and choose the new style's name.
4. If there are any aspects of the style that you don't want to apply, clear the checkbox for that
aspect, as shown in Figure 4-8.
5. Click OK.

Figure 4-8: Apply a formatting style.

You can modify a style by selecting it (Steps 1 through 3 above) and then clicking the Modify
button. Experiment with this on your own. To delete a style, select it (steps 1 through 3) and then
click Delete.

Moving on

This lesson was jam-packed with information about formatting in Excel. Even advanced users have
likely learned a thing or two in this one. You learned how to construct conditional formatting criteria,
how to apply standard number styles, and how to create your own custom number formats and
apply style formatting. In the next lesson, we take a look at Excel's Charting feature and its many
options for presenting data.

Do the assignment and test yourself with the quiz before you go on to Lesson 5. These elements
help you solidify what you've learned. Don't forget to check the Message Board to see what's
happening with your fellow students and to post any questions you may have.

Question 1

What do you do to clear only the formatting from a cell, leaving its data intact?
A) Press Delete.
B) Choose Format > Clear.
C) Choose Edit > Clear > Formats.
D) Any of the above works.

Question 2
Which of these can you not do with conditional formatting?
A) Color the background differently based on the value.
B) Create multiple conditions with different fonts for each condition.
C) Place a border around cells with values within a certain range.
D) All of the above can be done with conditional formatting.

Question 3

What number format would you use for British pounds with negative numbers shown in
red?
A) Currency
B) Accounting
C) General
D) Special

Question 4

If you want to repeat a certain character in a cell until it hits the right margin, what
character would you place before it in the custom number format?
A) ) (parenthesis)
B) _ (underscore)
C) - (dash)
D) * (asterisk)

Question 5

If you want to create a custom number format that shows the month in full words, like
January, what code would you use?
A) m
B) mm
C) mmm
D) mmmm
Lesson 5. Explore the charting feature

The power of charts


Charts (also called graphs) summarize and present data in a graphical way. Take a look at Figures
5-1 and 5-2; which would you rather look at?

Excel uses the terms graph and chart interchangeably. Throughout the main part of Excel, chart is
used, but the official name of the portion of the program that creates the charts is Microsoft Graph.
In this lesson, we use chart.

Figure 5-1: A typical worksheet full of numbers. Boring!

Probably Figure 5-2, right? The chart makes the meaning of the data immediately obvious -- one
region (or division) had much better sales than any of the others -- without having to wade through
the actual numbers.

Figure 5-2: When data is made into a chart, its meaning becomes more readily apparent.

Providing a chart to the audience is not only a service to them, but it also gives you an extra edge in
manipulating your audience's perception of the data. For example, take a look at Figures 5-3 and 5-
4. Both present the same data, but in Figure 5-3, the audience is being invited to compare the
regions to one another.
Figure 5-3: This chart compares one region to another.

In Figure 5-4 the audience is being invited to compare performance over time.

Figure 5-4: This chart compares performance over a period of months.

The charts shown in Figures 5-3 and 5-4 are all about comparisons, but what if the important thing
you want the audience to see is the overall company-wide effort? You could emphasize that by
structuring the chart as shown in Figure 5-5.
Figure 5-5: Here's a version that invites the audience to look at the big-picture results of all regions
combined.

And that's just one chart type. Excel offers more than a dozen chart types, and many subtypes for
each type, so you can construct almost any chart you can imagine.

Selecting the right chart type may take some trial and error, so this lesson explains how you can
switch freely between the types. Lines, bars, columns, areas, and other chart types are all
appropriate for different situations.

The only hard-and-fast rule when choosing a chart type is that a pie chart can be used only for data
containing a single series. A pie chart shows how various pieces contribute to a whole -- for
example, how various region revenues contribute to a corporate total revenue amount, or how
various products contribute to total sales. By definition, this means a single data series. You can't
use a pie chart to show several products' sales over several years, for example, but you could use a
pie to show a single product over several years, or multiple products in a single year.

Create a chart
A good chart contains not only data, but also descriptive labels that help the user understand the
data. For example, you should be able to tell at a glance that a certain pie slice represents 30
percent of the whole, as well as that it represents the East region.

You may have created charts before in Excel, so some of this may be a review; that's okay, just
skip ahead to the material that's new to you.

Before you create a chart, make sure that your worksheet contains text labels for every pertinent
value. Other elements, such as legends, data labels, and multiple series, are optional and their use
depends on what you're trying to convey.

Next, decide what data is to appear in the chart, and then select both that data and any associated
data labels. For example, in Figure 5-6, suppose you want a pie chart containing just the data for
the South region, so you've selected the data labels in column A and the South region's data in
column C. This shows an important point: the range you select for a chart need not necessarily be
one contiguous range. To select a noncontiguous range like this one, hold down the Ctrl key as you
drag across the ranges you want.
Figure 5-6: Start a chart by selecting the range(s) containing the data and labels for it.

After selecting the data, follow these steps to make the chart:

1. Click the Chart Wizard button on the Standard toolbar. The Chart Wizard Step 1 of 4
dialog box opens.
2. Click the chart type you want from the types at the left, and then click the subtype from the
list at the right. In Figure 5-7, for example, we're creating a 3D pie chart. Click Next.

Figure 5-7: Select the desired chart type.

3. In the Step 2 of 4 dialog box, confirm the data range, changing it if needed, as shown in
Figure 5-8, and then click Next.

TIP
With a simple range like the one in our example, it's hard to go wrong. If the range contains multiple
rows and columns of numbers, however, you might want to change the plotting. Back in Figures 5-3
and 5-4, recall that the presentation was very different when plotted by rows versus by columns. In
this step of the Wizard, you can choose Rows or Columns, whichever is more appropriate to your
message.
Figure 5-8: Confirm the data range, and switch between Rows and Columns as needed.

4. In the Step 3 of 4 dialog box, you can enter the labels for the chart. Do so as needed. The
labels for the individual data series were included in the range you selected beforehand
(the months, in our example). However, this step gives you the opportunity to also include
general labels for the entire chart, such as an overall title, or labels for the vertical and
horizontal axes (not applicable to pie charts).

The legend is the key to the chart. It's a little box that shows what each color or pattern in the chart
represents; you saw legends in Figures 5-3, 5-4, and 5-5, for example.

5. Click the Legend tab in the Step 3 of 4 dialog box and choose where you want the legend
to appear (or if you want it at all). Click Next when you're finished with the Step 3 of 4 tabs.
6. Click the Data Labels tab in the Step 3 of 4 dialog box and mark the checkboxes for any
data labels you want to appear on the chart.

TIP
Using data labels is a strategic decision that will depend on the goal of your chart. If the exact
values or percentages are important, you want them displayed; if the goal is to present a big-picture
overview, you probably don't want them.

7. In the Step 4 of 4 dialog box, choose where you want the chart to appear. You can make it
appear as a floating object on an existing sheet, or you can create a brand-new chart sheet
in the workbook for it, as shown in Figure 5-9.
Figure 5-9: Specify where the chart should appear in the workbook.

8. Click Finish. Your finished chart appears.

The chart might not be exactly the way you want it initially; that's okay. In the next few pages, you
learn how to make changes to it.

Change the chart type and layout


As you saw when you created the chart, there are lots of types to choose from. You can change the
chart's type and options at any time, without losing any of your other settings for it.

Some of the changes you can make to a chart have convenient shortcut buttons on the Chart
toolbar. If it does not automatically appear when the chart is selected, choose View > Toolbars >
Chart to display it.

Change the chart type

Different chart types can convey very different messages with the data, as you saw earlier in this
lesson. If the message isn't quite right, try a different chart type.

The Chart toolbar has an abbreviated list of chart type choices you can choose from. Select the
chart, open the Chart Type drop-down list on the Chart toolbar, and select another type, as shown
in Figure 5-10.

Figure 5-10: Change to one of these common chart types quickly from the toolbar.

If the type you want doesn't appear there, you can access the full list of types again by selecting the
chart and then choosing Chart > Chart Type. That's the same as Step 1 of 4 was when you used
the Chart Wizard to create the chart.
WARNING
When you change chart types, be careful to stick with a type that is appropriate for your data. For
example, a pie chart has a single data series only. It's okay to switch it to a bar or column chart,
but that chart will show only one color of bar (that is, only one series). If you're starting with a
multiseries chart, such as a bar chart with several colors of bars, you can't change to a pie chart
without losing some of that data. The pie chart will contain only the data from the first series.

Change the titles and legend

To revisit the Step 3 of 4 portion of the chart-creation process, choose Chart > Chart Options.
Recall that this is where you enter the data labels, specify the legend positioning, and choose what
titles will appear.

For example, suppose you have changed from a pie chart to a bar chart, and now you have vertical
and horizontal axes in the chart that you didn't have before. You want to label them. To do so, you
could choose Chart > Chart Options and enter the labels on the Titles tab.

Some chart elements, such as titles and legends, can be removed from the chart by selecting them
and pressing Delete. Others can be removed only from the Chart Options box by clearing their
checkbox or text box.

On the Legend tab, you can specify a placement for the legend (Top, Bottom, and so on). However,
you can do basically the same thing by manually dragging the legend box around on the chart. You
can do the same with titles -- just drag them around as you would any graphic object.

change the size of chart elements


By default, all elements on a chart are set to autosize. That means that if you resize the chart's
outside frame, everything inside the chart frame changes size, too, in proportion. Sometimes
Excel's idea about the proper size for an element might not match yours, however. In particular,
Excel tends to make the legend text smaller than some might want, and sometimes the values on
the vertical and horizontal axes as well.

change chart text

Each text element of the chart (data labels, titles, axes labels, and so on) can be formatted
separately. To change the size of text, do the following:

1. Right-click the desired element on the chart. A shortcut menu appears, with a Properties
command at the bottom. The exact name depends on the element. Select that Properties
command.
2. In the dialog box that appears (name varies), click the Font tab and enter a new font size.
You can change the font itself and other attributes while you're there, as shown in Figure 5-
11.
3. Click OK. The change takes effect immediately.
Figure 5-11: Change the font for an element of the chart.

You can select the legend and drag a selection handle on its outside to resize it, but this resizes
only the frame; the text inside stays the same. You must resize its text as previously explained.

Resize the entire chart

If the chart is floating on a worksheet, you can resize it by selecting its frame and dragging its
selection handles. This changes its size in relationship to the surrounding data. You can also zoom
in and out (on the Standard toolbar or with the View > Zoom command) to change the overall view
of the data onscreen.

If the chart is on a separate sheet, you can't change its size, but you can you can change its
onscreen size with the Zoom control.

Resize the plot area

The chart area is the entire chart; it's what's in the chart frame that floats on the worksheet or what
sits on its own tab in the worksheet. It includes not only the charted data itself, but also the legend,
the chart title (if any), and so on.

In contrast, the plot area is just the plotted data. It's a smaller frame inside the chart area. The plot
area can be resized within the chart frame; this can be useful if you want the chart to appear larger
or smaller but the overall space taken up by the chart frame to remain the same.

If you're in doubt about its location, hover the mouse pointer over a part of the chart and a
ScreenTip pops up to tell you its name. In Figure 5-12, for example, the plot area is selected and a
ScreenTip refers to it.
Figure 5-12: The plot area is inside the larger expanse of the chart area.

change the data presentation


Now let's turn the attention to some "nuts and bolts" kinds of changes you can make to a chart.
These changes affect not only the chart's appearance, but also what it has to say to the user in
terms of data analysis.

select a different data range

After creating a chart, you may realize that you selected the wrong data for it. Perhaps you left out
one of the rows or columns you meant to include, or perhaps you selected too much.

To change the data range for the chart, do the following:

1. Select the chart.


2. Choose Chart > Source Data. The Source Data dialog box shown in Figure 5-13 opens.
Figure 5-13: Change the data range if needed.

3. Manually change the data range shown there by entering a different range, or click the
Select button (the button with the red arrow on it to the right of the text box) and then
reselect the range on the worksheet itself. If you reselect the range, press Enter after doing
so to redisplay the dialog box.
4. Click OK to accept the new range.

TIP
Some people find that it's less work to delete and re-create a chart rather than to modify the data
range; that's up to you.

Plot by rows or columns

As mentioned earlier, you can project a very different message with a chart by changing its plotting
by rows versus columns. An easy way to do so is to click the By Rows or By Columns button on the
Chart toolbar. You can also do it from the Source Data dialog box shown in Figure 5-13.

Use a data table

A data table is a minigrid that appears below a chart, showing the data that the chart is based on.
Figure 5-14 shows an example of it. You can turn the data table on/off with the Data Table button
on the Chart toolbar.
Figure 5-14: This data table provides background data that the user might want when interpreting
the chart.

Change the data scale

Excel selects the data scale automatically depending on the data. It starts at zero (0) and goes up
to the highest value represented in the chart, or slightly above it. For example, in Figure 5-14, the
highest value is 9,888 and the scale on the vertical axis goes up to 10,000.

Most of the time, the default scale is appropriate, but you might want to change it to strategically
emphasize a certain fact. For example, suppose you're plotting data where all the values were
between 9,500 and 10,000. There would not be much of a difference between the heights of the
bars. But if you change the scale so it starts at 9,000 and ended at 10,000, the differences appear
much more dramatic. Is that what you want, to make the differences look dramatic, or do you want
to minimize them? That's up to you and the specific situation you're in.

To change a chart's scale:

1. In the chart, click the vertical (Value) axis. When you point to it, it should say "Value Axis."
2. Right-click that axis and choose Format Axis. The Format Axis dialog box opens.
3. Click the Scale tab.
4. Enter different values in any of the text boxes for the scale. The Auto checkbox becomes
deselected automatically when you manually enter a value for a certain line. For example,
Figure 5-15 sets up the scale for our example, where it starts at 9000 and runs to 10000.
5. Click OK. The new scale is applied to the chart.
Figure 5-15: Change the scale to emphasize or de-emphasize differences in the values.

change chart lines and fills


Now we get to the fun part -- changing the lines and fills. Every element in the chart has a line (that
is, the border outside it) and a fill (that is, the color inside it), and all are customizable.

To customize any part of the chart, right-click it and choose Properties (the exact name depends
on the element). A dialog box opens, and from that dialog box you can change the line and fill
colors and properties.

data series and data points

Before formatting, make sure you understand the difference between a data series and a data point.
Suppose you have a bar chart with three blue bars, three red bars, and three yellow bars. The
group of the three yellow bars is a data series. An individual instance of a yellow bar is a data
point. Most of the time, when you change the colors or lines, you want to change whole data series
at a time. You seldom want to change an individual data point, although Excel does let you do it.

When selecting what you want to change, first click the element. The first click on a data point (for
example, a bar) selects its entire data series. A second click on that same data point selects that
one data point individually. Be aware of what you have selected before you start formatting. The
selection will have black squares around it.

To format a chart element's lines and fills:

1. Click the element to select it.


2. Right-click it and choose Properties. A dialog box opens. For example, Figure 5-16 shows
the Format Data Series dialog box.
3. Click the Patterns tab, and from there choose a border and fill color.
4. Click the other tabs and make selections there as appropriate. The options available
change depending on what you're formatting. For example, for a data series in a bar or
column chart, you can change from rectangular bars to other shapes such as cylinders and
cones on the Shape tab.
5. When you're finished, click OK.

Figure 5-16: Change the color, fill, and other attributes of the selected chart element.

Moving on

In this lesson, you learned how to create a chart, change its structural elements (such as the data
series and scale), and change its formatting and appearance for strategic data presentation. In the
next lesson, we look at strategies for using Excel as a flat-file database application.

Take the time now to work through the assignment and test yourself with this lesson's quiz. Both of
these are designed to help you get the most out of this course. Visit the Message Board to see what
your fellow students are up to, touch base with your instructor, and post any comments or questions
that you have.

Question 1

Which of these chart types could be used for a chart that showed data for six salespeople
for each of three years?
A) Bar
B) Pie
C) Line
D) Area

Question 2

Which of the following should every chart have, regardless of its type or situation?
A) Clear labeling
B) A legend
C) Data labels
D) Multiple data series

Question 3
Which of these does the Chart Wizard enable you to do?
A) Select a chart type
B) Choose the placement of the legend
C) Select colors for the data series
D) Use a data table
E) Use data labels that represent the actual values of the data points

Question 4

How can you make the font larger on the legend?


A) Drag the legend box's border to make it larger.
B) Right-click the legend text and choose Format Legend.
C) Manually retype the legend text in the legend box.
D) All of the above.

Question 5

What elements are inside the chart area?


A) plot area
B) legend
C) chart title
D) value axis
Lesson 6. Use Excel as a database
plan your database
In this lesson, we look at Excel's capabilities for storing and organizing data -- in other words, at its
database capabilities.

A database is a collection of data that is organized using a consistent structure. An address book is
a database, for example. You have entries for many different people, but you collect the same
information about each person: name, address, phone number, and so on.

In a database, each type of information, like ZIP Code, is a field. The complete entry for a certain
person is a record. When you put a database in Excel, the field names appear in the top row and
all records appear beneath them, as shown in Figure 6-1.

Figure 6-1: A simple database in Excel.

View a larger version of this image.

WARNING
If you're going to use your data in some other program, such as a source for a mail merge in
Word, make sure you put the field names in row 1. Don't leave blank lines at the top. Otherwise,
the program could get confused when importing your data.

Excel's database capability is limited to the creation of simple flat-file databases. A flat-file
database consists of a single, two-dimensional table, like the one in Figure 6-1. If you need a
multitable database where the tables are joined together (that is, a relational database), look at a
program like Microsoft Access instead.

To start your database, simply enter some field names in row 1. You may want to format them in a
special way, as in Figure 6-1, to help you keep that row separated from the data rows that will
follow.

As you're figuring out what field names to use, keep these rules in mind:

 Separate all data that you can ever imagine wanting to sort or filter by. For example, if you
think you might ever want to sort the list by last name, make sure you create separate
fields for first and last names.
 Try to keep field names to a single word with no spaces. If you must have multiple words,
separate them by capitalizing the first letter of each word, like this: LastName. If you don't
like that, use the underscore character for the separator, like this: Last_Name. The reason
to avoid spaces in the field names is that if you ever import the data into some other
program, or want to write macros or VBA (Visual BASIC for Applications) code that
references the fields, you might have problems with spaces in the names.

Ready to create the database? Start typing into the cells.

import data into an Excel worksheet


If you've already got the data in some other form, you may find it advantageous to import the data
rather than retyping it.

prepare data to be imported

If the data is already in some sort of row-and-column format, you can import it. Excel accepts
imported data from Word tables, delimited text files, Access databases, or any of a variety of other
formats. Let's talk a minute about preparing each of these for the import:

 Word table: If your data is in a Word table already, great. To prepare it for import into
Excel, delete everything from the file except the table itself. Make sure the field names are
in the top row of the table; add a row if needed.
 Word (not a table): If the data is not in a table, it's best to convert it to a table in Word
before importing into Excel. One way to do this in Word is to select the text and then
choose Table > Convert > Text to Table. Note that this works only if you have a
consistent delimiter character in use. (See below.)
 Delimited text file: A delimiter character is one that separates the data to show breaks
between fields. For example, in a comma-delimited text file, a record might appear like this:

John,Smith,108 Ponting Street,Moweaqua,IL,62550

Notice in this line that each of the text strings between the commas is a separate
field. In a tab-delimited file, the tab character is used instead of the comma. To
prepare a delimited text file, scan it to make sure there are no missing delimiters
and that each line has exactly the same number of them.

TIP
One way of checking your delimiters in a text file before importing it into Excel is to open it in Word
and use Table > Convert > Text to Table on it. If you get the right number of columns -- and the
correct data in each column -- the delimiters are okay. If you get more or fewer columns than you
expected, your delimiters are somehow off. Note that you shouldn't use spaces with delimiters.

 Access: An Access database file may contain multiple tables, so make sure you know the
name of the table you want. Open the file in Access and browse to confirm the name if
needed.

import the data

After checking the data to confirm it is Excel-ready, import it as follows:

 To start a new workbook based on the data, open the data file as you would an Excel file,
with File > Open. Change the file type to All Files to find it.
 To import the data into an existing workbook, open the existing workbook and choose Data
> Import External Data > Import Data.

When you import data, a wizard runs to guide you. The wizard and its steps are different depending
on the data type you're importing, so we won't go specifically through the steps here; try it out on
your own. You also get to practice this in the assignment for this lesson.

split data into multiple columns


After importing data into Excel, you may decide that there is data concatenated into single cells that
you want split out into multiple cells. For example, suppose the data you have imported shows the
first and last names of the people in a single cell together. Excel has a command that to help you
separate it: the Text to Columns command.

The only catch here is that there has to be a consistently used delimiter character within the cell in
order for Excel to be able to split it (for a variable length), or a consistent number of characters
before the split in each record (for a fixed length).

For example, with the variable length, if a space is your delimiter character, the first name and last
name must be separated by a space, and nothing else within that cell can be separated by a space.
So if you have anybody with two first names, like Mary Beth Jones, the command wouldn't work
correctly on that name. But it can still be a decent time-saver to use Text to Columns and then
manually fix the few cells that had a problem with it.

To use Text to Columns:

1. Select the cells to be included.


2. Choose Data > Text to Columns. The Convert Text to Columns Wizard runs.
3. Choose Delimited or Fixed Width.
4. If you chose Delimited, specify the delimiter character, as shown in Figure 6-2.

Figure 6-2: Separating text with a delimiter.

5. If you chose Fixed Width, click to indicate where the break should occur, as shown in
Figure 6-3, and then click Next.
Figure 6-3: Separating text based on a fixed width.

6. Set a data format for each column, as shown in Figure 6-4. This helps Excel later when you
enter additional records into the list. Your choices are General (best in most cases), Text
(good for when you'll be having numbers by themselves that you don't want to treat as
numeric values), Date (for dates), and Do Not Import (to skip a column). Click Next.

Figure 6-4: Setting a data format for the data.

7. Click Finish. The data is split into multiple columns.

work with data entry forms


One reason that people like Microsoft Access is that it allows for friendly data-entry forms that are
easier to use than row-and-column spreadsheets. Excel offers data-entry forms, too, if you know
where to look for them.

To use a data entry form in Excel, follow these steps:

1. Display the worksheet containing the data, and then choose Data > Form. A data-entry
form appears, with field names that match the contents of Row 1 in the worksheet.
(Remember, I told you it was important to put your field names in row 1.)
2. To enter a new record, click New. The form clears. Type the new entry in the fields of the
box, as shown in Figure 6-5.

Figure 6-5: Use a data entry form to simply entry into an Excel database.

You can also use the form dialog box (Data > Form) to do the following:

 Move between existing records with Find Next and Find Prev.
 Filter according to specific criteria with Criteria. To do this, click the Criteria button, and
enter values in one or more of the fields that you want to match. Then click Find Next or
Find Prev to locate matching records.
 Delete records with the Delete button. Doing this also deletes the row in the worksheet, so
there are no blank rows where deleted records used to be.
 Revert changes made to a record with Restore.

search and sort data


Any good database has a means for quickly locating certain data, and Excel is no exception. Excel
offers several Find methods.

As you saw previously, you can use the data-entry form to find records with certain criteria by using
the Criteria button from the form dialog box (Data > Form). You can also use the regular Find
command to find data, just like in any other Office application.

You can either find instances of a string one at a time, or all at once. (String in this case can be any
combination of letters, numbers, symbols, and punctuation.)

find a string one instance at a time

This method is good for browsing through the database to find instances of a particular string. To
find using the Find command:

1. (Optional) Click the cell where you want to begin. This is only significant if you want to start
your search from a certain place; otherwise, it doesn't matter.
2. Choose Edit > Find. The Find and Replace dialog box opens.
3. Enter the string you want to find.
4. Click the Options button for more find options, and set any of these as desired. For
example, you can search by rows or by columns; you can match case; you can limit the
search to just one sheet or search all the sheets; and so on, as shown in Figure 6-6.

TIP
There's a lot of complexity to the Find options, and there isn't room to address them all completely
here. You may want to explore them on your own. For example, you can click the Format button to
find certain formatting.

Figure 6-6: Set any options you want.

5. Click Find Next; the cell cursor jumps to the first instance following the position that it was
in when you started.
6. Keep clicking Find Next to move to other instances until you find the one you want.

find all instances at once

The Find All method is good if you want to see at a glance how many instances of the specified
string appear in the worksheet, and jump freely among them.

1. Perform Steps 1 -- 4 of the preceding section's steps to specify the string you want to find
and set any options.
2. Click Find All. A pane appears in the bottom of the dialog box listing all the found
instances, as shown in Figure 6-7.
3. Click an instance on the list to jump to it in the worksheet.
4. When you're finished, click Close to close the dialog box.
Figure 6-7: Find All shows you a list of all found instances at once.

sort data

For a simple sort by a single field (column), you can use the Sort buttons on the toolbar. (They're
the AZ and ZA buttons.) This is useful when you need a quick look at a particular field, and can be
a good alternative to using Find to locate what you want. For example, suppose you want to see
whether there is anyone in your database with a ZIP Code of 46060. You could sort by ZIP and then
scroll down the list to see.

TIP
If you think you may want to get the records back to their original order at some point, add a field
(column) containing numbering (use AutoFill), and then you can always re-sort by that column.

To sort by a single column, follow these steps:

1. Click any cell within that column. Do not select a range.


2. Click the Sort Ascending (AZ) or Sort Descending (ZA) button on the toolbar.
3. Excel is smart enough to know that you want the surrounding columns to move along with
the selected one, so your data columns don't get out of synch with one another.
4. You can also sort by multiple fields. For example, perhaps you want to sort by Last Name,
and then to break the tie with the First Name field in the event that two people have the
same last name.
5. To sort by multiple columns, follow these steps:

1. Click anywhere within the data range. Do not select a range.


2. Choose Data > Sort. The Sort dialog box appears.
3. Open the Sort By list and choose the first field to sort by. If you have set up field names in
the first row (and you should have), those field names appear on the list. If not, the column
letters appear on the list.
4. Open the Then By list and choose the second field to sort by, as shown in Figure 6-8.
Continue entering additional layers of sorting as needed.
5. Click OK. The sort occurs.
Figure 6-8: You can sort by multiple columns through the Sort dialog box.

filter data
Filtering is another way of finding specific data. It's useful when you have a large amount of data
and want to see only specific records within it.

For example, suppose you have a mailing list stored in Excel, and you have a field called Category.
Each record is categorized as either Business or Personal. Sometimes you want to work only with
the Business contacts, and you can use a filter to show only the desired records.

use an AutoFilter

An AutoFilter enables you to filter the list to show only records with a specific value in a specific
field.

To use an AutoFilter, follow these steps:

1. Choose Data > Filter > AutoFilter. Each of the field names becomes a drop-down list.
2. Open the drop-down list for a field name and select the desired value, as shown in Figure
6-9. All records that do not match that value in that field are temporarily hidden.

Figure 6-9: Use an AutoFilter to narrow down the list of records to those matching certain values in
certain fields.

View a larger version of this image.

3. If desired, further refine the filter by doing the same thing for another field name.
4. When you're finished looking at the filtered records, choose Data > Filter > AutoFilter to
turn the AutoFilter off. Or, if you want to continue doing AutoFiltering but want to start over,
choose Data > Filter > Show All to leave AutoFilter turned on but return to the full set of
records.

use the Advanced filter

The Advanced Filter feature is not easy to use, but it does offer some powerful capability. With it
you can write formulas that represent what you want to find.

To use Advanced Filter you must insert some blank rows above your data range, to serve as a
criteria range. There must be enough blank rows that there is an extra blank row between the last
entry in your criteria range and the start of your data range. For most people, four or five blank rows
are sufficient.

The field names must be repeated in the criteria range. You don't have to include every field name -
- just the ones that you plan on using in your filter.

Figure 6-10 shows an example of a worksheet set up with a criteria range for filtering by Category
and ZIP.

Figure 6-10: Before using Advanced Filter, you must set up a criteria range.

View a larger version of this image.

Next, in your criteria range, enter the criteria to use. Items on the same row are AND statements, so
both must be met in order for a record to be included. Items on different rows are OR statements;
either may be met for a record to be included. In Figure 6-11, for example, records will be included
that are BOTH in the Business Category AND with a ZIP Code that begins with 462.

Figure 6-11: This criteria range specifies that both conditions must be met.

View a larger version of this image.

TIP
You can use the standard * and ? wildcards. An asterisk stands for any number of characters; a
question mark stands for a single character. Should you ever have to find a string that actually
contains a ? or an *, you can precede the character by a tilde (~) to make it a literal value.

After setting up your criteria range, you're ready to perform the filter:

1. Choose Data > Filter > Advanced Filter. The Advanced Filter dialog box opens.
2. Under Action, choose either Filter Data in Place or Copy to Another Location.
3. In the List Range text box, confirm that the list range is correct. Modify it if needed.
4. In the Criteria Range box, enter the range of the criteria, including the field name labels.
5. If you chose Copy to Another Location in Step 2, enter the top left cell for the range into
which you want to copy in the Copy To box. Figure 6-12 shows a completed dialog box.

Figure 6-12: The Advanced Filter dialog box.

6. Click OK. The filter is applied.


7. When you want to return to seeing all the records again, choose Data > Filter > Show All.
This is an issue only if you chose to filter data in place in Step 2; if you chose to copy it, the
original data never disappeared.

WARNING
Sometimes searches involving wildcards can be tricky to construct and don't always come out like
you would expect. Don't sweat it too much; you probably won't be using Advanced Filter very often
in real life. If you're interested in more detailed information about the Advanced Feature, see the
Excel Help system.

moving on

In this lesson, you got to experiment with some of Excel's database features, including sorting,
filtering, and using data entry forms. Congratulations! You have completed the last lesson in this
course. Don't forget to do the assignment to reinforce the new skills you learned, and complete the
quiz to check your understanding.

I hope you've enjoyed this course and have learned a lot from it. I look forward to seeing you in
other classes online.

Question 1

What is a flat-file database?


A) A database that consists of multiple tables.
B) A relational database.
C) A database that consists of a single table.
D) A database that holds only numeric data.

YourAnswer: C
Correct!
Question 2

What is a tab-delimited text file?


A) A file that uses a tab as a consistent character for separating one field from another in
each record.
B) A file that uses a tab as a consistent character for separating one record from another.
C) A text file where all the fields in each record are run together in a single cell.

YourAnswer: A
Correct!

Question 3

What command in Excel opens a data-entry form?


A) Data > Form
B) Format > Form
C) View > Form
D) File > Form

YourAnswer: A
Correct!

Question 4

If you wanted to find the records in the database that contained a certain ZIP Code, what
features of Excel could you use?
A) Edit > Find
B) Data > Filter > AutoFilter
C) View > Filter > Advanced Filter
D) File > Filter

YourAnswer: A, B, C, D
Incorrect!

Question 5

To use an advanced filter, you must create a ______ above the data range.
A) key field
B) legend
C) secondary data table
D) criteria range

YourAnswer: A
Incorrect!

You might also like