Professional Documents
Culture Documents
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.
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 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:
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
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.
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
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:
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.
=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:
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
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
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.
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.
=IF(C16>6,"Full","Available")
» 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.
=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.
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")
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.
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 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.
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
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.
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:
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.
» 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.
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.
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.
1. Right-click the tab and choose Tab Color. The Tab Color
dialog box appears, as shown in Figure 2-5.
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.
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
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.
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.
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.
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.
If you want to follow along with the examples, enter the text and
numbers shown in each figure and then follow the instructions.
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.
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
Question 2
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.
Excel sometimes copies formatting for you automatically. To try this out, perform the following
experiment:
format painter
If Excel doesn't automatically copy the formatting the way you want, you can manually copy it with
Format Painter.
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.
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:
Give this a try on some of the cells you've formatted in the preceding sets of steps.
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.
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.
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.
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.
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.
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.)
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:
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.
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.
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
#,##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_)
#,##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.
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.
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:
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Question 5
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.
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.
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:
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.
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.
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.
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.
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.
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.)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
YourAnswer: C
Correct!
Question 2
YourAnswer: A
Correct!
Question 3
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!