Excel Tutorial For Windows - Excel 2007
Excel Tutorial For Windows - Excel 2007
d QUARTILE functions
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
My purpose with this Excel tutorial is to illustrate some Excel tips that will dramatically
improve your efficiency. I make no attempt to be as encyclopedic as some of the 800-page
Excel books available. I concentrate on common tasks, not every last thing that can be done in
Excel. Also, I presume that you have some Excel knowledge. For example, I assume you know
about rows and columns, values, labels, and formulas, and other basic Excel elements. If you
know virtually nothing about Excel, you probably ought to work through an “Excel for
Dummies” book and then work through this tutorial.
The style of this tutorial is easy to follow. The table of contents contains hyperlinks to the
various worksheets where you can learn and practice various skills. Each of these worksheets
has a hyperlink in cell A1 back to the table of contents sheet.
I suggest that you save this file–RIGHT NOW–as My Excel Tutorial.xlsx (or some such name)
and work with the copy. That way, if you mess anything up as you try the exercises, you can
always go back and retrieve the original file (Excel Tutorial.xlsx). However, in case you mess up
the original, you can always download it from my Web site:
http://www.kelley.iu.edu/albrightbooks/free_downloads.htm.
lly
0-page
be done in
ou know
ts. If you
or
o the
orksheets
name)
you can
u mess up
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
If Excel 2007 is your first exposure to Excel, you will love it. However, if you are used to Excel
2003 or an earlier version, you will have some unlearning to do. There are several big changes
in Excel 2007 and many smaller changes. The first big change is that worksheets are much
bigger. You used to have about 65,000 rows and 256 columns. Now you have over a million
rows and over 16,000 columns. You will hardly ever use this much space, but it’s available.
Read the next few worksheets for other significant changes.
By the way, I am not the only person who has written tips on getting used to Excel 2007. You
might also want to check out some more tips at http://www.rondebruin.nl/tips.htm.
s My Excel Tutorial.xlsx, and work with the copy.
to Excel
g changes
much
million
ilable.
007. You
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The biggest change is the one you will notice right away. You no longer have the usual menus
and toolbars. Microsoft has completely reorganized the user interface to provide tabs and
ribbons. Each tab (Home, Insert, Page Layout, etc.) has an associated ribbon that is similar to
the old toolbars. For example, if you click on the Formula tab, you get a ribbon with buttons
that are useful for working with formulas. Each ribbon has several groups of buttons. For
example, the Formulas ribbon has one group called Defined Names for manipulating range
names. There is only one way to learn these ribbons, by practicing and experimenting. If you
are used to the old Excel, you will undoubtedly curse at the new ones a few times when you
can’t find something, but you can be assured that they are more logically organized than the
old versions.
You can’t change the new ribbons; they are built in and fixed. Well, that isn't quite true. If you
don’t mind writing some XML, it is possible to create new ribbons that have your favorite Excel
buttons or even new buttons attached to your own macros. This is somewhat advanced, so I
won't cover it here. But if you are interested, the technology is called RibbonX, which you can
search for on the Web.
With the old menus gone, what about the keyboard shortcuts many of you depend on? As far
as I can tell, they still work, or at least most of them still work. For example, you can still press
Ctrl-s to save a file or Ctrl-p to print a file.
Also, if you prefer keyboarding to mousing, here's something you will like. Press the Alt key. In
the ribbon area, you will see a shortcut key for each tab. For example, M is for Formulas. Press
any of these shortcut keys to see the corresponding ribbon, and each one of its buttons will
have a shortcut key. Press the one you want, which is equivalent to clicking on the button. To
make these shortcut keys disappear, press the Alt key again.
A few of the new tabs are not visible until you select an appropriate object. For example,
when you select a chart, three new Chart Tools tabs (Design, Layout, and Format) become
visible. Or when you select an Excel table, a Table Tools Design tab becomes visible.
In general, Excel 2007 is more intelligent about context. In the context of what you are doing,
if something is necessary, it is likely to appear. Otherwise, it stays hidden.
s My Excel Tutorial.xlsx, and work with the copy.
al menus
bs and
imilar to
buttons
. For
range
g. If you
hen you
than the
ue. If you
orite Excel
ced, so I
h you can
on? As far
still press
Alt key. In
ulas. Press
ons will
utton. To
mple,
come
re doing,
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Some of the most common actions, such as saving and printing, are missing from the
ribbons.You can find them by clicking on the Office button, the multi-colored button at the
top left of your screen (or the screen shot to the right). You will see a number of categories,
including New, Open, Save, Save As, Print, and others. So if you can't find something on a
ribbon, look under the Office button.
Note that there are other options for these common operations. First, old shortcut key
combinations such as Ctrl-s for save or Ctrl-p for print still work. Also, you can put your
favorite buttons on the QAT, as explained on the next worksheet.
Surprisingly, you won't find a Help option under the Office button, and you won't find it on a
ribbon either. But the Help button is always visible as a question mark up in the right corner
of the screen. (You can also press the F1 key for help.)
s My Excel Tutorial.xlsx, and work with the copy.
e
at the
egories,
on a
ey
ur
d it on a
corner
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Although you can’t change the new ribbons (at least not easily), you can customize the Excel
user interface to some extent. Specifically, Excel provides a quick access toolbar (QAT) at the
top left of the screen. You can put your favorite buttons on this toolbar so that they are
always visible and available. The QAT comes with a few favorite buttons, but you can add
more.
Click on the dropdown arrow to the right of the QAT. You will see a list of the most commonly
used buttons, which you can check to have them appear permanently on the QAT. You can
also click on the More Commands item to see a dialog box with a wealth of other buttons you
can add to the QAT. In fact, if you create your own macros to perform common tasks, you can
place buttons to run them on the QAT.
Note that you also get to the More Commands dialog box by clicking on the Office button,
then on Excel Options, and then on Customize.
Try it! Add some of your favorite buttons to the QAT. You will have to do this only once!
You can see my QAT below. I have added a few of the "standard" buttons, plus a few extras to
run my favorite macros.
s My Excel Tutorial.xlsx, and work with the copy.
he Excel
T) at the
are
add
ommonly
ou can
ttons you
, you can
utton,
ce!
extras to
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
One particular menu item you will miss from earlier versions of Excel is Tools-->Options, for
changing various options in Excel. It is not gone; it is just in a different place. To get to it, click
on the Office button (in the upper left corner of the screen) and then the Excel Options
button. As shown to the right, you will see that the options are grouped in categories:
Popular, Formulas, and others. You might have to hunt awhile, but there are an amazing
number of options available.
Try it! Under the Popular group, change the default number of worksheets in a new file from
3 to 1. (Why have 3 when you usually need only 1? Besides, if you need more, you can always
add them.)
Try it! Under the Advanced group, the first Editing option lets you choose the direction you
want the cursor to move when you press Enter. Change it to the direction you prefer.
Try it! Excel makes some automatic changes for you when you type certain characters. For
example, if you type (c), it automatically changes this to a copyright symbol. If you find this
annoying (as I do), you can change it through the AutoCorrect Options button in the Proofing
group.
s My Excel Tutorial.xlsx, and work with the copy.
ons, for
o it, click
ons
s:
zing
file from
an always
on you
.
rs. For
nd this
Proofing
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
One other important change is file extensions. Unless you wrote your own add-ins in earlier
versions of Excel, the only file extension you probably ever saw was .xls. You can still save files
with this extension, but they will lose any features new to Excel 2007. To save them and keep
new features, you should save them as .xlsx files. The new "x" at the end of the extension
(which appears in Word and PowerPoint 2007 files) stands for XLM, the format that these files
are now stored in.
Note that if you save your file as an .xlsx file, people with Excel 2003 won’t be able to open it
unless they download and install a free file format converter from Microsoft. (Do a Web
search for Microsoft Office Compatibility Pack to find this free download.) In the other
direction, if you save a file created in Excel 2007 as an .xls file, it will probably work fine, and it
will be readable by users with older versions of Excel, but it won't be to take advantage of
changes in Excel 2007.
One other new file extension is .xlsm. If your Excel file has associated VBA macros, then you
must save it as an .xlsm file ("m" for macro). You might also see files with an .xlam extension.
These are Excel add-ins.
s My Excel Tutorial.xlsx, and work with the copy.
n earlier
save files
and keep
nsion
these files
o open it
Web
her
fine, and it
age of
hen you
xtension.
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Right-clicking on various things is not new to Excel 2007, although I wouldn't be surprised if
there are now more options than ever. If you want instant context-sensitive menus, you
should get used to right-clicking. This almost always leads to a useful menu of options.
Try it! Highlight the sales figures to the right and then right-click. This allows you to format the
cells and do many other things. Format these cells as currency with zero decimals.
Try it! Click anywhere on the chart to the right and then right-click. You will get a menu, but
the menu items will depend on what you selected on the chart. Try selecting different parts of
the chart to see what I mean.
Try it! Select this text box you're reading and then right-click. You will get a menu for
modifying the text box in some way.
Try it! Select the screenshot to the right (which I inserted as a Picture) and then right-click.
Another menu!
Did you notice that when you right-clicked on the sales values, you not only got a menu, but
you also got a mini-toolbar above the menu? Try it again to see what I mean. There is also a
mini-toolbar when you right-click on a chart. These toolbars are new to Excel 2007, so watch
for them when you right-click on something. They don't always appear, but when they do,
they provide still one more quick way to accomplish common tasks.
s My Excel Tutorial.xlsx, and work with the copy.
enu, but
s also a
o watch
ey do,
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
This section illustrates a number of ways to make you more efficient: how to select ranges,
how to copy and paste, how to deal with absolute and relative addresses, how to insert and
delete rows or columns, and a few others. Most Excel users know how to do these things, but
they often do them inefficiently. So even though this material might seem elementary, read
on—you might just pick up a few new tricks.
s My Excel Tutorial.xlsx, and work with the copy.
anges,
ert and
hings, but
ry, read
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
There is nothing worse than getting a spreadsheet from someone with no documentation. All
you see are a lot of meaningless numbers and possibly a few not-well-thought-out labels. This
is a very bad practice, and you shouldn't be guilty of it. There are a number of things you can
do to document your work. Of course, you can have labels and a nice structure, such as in the
example to the right. But you can do more than this. Specifically, you can include cell
comments and text boxes, as explained below.
A cell comment is useful when you want to explain something that is probably not obvious in
a particular cell. You will know a cell contains a comment when you see a little red mark in the
upper right corner of the cell. You can see the cell comment by hovering the cursor over the
cell. By default, a cell comment starts with the owner's name, but you can delete this name if
you like.
To insert a cell comment in a cell, right-click on the cell. If there is no existing cell comment,
you will see an Insert Comment item. If there is an existing cell comment, you will see Edit
Comment and Delete Comment items. (See the screenshots to the right.)
Try it! Add the following cell comment to cell R10: Sales are in $1000s. Then change the
comment to: Monthly sales in $1000s. Then delete the cell comment.
When you add explanations to your worksheets, do you tend to start typing in a cell, and
when it gets long enough, you continue typing on the next line, etc.? A lot of people do this,
including myself in past years. It is not a good habit, mostly because of the difficulty of
editing. It is much better to use text boxes, as you see throughout this tutorial. Text boxes are
much better for explanations than cells because they have word wrap. They are essentially
mini-word processors that can be edited (and moved or resized) easily. You should use them
in virtually every spreadsheet you create!
To insert a text box, click on the Text Box button on the Insert ribbon (see to the right), and
drag a text box in some area of the worksheet. Then start typing. It's as easy as that.
You might also want to change the appearance of the text box. To do so, click on it twice so
that the border becomes a solid line (it's a dotted line after the first click). Then right-click and
choose the Format Shape item. This brings up a dialog box where you can make all sorts of
changes. For example, in this tutorial I changed the text boxes to have a light gray fill and a
shadow. If you like the appearance, you can again right-click and choose the Set as Default
Text Box item. Then every other text box you create in that workbook will automatically have
the same appearance.
Try it! Create a text box to the right and enter some text. You will see that it automatically has
the same appearance as the rest of the text boxes in this tutorial. Now change the
appearance of your new text box in some way.
s My Excel Tutorial.xlsx, and work with the copy.
ation. All
bels. This
you can
as in the
bvious in Sales
ark in the 15.3
over the
s name if 14.7
9.6
12.1
mment,
e Edit 14.2
the
and
do this,
of
boxes are
ntially
se them
t), and
wice so
-click and
orts of
and a
efault
ally have
tically has
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
s My Excel Tutorial.xlsx, and work with the copy.
Often you want to reo
back to the “home” po
We all make mistakes, often careless mistakes. For example, I often press Ctrl-v (paste) when I
mean to press Ctrl-c (copy). This can have the effect of pasting a lot of junk onto a range that I
never intended. At this point, I am hoping I can easily undo the mistake. This is usually
possible, but not always. Excel stores most of your actions so that it can undo them.
There are two ways to undo actions. The first is the simplest, but the second gives you more
control.
Press Ctrl-z. You can do this easily with the small finger and index finger of your left hand. This
should become one of your favorite keyboard shortcuts!
Or:
Click on the Undo button (the button with a circular arrow pointing counter-clockwise to the
right).
This Undo button isn't on any of the ribbons, but it can be placed on the Quick Access Toolbar
(QAT) at the top of the screen. In fact, I believe it is placed there by default. (There is also a
Redo button, also shown to the right, for undoing an undo.)
Note that there is a dropdown arrow next to the Undo button. This allows you to select the
action (not necessarily the previous action) to undo. As you can see from this dropdown, Excel
remembers a lot of your most recent actions. However, if you select , say, the third most
recent action, you undo this action and the other two most recent actions, that is, it is
cumulative.
I am not sure which actions can be undone and which can't, so I experiment. For example,
you can't undo adding a worksheet or deleting a worksheet. This is a good reason (one of
many) for saving often!
Try it! Enter formulas in column N to sum the two numbers to their left. Then get rid of these
formulas with either undo method.
s My Excel Tutorial.xlsx, and work with the copy.
e) when I 26 36
nge that I 50 12
ly
44 17
11 29
ou more 25 50
25 21
26 19
38 17
hand. This
37 4
39 46
3 25
se to the 14 38
18 1
ss Toolbar
also a
ect the
own, Excel
most
is
mple,
ne of
of these
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
It is often useful to zoom to the bottom, top, left, or right edge of a data range. You can do
this easily with the End-arrow key combinations.
Try it! Starting at a corner (a bordered cell) to the right, move around to the other corners.
If you keep your finger on the Shift key while you do an End-arrrow combination, you select
(highlight) the range in between.
Try it! Starting at a corner (a bordered cell) to the right, move around to the other corners.
But this time, keep your finger on the Shift key.
Note that the action of an End-arrow combination depends on where you start. It takes you
to the last nonblank cell if you start in a nonblank cell. (If there aren’t any nonblank cells in
that direction, it takes you to the far edge of the sheet.) If you start in a blank cell, it takes you
to the first nonblank cell.
Try it! Move around the range to the right, where there are some blank cells.
s My Excel Tutorial.xlsx, and work with the copy.
an do
8 1 1 1
5 5 7 6
10 5 3 10
ssing the 10 10 5 9
range. 5 4 3 4
orners. 7 4 5 1
2 8 9 10
u select 8 1 1 1
5 5 7 6
orners. 10 5 3 10
10 10 5 9
5 4 3 4
7 4 5 1
2 8 9 10
kes you 8 1 1
cells in 5 5 7
takes you
10 5 3 10
10 10 9
4 3 4
7 4 5 1
2 9 10
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
It is often useful to split the screen so that you can see more information.
Click on the narrow “screen splitter” bar just to the right of the bottom scroll bar (for vertical
splitting) or just above the right-hand scroll bar (for horizontal splitting) and drag this to the
left or down. (See the screenshots below.)
Splitting gives you two “panes” (or four if you split in both directions). Once you have these
panes, practice scrolling around in any of them, and see how the others react.
Try it! Split the screen both ways so that you can see the top left cell in the data to the right
(cell M3) and the bottom right cell (cell AE265). Then remove the splits.
s My Excel Tutorial.xlsx, and work with the copy.
61 91 84 8 3 62 11 33 83
95 8 14 68 33 23 13 12 3
33 93 80 5 60 30 13 34 23
r vertical 49 47 37 41 56 38 46 50 100
s to the 10 65 46 42 52 90 37 31 56
14 69 15 73 11 75 77 36 66
e these 21 80 46 93 35 95 35 95 27
8 74 24 77 9 92 46 28 100
he right 94 33 56 88 51 73 22 39 93
84 17 60 87 32 46 100 61 83
62 79 43 80 11 9 24 52 22
16 29 76 6 90 32 40 62 94
93 54 2 11 82 33 18 31 42
6 39 52 66 33 2 23 49 87
28 91 57 78 29 82 24 88 45
66 28 57 51 87 44 99 18 32
56 100 36 48 46 60 71 33 30
3 34 87 45 45 76 85 86 28
33 13 50 83 53 20 83 13 7
34 55 3 9 67 99 25 33 93
80 45 89 83 23 31 12 14 27
53 96 54 41 100 1 28 21 29
77 57 38 52 44 94 46 72 50
64 86 26 30 35 69 52 28 48
39 28 43 41 27 86 76 44 12
75 97 99 71 66 63 42 63 15
58 14 66 95 35 18 41 32 29
56 58 57 81 48 63 27 54 97
5 99 11 59 7 8 84 56 76
80 67 47 99 77 50 42 90 92
6 22 30 3 40 19 67 32 57
52 100 67 91 27 59 11 72 12
83 32 19 90 44 22 100 11 18
8 51 93 30 28 55 97 60 46
55 21 30 49 5 26 1 16 86
51 88 93 61 96 88 59 68 44
39 97 37 14 25 17 44 69 92
50 80 41 96 76 49 43 27 73
42 73 4 25 21 30 74 44 68
48 60 26 34 87 79 62 96 39
54 12 31 66 87 68 48 34 46
15 63 54 42 15 32 73 11 91
28 41 18 72 18 36 54 96 3
28 15 100 28 4 9 94 43 56
99 3 52 27 39 60 4 18 63
24 32 55 62 100 30 82 17 79
19 28 46 73 83 78 96 39 32
21 31 14 78 87 14 49 85 75
30 76 53 91 46 94 2 64 34
93 98 84 86 97 9 98 94 44
32 54 80 51 59 62 6 8 29
35 32 25 34 37 83 51 54 45
82 86 46 28 54 56 26 57 3
23 94 71 95 56 37 97 84 7
59 62 88 21 2 57 19 66 65
17 19 95 63 4 99 93 50 100
4 62 36 55 37 49 11 62 7
67 58 54 91 39 76 25 22 55
17 41 21 18 24 6 65 10 83
71 8 45 90 1 34 11 60 21
48 41 36 7 69 54 5 9 46
29 97 30 76 59 85 39 96 30
58 15 37 56 25 71 3 78 83
64 66 57 26 39 63 17 46 76
14 48 78 6 72 26 1 84 26
67 56 76 7 97 89 44 99 19
90 97 41 63 79 20 90 95 87
83 17 24 75 31 11 98 72 91
21 32 27 46 59 22 82 12 65
14 27 3 62 48 39 43 8 81
38 87 57 5 39 100 56 61 5
64 15 57 23 94 63 96 6 54
10 24 39 52 80 100 28 88 21
53 10 66 31 7 99 48 21 85
79 70 94 39 66 37 7 78 57
90 19 84 3 4 48 34 91 41
60 59 36 83 90 42 45 17 64
67 9 71 3 84 2 95 44 67
22 53 52 45 50 20 39 23 68
80 17 94 59 82 93 50 47 67
86 16 44 67 60 14 38 99 57
41 46 51 42 50 52 38 16 49
8 66 13 63 76 23 58 1 70
58 52 88 11 35 21 57 6 14
9 10 80 57 97 49 89 1 5
21 23 18 11 83 7 50 96 3
64 79 96 60 21 49 80 80 80
59 93 64 38 26 71 1 66 39
18 54 3 25 10 80 46 49 26
17 49 70 22 71 98 81 44 23
22 24 96 90 79 26 13 63 60
72 62 35 54 98 13 94 56 28
56 81 96 90 42 44 88 33 37
10 95 47 39 40 74 48 72 44
72 77 68 43 75 89 23 27 53
72 46 33 91 76 68 54 82 74
94 62 70 62 1 71 46 49 90
44 16 63 96 93 42 98 36 32
4 78 4 57 89 63 14 63 11
44 53 42 63 53 73 15 21 38
80 8 23 12 57 71 55 48 77
41 77 13 57 84 1 92 13 19
21 28 20 14 34 77 12 47 30
35 79 17 53 48 31 52 29 16
44 19 27 44 81 54 47 8 24
38 82 78 93 9 49 1 20 76
45 91 77 37 45 46 5 71 47
47 24 39 50 25 65 52 71 14
64 36 57 8 7 85 97 6 16
79 62 44 21 75 43 58 44 84
25 11 56 79 80 68 68 25 21
47 1 96 34 33 30 92 70 17
2 65 45 17 6 16 19 61 9
73 21 96 87 87 33 95 99 19
97 29 26 8 25 35 27 30 69
62 31 48 1 100 11 71 77 87
22 42 23 87 55 73 89 22 73
48 12 99 78 21 25 58 88 4
63 62 60 7 95 7 9 20 37
59 83 41 52 33 77 59 28 78
23 53 55 94 79 73 53 45 93
73 85 62 26 65 82 48 55 5
87 76 44 15 5 76 8 73 54
25 36 61 5 95 95 55 44 81
87 49 6 24 96 32 90 43 43
1 65 3 98 88 93 52 26 76
25 7 5 62 60 41 36 43 94
3 15 36 21 81 37 48 67 87
21 88 92 53 26 82 74 30 71
46 8 27 24 80 66 74 33 76
41 32 70 57 7 68 37 55 84
74 5 50 73 14 35 70 87 65
8 52 77 79 18 82 17 29 56
64 28 1 99 41 63 89 69 97
60 75 59 23 50 98 8 91 84
24 32 42 22 45 40 78 92 9
66 100 97 47 89 46 89 73 33
5 21 61 56 43 59 39 19 41
51 11 13 49 60 16 15 94 67
80 38 15 55 84 4 68 40 85
69 59 95 21 59 78 9 59 36
44 43 36 99 84 57 72 11 93
36 96 63 2 69 5 56 70 66
90 35 33 45 100 95 30 23 92
29 11 97 85 100 17 81 87 5
87 99 83 90 96 54 33 56 59
80 41 1 99 56 87 85 74 85
67 86 89 90 17 97 64 6 43
78 98 73 2 43 55 81 46 6
59 7 61 27 45 25 32 47 66
50 65 6 73 62 5 96 69 65
91 58 44 11 100 82 50 28 26
36 92 28 37 38 4 30 99 17
93 31 27 55 85 54 65 94 90
31 42 27 37 83 42 5 43 24
32 76 74 40 8 61 46 73 31
36 13 30 44 71 60 83 68 76
10 72 34 68 46 1 35 84 32
51 41 64 66 64 25 66 21 38
54 51 44 70 39 66 38 21 74
18 22 68 19 62 49 31 98 76
20 36 76 29 14 36 22 14 68
84 81 83 45 67 76 65 53 76
2 32 35 35 77 100 51 81 67
80 80 49 44 55 44 25 53 58
6 73 48 54 20 12 73 27 82
55 88 39 92 91 88 70 97 86
6 14 68 28 42 87 68 86 16
6 85 2 88 9 46 3 68 30
48 82 90 87 29 56 68 54 49
49 16 70 33 38 89 89 38 22
89 65 76 38 66 65 90 52 67
82 96 81 70 57 16 56 37 50
29 39 13 40 71 72 68 55 21
11 49 96 18 36 30 71 10 51
43 21 73 40 37 28 24 4 14
17 77 29 50 77 10 53 30 55
100 87 58 88 19 44 54 82 62
65 56 63 89 78 60 49 39 34
26 50 7 90 32 25 80 80 9
85 4 11 95 8 72 16 30 36
27 34 52 95 58 72 88 48 92
74 50 36 79 4 91 62 30 79
90 4 53 74 9 37 100 77 22
81 67 18 3 36 41 24 51 89
87 10 62 20 81 35 2 71 26
85 30 97 86 13 26 91 11 80
63 71 10 68 99 9 92 4 75
8 18 40 81 20 19 21 59 12
14 23 86 50 65 69 52 75 28
70 68 65 22 38 67 79 97 13
35 20 39 36 60 83 62 69 11
24 42 69 77 10 87 33 4 55
66 34 71 48 48 54 45 82 35
75 35 7 53 28 9 82 61 82
47 61 39 77 63 54 89 92 56
75 83 38 56 55 5 96 90 75
62 32 49 76 59 48 40 29 33
90 2 31 1 86 96 41 11 89
9 4 60 71 6 49 33 19 31
58 47 83 28 10 39 15 71 84
87 29 30 76 72 11 91 2 71
5 37 65 32 8 44 42 90 84
71 55 13 82 26 58 53 81 39
40 27 2 33 73 3 87 10 58
77 90 32 82 40 62 49 32 60
62 31 22 48 69 66 28 54 3
75 7 75 57 36 24 65 72 21
68 54 34 43 18 89 25 1 94
68 17 81 73 51 24 99 49 99
60 53 39 63 39 49 52 66 37
38 44 18 1 14 6 88 7 8
13 2 66 24 33 64 9 73 50
65 78 33 93 61 75 81 47 24
11 74 100 95 33 87 58 14 10
100 79 1 30 38 38 2 52 10
93 77 58 4 76 71 79 10 7
99 39 52 60 13 65 16 90 12
47 15 65 34 2 49 3 68 46
62 100 64 94 41 79 3 11 9
36 37 100 34 96 54 46 34 58
50 30 8 81 33 75 76 68 2
71 63 57 70 12 93 83 29 96
33 54 72 49 3 68 38 97 81
68 32 91 5 34 66 31 25 69
80 89 86 36 50 78 81 78 8
82 22 53 19 14 39 86 50 13
70 43 74 72 45 41 13 42 87
95 33 7 76 39 88 55 64 16
24 70 27 78 78 36 85 79 50
1 42 24 11 41 78 58 7 51
91 26 84 65 71 15 32 95 79
100 79 78 99 41 89 12 77 90
58 12 65 57 60 52 37 25 71
45 98 2 43 82 3 26 52 86
21 50 29 23 18 59 79 48 63
53 25 43 25 98 79 6 30 89
5 51 1 1 36 34 51 17 93
35 83 10 62 46 46 82 47 97
53 25 29 1 97 7 45 16 62
51 24 71 78 75 40 97 97 69
35 4 69 90 27 70 16 15 56
22 80 64 22 36 66 3 14 81
4 54 13 100 97 23 71 46 63
8 88 74 93 53 84 2 55 10
75 28 66 58 48 87 30 12 83
5 35 40 86 85 56 79 20 7
13 5 86 97 42 43 21 71 86
31 64 50 32 28 86 46 98 2
98 67 43 64 41 72 95 83 92
6 64 79 7 7 94 92 40 25
97 55 34 5 19 89 58 38 82
67 43 50 69 37 11 16 79 92
16 79 76 21 85 12 67 18 32
49 82 70 80 13 44 70 57 27
6 83 5 79 15 91 92 29 50
81 84 67 96 65 88 82 98 12
55 13 37 12 100 57 68 80 27
79 51 75 17 89 44 22 34 62
7 60 8 51 74 41 84 1 38
97 29 35 1 37 65 88 99 45
68 29 86 53 36 26 23 83 19
26 43 93 34 93 35 17 6 99
70 84 94 30 49 86 7 18 39 54
100 42 23 85 57 84 89 53 25 57
57 56 82 3 62 89 17 6 28 99
40 59 34 22 37 39 24 64 31 5
29 78 88 67 62 23 32 72 65 32
32 97 51 41 90 79 49 16 49 75
25 39 33 93 81 44 4 88 50 19
22 31 97 78 79 17 62 1 69 26
77 39 51 75 63 6 63 31 7 55
71 93 74 34 52 4 26 55 60 27
58 80 41 93 77 33 8 38 89 95
34 34 91 57 9 49 93 62 45 7
58 13 20 20 58 23 16 69 51 15
46 75 58 95 64 9 8 100 60 65
3 30 36 90 61 40 12 19 89 39
34 71 54 65 39 72 94 59 47 24
26 38 78 44 4 59 90 43 100 9
100 70 72 45 7 49 10 21 27 54
27 92 43 19 59 8 91 55 42 23
18 92 16 9 95 61 27 11 5 36
75 89 99 9 46 3 51 38 24 33
68 76 44 97 68 7 19 6 5 58
83 56 12 29 60 65 93 60 21 8
27 67 62 52 39 46 20 82 66 58
47 79 46 32 58 36 71 83 52 40
91 40 1 68 95 2 61 97 54 39
35 46 96 80 77 31 34 12 49 70
81 34 12 85 9 66 69 72 40 83
54 23 33 77 7 2 2 19 80 23
86 59 59 94 24 17 90 11 46 62
49 8 63 64 10 34 41 80 87 45
79 9 27 31 20 25 54 5 13 91
68 91 99 41 92 91 19 30 18 86
59 77 45 7 12 6 57 47 28 83
85 86 100 90 83 1 63 61 64 84
95 13 18 81 23 31 28 35 80 70
16 86 68 83 22 89 64 80 60 12
88 11 79 6 16 40 73 91 36 4
36 69 98 35 16 18 54 88 24 57
45 13 91 85 3 47 50 2 16 61
29 50 88 14 43 47 47 90 15 46
96 14 29 64 78 57 91 27 89 65
50 58 89 69 40 42 5 10 90 97
98 80 86 71 40 15 90 70 18 61
56 22 66 36 51 18 29 14 33 53
11 41 86 87 71 67 93 38 54 44
42 45 66 2 7 87 67 4 45 69
84 43 63 48 88 61 71 20 71 58
41 41 26 17 44 46 100 63 29 24
61 47 37 24 28 75 84 24 96 11
4 30 63 63 77 3 11 68 60 60
52 57 4 41 22 37 31 48 24 53
67 91 83 73 74 6 54 46 32 19
68 8 51 24 19 55 32 8 2 67
32 89 11 58 49 47 38 28 49 39
2 28 34 92 64 34 58 32 14 27
70 31 11 67 64 54 37 90 40 81
23 23 66 74 49 57 66 3 23 17
45 42 84 57 73 25 58 52 26 91
93 63 88 93 15 18 40 35 16 98
46 60 90 18 3 10 84 79 47 67
40 26 36 82 50 80 68 96 82 17
65 98 46 78 59 25 9 28 74 1
99 14 37 30 96 5 76 49 65 52
48 29 43 21 16 65 24 16 82 99
73 67 47 34 84 85 42 95 78 91
92 71 50 68 16 50 17 53 37 33
5 65 100 75 83 59 92 40 73 19
48 24 83 93 88 84 64 85 41 63
19 36 76 57 69 70 52 39 10 16
62 84 84 11 3 80 49 5 24 37
27 1 58 23 46 28 58 84 17 80
15 62 70 91 48 36 56 15 88 39
20 63 37 20 86 24 81 78 89 69
92 31 47 61 93 13 91 62 70 41
11 41 40 59 2 100 33 74 81 81
83 9 66 92 37 83 58 31 4 66
18 14 12 31 77 11 53 7 56 47
48 12 5 79 51 73 41 45 37 15
46 19 28 23 33 4 62 29 27 44
37 53 48 92 63 14 15 52 50 92
60 66 4 10 61 75 62 89 19 47
47 15 11 25 50 14 88 49 16 14
82 3 30 59 11 72 82 26 50 63
83 24 65 32 94 90 63 6 76 15
33 46 95 22 99 54 46 36 63 38
52 4 6 2 96 16 42 51 15 38
49 58 11 42 23 50 40 57 84 62
52 92 36 2 14 22 82 9 61 72
94 46 84 7 72 88 46 64 51 68
59 38 35 22 25 50 83 60 85 94
85 44 97 88 39 57 66 70 97 30
61 67 11 88 12 51 21 40 12 10
83 30 93 97 12 78 55 78 89 6
55 59 36 73 89 67 83 56 62 87
73 26 66 95 46 21 56 46 19 80
97 12 61 50 100 58 92 31 3 37
31 92 30 61 73 2 83 83 55 41
40 87 10 30 39 51 55 34 74 72
47 62 23 62 19 5 96 95 80 4
6 80 63 34 38 75 73 65 62 50
73 93 13 72 10 45 43 66 64 68
32 43 59 89 24 56 64 44 26 47
42 32 29 99 56 63 14 30 28 94
67 7 84 28 77 28 76 27 96 84
63 63 77 16 95 82 15 8 4 41
15 18 46 36 8 63 8 15 28 32
24 94 59 63 65 31 93 16 71 88
11 84 28 95 38 72 50 5 84 15
64 99 80 70 84 97 90 3 93 96
63 85 79 37 69 82 95 100 71 26
3 22 59 5 36 3 39 52 1 45
23 37 48 20 20 40 75 65 42 17
92 88 4 57 79 9 84 2 41 9
28 63 84 25 27 3 4 44 79 55
38 88 82 92 100 100 32 59 7 1
27 67 74 73 32 35 100 22 60 37
39 15 5 10 51 64 23 93 67 3
63 33 60 25 59 91 15 76 44 28
49 16 17 13 92 8 77 38 83 41
69 6 55 98 4 99 58 5 92 23
82 50 68 83 6 32 7 84 77 76
18 3 40 51 87 91 87 50 92 62
51 39 13 30 54 49 1 31 100 16
36 37 56 47 79 51 14 2 55 93
97 51 42 54 3 84 69 53 19 95
66 60 24 100 23 72 92 42 63 99
79 56 50 52 6 49 61 93 86 70
37 57 38 79 52 81 29 93 50 46
70 91 60 83 26 92 63 37 72 38
29 57 5 82 48 26 40 20 7 84
56 85 51 54 75 88 27 35 13 20
56 56 43 30 82 39 9 11 36 50
26 50 30 9 44 38 9 19 25 64
25 59 21 50 94 4 32 36 13 71
76 58 32 44 50 57 98 55 18 18
29 43 46 41 83 59 75 66 65 88
82 2 73 84 3 11 36 69 53 10
91 32 65 21 89 53 90 23 79 75
2 68 46 3 49 96 43 66 16 68
68 21 98 28 28 43 75 15 15 46
84 75 56 15 80 83 32 36 100 78
65 75 10 97 100 60 1 52 42 8
15 64 41 25 55 7 30 61 71 5
71 57 87 40 30 39 55 79 98 85
32 34 56 17 12 94 57 99 20 35
29 6 73 40 42 65 73 22 7 7
23 3 74 60 9 26 83 36 58 66
58 18 96 91 86 93 2 100 15 54
95 22 31 61 93 26 3 67 9 3
21 72 10 27 58 29 28 35 27 68
93 81 15 33 49 62 75 50 5 45
88 37 90 1 77 59 61 73 66 32
56 4 3 84 8 56 20 9 91 72
68 57 97 67 13 41 20 38 39 11
92 79 87 18 8 70 43 40 74 98
20 8 48 25 58 33 53 72 18 12
34 98 27 52 51 8 16 61 6 68
45 31 34 17 4 83 1 60 22 74
64 99 18 98 18 51 87 36 70 19
84 89 100 96 9 25 81 17 67 34
87 89 5 42 37 65 87 48 98 10
100 39 47 28 59 9 22 39 98 65
46 93 8 83 32 57 16 16 71 27
86 24 87 48 65 79 38 7 90 6
47 50 73 76 6 98 65 19 51 78
53 95 13 61 27 56 89 25 88 73
68 5 12 97 43 44 78 72 71 82
79 3 77 14 12 10 13 29 6 30
100 34 93 31 39 85 87 70 67 32
56 2 22 71 10 74 95 96 34 99
74 77 95 88 25 10 67 89 69 42
6 73 11 82 8 78 66 30 97 83
65 45 30 73 36 83 50 28 39 57
32 27 8 26 2 45 59 81 53 1
56 65 78 7 74 71 47 1 30 27
77 79 48 25 70 87 64 15 15 72
18 84 10 61 51 76 97 63 47 53
92 15 100 19 90 16 86 11 76 81
77 47 84 5 91 13 8 39 81 4
6 38 31 51 87 63 27 45 49 50
13 86 93 91 28 46 23 88 85 35
44 2 18 39 47 58 8 15 90 15
19 16 51 66 27 68 38 35 85 43
8 90 100 27 59 4 52 3 43 57
27 50 100 5 12 62 10 44 48 71
60 98 27 76 20 63 11 98 3 100
99 24 10 49 30 29 55 16 28 9
4 72 22 93 40 35 2 82 85 97
71 32 60 39 88 93 51 32 82 69
88 93 51 51 17 89 70 63 68 73
42 51 34 36 50 48 7 7 34 32
91 52 15 62 12 7 66 38 41 87
14 54 11 40 58 23 97 30 5 84
66 43 90 67 21 39 41 13 30 75
91 73 69 83 17 19 16 84 43 31
65 80 18 42 64 31 92 65 83 1
60 20 82 56 87 70 7 74 16 95
62 22 57 67 77 13 42 76 76 89
56 25 22 19 1 2 64 87 74 46
84 65 78 72 3 68 36 88 8 32
60 9 16 94 72 12 82 42 65 93
68 76 14 79 7 33 35 21 24 85
6 99 49 77 14 10 50 64 21 88
82 100 91 83 14 45 6 43 87 6
4 72 55 97 83 7 32 75 92 65
58 56 21 100 94 12 94 24 6 14
69 79 23 10 34 14 47 66 30 97
64 86 86 25 92 19 34 22 52 51
95 22 32 5 74 4 19 3 26 66
69 88 3 86 44 78 43 88 5 38
87 51 54 35 92 35 1 72 78 79
100 33 9 90 16 28 65 6 91 29
10 8 54 21 94 85 70 86 71 1
41 85 63 5 14 72 9 39 98 56
76 34 28 82 89 37 68 86 9 97
40 73 26 6 95 19 27 41 83 90
57 57 35 80 19 43 13 70 22 74
42 32 76 41 47 40 73 65 63 98
23 40 63 60 39 27 18 16 6 19
61 7 51 55 90 20 49 94 56 53
39 38 25 64 36 1 18 78 31 90
51 85 77 22 5 57 15 39 90 19
6 37 35 11 65 31 14 52 19 42
89 35 56 39 15 59 88 100 9 38
4 51 20 88 51 91 14 81 34 27
62 91 8 63 47 72 79 86 48 37
34 42 99 84 81 23 29 16 2 96
37 35 31 4 32 63 94 50 10 95
15 27 71 66 93 74 40 99 13 81
27 59 88 8 78 17 63 6 20 69
31 75 46 39 87 34 73 95 48 44
48 41 19 5 95 71 17 1 90 40
26 11 31 70 14 88 34 26 41 73
28 100 2 10 75 78 3 73 5 25
97 17 61 39 85 83 56 27 95 58
48 13 79 80 1 15 35 94 85 44
73 53 95 53 51 21 88 93 34 27
46 92 22 63 28 60 26 91 1 48
83 26 37 36 79 93 56 75 94 87
39 89 5 79 8 35 38 75 6 94
96 48 1 24 33 27 52 25 19 13
69 35 5 9 64 2 45 80 64 47
52 11 60 47 59 76 77 10 81 3
2 22 35 39 48 4 93 9 84 74
27 91 53 26 36 10 46 67 80 84
86 34 2 63 86 81 17 8 33 79
70 58 29 73 6 5 10 92 65 39
36 54 95 100 81 98 51 36 17 77
44 61 62 3 12 77 12 62 23 90
88 51 22 59 50 50 36 14 35 52
66 35 48 59 87 55 93 88 7 82
17 18 56 13 51 45 14 71 53 31
68 90 19 28 49 60 12 52 46 48
70 26 14 67 63 24 34 94 30 31
79 67 74 10 13 15 92 27 19 19
30 63 87 90 22 41 37 46 25 88
71 32 38 95 69 58 74 11 81 99
95 25 66 66 59 30 19 86 51 6
82 80 95 64 35 84 26 90 96 8
100 96 58 5 46 37 11 18 32 63
63 68 88 10 83 19 26 36 84 78
55 7 42 29 55 37 95 65 59 47
4
97
26
86
98
78
1
74
24
51
20
62
70
68
34
86
70
43
11
4
63
66
47
1
39
61
96
90
27
32
58
100
8
98
67
59
26
86
41
94
73
24
7
100
55
71
90
32
7
4
52
36
80
19
31
14
97
76
48
26
41
97
62
50
56
97
94
70
49
39
67
4
93
6
3
44
40
7
44
15
43
48
94
41
56
7
59
14
77
71
24
77
37
20
85
14
63
20
58
56
41
9
31
59
6
50
30
3
2
47
58
7
70
13
61
72
62
84
70
91
45
56
81
40
38
95
96
67
53
66
34
28
33
74
60
88
32
33
37
85
97
96
90
68
23
92
99
35
54
38
2
20
39
19
46
73
41
43
33
46
71
82
19
37
23
92
49
28
35
69
53
2
68
91
75
76
32
29
39
61
65
40
32
24
17
75
16
72
87
51
42
16
41
59
20
27
33
60
48
91
71
9
16
100
7
48
83
91
8
68
94
69
41
55
94
62
16
9
15
28
17
51
14
12
72
21
83
28
74
49
68
54
22
23
37
16
59
24
62
58
63
79
74
22
63
42
31
20
22
83
34
96
89
54
1
43
44
50
44
6
71
48
95
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Usually in Excel, you select a range and then do something to it (such as enter a formula in it,
format it, delete its contents, and so on). Therefore, it is extremely important to be able to
select a range efficiently. This is easy if the whole range appears on the screen, but it’s a bit
trickier if you can’t see the whole range. In the latter case the effect of dragging (the method
most users try) can be frustrating–things scroll by too quickly. Try one of the methods below
instead.
Or:
Click on the upper left corner, hold down the Shift key, and click on the bottom right corner.
Click on the upper left corner of the range. Then, holding the Shift key down, use the End-
arrow combinations (End-right arrow, then End-down arrow) to get to the bottom right
corner.
Or:
Split the screen so that the upper left corner shows in the upper left pane and the bottom
right corner shows in the bottom right pane. Click on the upper left corner, hold the Shift key
down, and click on the bottom right corner.
Try it! Select the range L20:AF98. Try both of the methods suggested here.
s My Excel Tutorial.xlsx, and work with the copy.
mula in it, 9 2 10
ble to 1 3 8
’s a bit
method 8 1 10
s below 7 5 4
5 1 1
5 10 7
corner.
63 61 4 36 45 85 91 23 17
52 95 40 75 28 67 79 75 49
e End-
ght 18 98 47 28 65 17 86 23 63
25 21 7 68 16 12 80 87 59
26 76 55 60 55 19 82 61 42
42 52 72 79 16 14 85 49 81
ottom 14 29 75 36 52 75 17 33 66
Shift key
87 41 48 22 25 77 3 57 32
100 71 10 11 90 15 62 24 83
59 51 90 35 94 83 77 26 79
43 72 53 21 60 22 33 67 29
19 73 49 38 33 42 49 84 8
86 58 55 59 41 63 75 19 34
7 62 41 62 26 17 95 97 79
52 78 37 18 45 98 35 40 73
18 32 62 79 86 31 58 3 14
1 89 92 86 88 94 12 49 38
71 71 58 14 37 27 73 31 83
75 18 70 77 52 6 45 8 57
2 5 21 95 16 8 66 82 72
64 89 38 32 8 51 63 86 1
64 67 81 11 34 16 30 16 39
6 30 42 3 68 27 12 86 77
87 78 33 53 48 86 17 4 61
64 64 15 28 44 65 29 10 57
58 33 81 90 48 26 55 49 34
76 54 84 66 65 78 3 88 17
15 79 47 71 19 74 58 63 57
73 85 20 100 6 46 17 24 86
43 40 26 30 59 98 46 85 23
83 54 38 91 59 27 82 98 39
41 85 63 28 29 59 47 76 81
55 72 42 24 59 41 78 1 53
23 22 17 76 50 67 17 6 97
54 74 23 86 88 85 98 79 83
81 54 24 61 41 43 13 44 91
16 86 24 58 99 49 50 93 65
31 38 91 46 44 15 23 12 32
47 67 39 26 54 85 65 52 4
69 4 10 56 89 66 13 99 22
82 28 25 20 88 92 28 97 42
66 69 81 19 78 100 57 27 52
19 85 32 47 1 69 68 16 19
58 30 88 16 44 90 9 91 68
8 98 6 1 74 2 53 35 85
4 22 18 11 61 5 100 43 49
22 89 29 84 88 18 67 12 26
5 81 48 65 9 67 13 78 55
33 95 12 21 18 73 31 17 85
57 32 94 59 15 22 18 77 4
67 55 5 66 36 26 34 82 59
4 10 12 86 91 11 73 14 28
52 69 35 8 38 63 20 68 16
46 25 70 45 99 56 34 4 98
79 71 61 38 37 66 24 97 91
28 51 23 75 42 89 79 42 22
95 41 44 60 83 57 61 59 39
40 76 54 4 46 23 28 66 29
96 61 55 1 59 67 37 96 52
3 7 17 28 87 5 98 31 62
96 37 82 70 8 56 25 41 16
39 33 1 82 35 51 71 55 66
46 15 81 86 74 69 22 85 64
23 24 3 40 30 27 73 16 85
6 64 5 95 11 15 90 36 44
72 36 24 58 23 89 45 83 68
8 34 69 26 14 77 15 8 21
48 91 81 13 94 87 18 48 63
70 29 30 5 18 75 97 27 62
57 78 44 99 59 65 31 91 38
98 92 39 60 45 75 30 34 53
45 23 30 91 89 36 9 64 11
69 70 86 55 70 5 78 71 51
50 56 42 18 47 2 85 49 53
17 20 19 68 2 10 2 12 79
55 56 25 28 1 71 64 8 7
64 68 99 77 20 38 29 96 6
87 77 77 13 85 62 4 66 11
96 72 80 61 73 72 86 49 79
76 49 49 44 70 31 67 78 20 98
76 61 77 11 51 34 31 56 61 83
73 21 16 58 34 98 16 16 3 76
29 27 56 14 91 25 91 6 63 35
44 69 9 80 23 78 100 6 96 47
7 25 30 92 61 71 26 85 93 71
50 33 13 51 65 39 29 26 41 17
3 57 3 79 32 66 4 18 40 62
66 47 88 15 53 21 64 70 1 78
61 84 100 79 8 5 42 12 28 95
71 56 28 72 4 48 24 95 93 61
49 97 11 80 93 63 95 86 51 19
37 84 29 81 94 78 9 7 89 73
98 6 20 53 54 18 4 82 59 48
72 63 10 72 6 36 30 88 50 5
26 15 87 60 88 86 45 36 76 98
52 54 16 18 26 17 24 26 34 94
28 3 11 85 63 41 71 15 42 87
78 24 41 43 29 67 82 62 63 14
87 85 64 24 24 49 30 78 73 44
91 68 20 2 43 85 42 58 20 43
65 51 49 14 73 98 20 67 33 84
24 87 38 25 46 61 68 17 26 43
4 59 86 33 25 95 28 55 17 6
92 91 96 93 29 54 7 56 2 38
23 15 74 17 57 89 12 64 28 100
97 53 7 40 45 83 35 76 57 8
4 83 8 31 50 96 96 33 80 20
49 11 52 3 58 61 34 51 43 90
75 83 37 53 99 90 65 91 21 95
91 77 31 75 6 72 36 39 51 25
24 49 12 36 47 54 76 39 22 5
7 65 34 60 47 82 72 33 20 74
74 84 32 10 84 74 22 10 26 39
51 6 88 15 60 13 17 92 71 45
18 59 20 62 17 80 12 17 78 96
88 8 30 73 2 52 71 29 21 41
70 22 27 1 50 3 15 13 41 71
57 1 79 98 30 14 12 63 11 54
10 18 90 45 74 53 80 71 3 35
65 45 72 47 25 73 82 45 29 39
80 9 78 17 35 52 54 93 74 77
28 71 63 73 18 49 41 19 11 42
87 24 38 39 66 100 74 73 12 87
80 71 49 91 9 29 46 57 47 10
34 10 76 40 93 79 81 33 7 97
34 18 86 17 49 63 39 11 36 23
36 53 17 97 64 53 44 53 28 85
97 86 25 77 59 36 86 43 73 23
84 63 99 36 53 34 59 36 36 61
8 48 60 41 33 53 1 99 83 15
67 95 47 63 73 89 94 98 4 33
64 58 75 86 75 87 12 86 60 9
77 70 92 42 91 29 47 1 6 61
44 29 57 83 93 81 40 15 68 41
58 99 92 40 22 35 2 22 16 75
9 7 62 71 50 62 16 12 49 28
76 37 22 59 66 40 58 66 14 77
95 10 74 12 13 94 72 74 86 71
72 52 32 71 18 55 72 48 65 84
72 94 49 11 94 84 79 37 61 48
43 20 5 77 86 5 19 71 53 94
69 17 99 90 76 84 14 2 41 63
2 20 44 68 34 47 77 75 8 15
97 99 41 50 82 67 13 72 40 99
65 48 77 13 71 63 5 32 53 14
71 64 93 34 51 48 55 4 36 28
29 16 6 60 50 91 58 50 74 27
76 3 18 66 54 58 74 33 95 84
13 35 9 85 46 78 100 79 62 86
95 70 8 93 88 42 64 8 96 51
54 8 68 10 100 42 10 42 28 52
70 48 77 78 55 91 47 41 83 94
17 51 67 58 70 51 87 24 24 86
67 93 73 40 50 46 24 40 58 83
23 15 42 28 56 33 99 10 30 73
92 60 90 85 83 53 39 66 37 79
95 99 57 13 74 28 33 70 22 90
89 52 100 9 74 100 64 46 37 32
47 88
33 24
5 25
98 67
41 50
55 67
65 93
45 4
81 16
25 63
92 70
2 50
42 37
62 76
57 27
59 65
59 13
85 55
59 91
70 99
73 71
7 71
20 49
92 45
88 87
76 42
24 76
14 56
73 25
48 61
72 97
30 98
52 1
64 41
45 25
55 79
59 69
13 78
41 43
74 24
100 75
66 50
49 3
42 30
98 82
43 44
63 37
29 8
68 25
84 37
65 56
90 51
93 6
53 31
45 67
16 8
73 5
3 54
33 36
87 26
32 35
65 73
23 37
98 5
95 25
40 69
63 100
69 5
63 60
36 45
12 13
74 95
91 46
36 54
53 94
51 16
6 95
29 78
98 10
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Suppose you want to format more than one range in a certain way (as currency, for example).
The quickest way is to select all ranges at once and then format them all at once.
Select the first range, press the Ctrl key, select the second range, press the Ctrl key, select the
third range, and so on.
For example, to select the ranges L3:M5 and O3:P7, click on L3, hold down the Shift key and
click on M5 (so now the first range is selected), hold down the Ctrl key and click on O3, and
finally hold down the Shift key and click on P7.
Note that in Excel 2007, the highlighting is sometimes hard to see. The shading isn’t as dark
as in previous versions of Excel, so you might be fooled into thinking you haven’t really
highlighted multiple ranges. But the above method definitely works, exactly as it always has.
s My Excel Tutorial.xlsx, and work with the copy.
example). 10 13 7 9
1 9 12 7
5 4 1 1
6 12
elect the 15 2
key and
O3, and 13 4 10
as dark
lly
ways has.
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Copying and pasting (often formulas) is one of the most frequently done tasks in Excel, and it
can be a real time-waster if done inefficiently. For example, many people scroll through a long
range to highlight it, then click on the Copy button or a Copy menu item, then scroll again to
select a paste range, and finally click on the Paste button or a Paste menu item. If this sounds
familiar, you can definitely benefit from the tips here. Actually, there are several possibilities
for efficient copying and pasting, as explained below.
Yes, you can click on the Copy and Paste buttons on the Home ribbon, but the keyboard
shortcuts are faster. Besides, they work on virtually all Windows programs, not just Excel.
Note that the copy range will still have a dotted line around it, which means that it is still
stored on the clipboard. Press the Esc key to get rid of this dotted line.
Try it! Copy the formula in cell N11 down through cell N17 using Ctrl-c and Ctrl-v.
A frequent task is to enter a formula in one cell and copy it down a column or across a row.
There are several very efficient ways to do this.
Starting with the top or left-hand cell, select the range where the results will go. (Use the
efficient selection methods described earlier, especially if this range is a long one.) Type in the
formula, and press Ctrl-Enter instead of Enter.
Try it! Fill the range N25:N31 with Ctrl-Enter. Each cell should be the product of the two values
to its left.
Pressing Ctrl-Enter enters what you typed in all of the selected cells (adjusted for relative
addresses), so in general, it can be a real time-saver. For example, it can be used to enter the
number 10 in a whole range of cells. Just select the range, type 10, and press Ctrl-Enter.
Try it! Fill up the range L37:N41 with the value 10 by using Ctrl-Enter.
If you place the cursor at the bottom right of a cell, the cursor turns into a plus sign. This is
called the autofill handle. If you want to copy a formula down, you can use the autofill handle
in two different ways. Here is the first.
Enter the formula in the top or left-hand cell of the intended range. Place the cursor on the
autofill handle at the lower right of this cell (the cursor becomes a plus sign), and drag this
If you place the cursor at the bottom right of a cell, the cursor turns into a plus sign. This is
called the autofill handle. If you want to copy a formula down, you can use the autofill handle
in two different ways. Here is the first.
Enter the formula in the top or left-hand cell of the intended range. Place the cursor on the
autofill handle at the lower right of this cell (the cursor becomes a plus sign), and drag this
handle down or across to copy.
Try it! Copy the formula in N44 down through N50 with the autofill handle.
Note that this method uses Excel’s built-in intelligence, but it works only in certain situations.
Let’s say you have numbers in the range A3:B100. You want to enter a formula in cell C3 and
copy it down to cell C100. Because this is a common thing to do, Excel does it for you if you
double-click on the autofill handle. It senses the “filled-up” range in column B and guesses
that you want another filled-up range right next to it in column C. If there were no adjacent
filled-up range, double-clicking on the autofill handle wouldn’t work.
Try it! Copy the formula in N56 down through N62 by double-clicking on the autofill handle.
s My Excel Tutorial.xlsx, and work with the copy.
el, and it
ugh a long
again to
s sounds
sibilities
3 3 9
4 1
), press
e). If you 2 3
nd, it will 2 1
5 1
oard 4 2
Excel. 3 5
s still
a row. 6 2
9 1
4 9
7 6
e the 2 3
ype in the
8 5
3 9
wo values
ative
nter the
ter.
This is 10 7 70
fill handle 6 9
on the
ag this
This is
fill handle
4 9
5 1
2 8
on the
ag this 8 10
10 7
7 8 56
2 1
tuations.
l C3 and 10 2
u if you 4 1
uesses 4 5
djacent
3 8
7 8
handle.
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Often you have a range of cells that contains formulas, and you would like to replace the
formulas with the values they produce. Usually, you paste these values onto the copy range,
that is, you overwrite the formulas with values. If you like, you can also select another range
for the paste range.
Select the range with formulas, press Ctrl-c to copy, and select the range where you want to
paste the values (which can be the same as the copy range). Then, because there is no
keyboard equivalent, select the Paste dropdown on the Home ribbon, and select the Paste
Values option.
Try it! Copy the range N3:N9 to itself, but paste as values.
The Paste dropdown on the Home ribbon (see to the right) has a number of other "special"
ways to paste. These include:
The following text boxes let you explore these options. We encourage you to explore the
other paste special options as well.
Column N to the right contains formulas. Paste these formulas to column P, but don't paste
the formats.
To copy the formatting of a range, highlight the range, press Ctrl-c, highlight the paste range,
and select Formats from Paste Special on the Paste dropdown. (When you click on Paste
Special, you get the dialog box to the right.)
Try it! Copy the formats in column P to column R. (Don't copy the values, just the formulas.)
Then enter some values in column R to check that the formatting is correct.
Note: An easy alternative to this method is to use the Format Painter button next to the Paste
dropdown (see to the right). I use this button all the time to copy formats. Just select a cell
with the format you want to copy, click on the paint brush, and click on a cell (or drag a range)
that you want to format. Note that if you double-click on the paint brush, you can copy the
format multiple times. Click on Esc when you are finished.
Sometimes you would like to multipy each number in a range by a constant. For example, if
you have revenues expressed in thousands of dollars, you might want to multiply each by
1000 so that they are then expressed in dollars.
Enter the constant in a blank cell, and copy this cell. Then highlight the range of values to
multiply and select Multiply from Paste Special on the Paste dropdown. (This same method
can also be used to add, subtract, or divide.)
Try it! Multiply each value in the range to the right by 1000. Then restore them to their
original values by dividing each value by 1000.
s My Excel Tutorial.xlsx, and work with the copy.
e the 1 1 1
y range, 2 3 6
er range
9 5 45
7 4 28
8 8 64
want to 8 10 80
no 7 6 42
e Paste
pecial"
e the
t paste 10 2 20
6 7 42
1 8 8
$47.65
$44.20
e range,
aste $37.68
$31.34
$89.36
mulas.)
$68.15
$28.57
the Paste
ct a cell
g a range)
py the
mple, if
ch by
mple, if 147
ch by 173
217
178
120
es to
method 203
137
217
eir
153
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Often you would like to move data from one range to another.
Select the range to be cut, press Ctrl-x (for cutting), select the upper left corner of the paste
range, and press Ctrl-v. (The little finger-index finger combination on your left hand is also
good for pressing Ctrl-x.)
As with copying and pasting, ribbon buttons can be used instead of key combinations, but the
key combinations are more efficient. Also, note that you need only select the upper left cell of
the paste range. Excel knows that the shape of the paste range must be the same as the
shape of the cut range.
Try it! Move the range L3:N9 so that it begins in cell L6. (Watch how relative addresses affect
the eventual formulas in column N.)
s My Excel Tutorial.xlsx, and work with the copy.
2 3 6
7 4 28
3 6 18
e paste 3 9 27
s also 6 7 42
6 6 36
s, but the 1 4 4
eft cell of
the
es affect
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Often you want to insert or delete rows or columns. Note that deleting a row or column is not
the same as clearing the contents of a row or column—making all of its cells blank. Deleting a
row or column means wiping it out completely.
Click on a row number and drag down as many rows as you want to insert. Then click on the
Insert dropdown and select Insert Sheet Rows. (Interestingly, the Insert dropdown is in the
Cells group of the Home ribbon, not on the Insert ribbon.)
If you prefer a keyboard shortcut (as I do), press Alt-i and then r (i for insert, r for row). You
can also right-click on the row labels and select Insert.
The rows you insert are inserted above the first row you selected. For example, if you select
rows 8 through 11 and then insert, four blank rows will be inserted between the old rows 7
and 8.
Try it! Insert blank rows for the data below for Feb, Apr, and May.
Click on a row number and drag down as many rows as you want to delete. Then click on the
Delete dropdown and select DeleteSheet Rows. (Again, this is in the Cells group on the Home
ribbon.)
If you prefer a keyboard shortcut, press Alt-e and then d (e for edit, d for delete).
Try it! Delete the rows you inserted in the above exercise.
To delete columns, use the keyboard shortcut Alt-e and then d, the same as for rows.
You can also hide rows or columns. I will explain hiding and unhiding rows. The same
directions work for columns.
To hide a group of adjacent rows, click on the top row number you want to hide, hold down
the Shift key, and click on the bottom row number you want to hide. This selects the rows you
want to hide. (Alternatively, you can drag the row numbers.) Then click on the Hide and
Unhide arrow from the Format dropdown on the Home ribbon (see to the right). From there,
click on Hide Rows.
You can also hide rows or columns. I will explain hiding and unhiding rows. The same
directions work for columns.
To hide a group of adjacent rows, click on the top row number you want to hide, hold down
the Shift key, and click on the bottom row number you want to hide. This selects the rows you
want to hide. (Alternatively, you can drag the row numbers.) Then click on the Hide and
Unhide arrow from the Format dropdown on the Home ribbon (see to the right). From there,
click on Hide Rows.
To unhide rows, highlight the adjacent nonhidden rows. For example, if you hid rows 51-60,
you would highlight rows 50 and 61. Then go through the same buttons as for hiding rows,
but this time click on Unhide Rows.
Person Age
1 36
2 33
3 49
4 25
5 21
6 46
7 27
8 35
9 22
10 27
11 37
12 36
13 21
14 35
15 39
16 48
17 35
18 38
19 36
20 44
21 34
22 50
23 44
24 41
25 43
26 48
27 29
28 34
29 22
30 28
s My Excel Tutorial.xlsx, and work with the copy.
mn is not
Deleting a
k on the
in the
w). You
u select
rows 7
k on the
he Home
d down
rows you
and
om there,
e
d down
rows you
and
om there,
51-60,
rows,
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Worksheets are where you place your data and formulas in Excel. Many people call them
"sheets" but this isn't exactly accurate. Strictly speaking, a worksheet is a sheet that has rows
and columns--a rectangular grid of cells. There is another kind of sheet, called a chart sheet.
This type of sheet has no rows or columns, only a chart. The discussion here is about
worksheets, not chart sheets. The actions discussed below are things you will do every day, so
make sure you know how to do them.
The name of a worksheet appears in its tab at the bottom of the screen.
To rename a worksheet:
Try it! Rename this worksheet as Worksheet Tasks. Then rename it again, to Worksheets.
You often need to add new worksheets. Excel 2007 makes this easier than ever before.
To add a new worksheet:
Click on the rightmost tab at the bottom of the screen, the tab to the right of your rightmost
worksheet tab (see to the right). This creates a new worksheet with a generic name such as
Sheet3, which you can then rename.
You can select one or more worksheets. The "active" worksheet is the one you are viewing. Its
tab is boldfaced. But others can be selected as well. If you do anything to the active
worksheet, such as format a cell or enter a value, the same thing is done to all of the selected
worksheets. This can save a lot of time with common data or formatting.
Click on the tab of the leftmost of these, hold down the Shift key, and click on the tab of the
rightmost of these.
Click on the tab of any of them, and then while holding down the Ctrl key, click on the other
tabs.
When multiple worksheets are selected, one will be active (tab boldfaced), but the tabs of the
others will be white, indicating that they are selected. They will remain selected until you click
on the tab of some other worksheet. (There is one exception to this. If all of the worksheets
are selected, you can click on any worksheet tab to activate it and deselect all of the others.)
Try it! You should already have a Practice1 worksheet. Create several more new worksheets to
its right and rename them Practice2, Practice3, and so on. Then select them all and enter the
label "This is practice" in cell A1 of the active worksheet, Practice1. By visiting the other
Practice worksheets, you should see that they all have this label in cell A1. Finally, activate the
Worksheet you are reading now (Worksheets). This deselects the Practice worksheets.
Try it! You should already have a Practice1 worksheet. Create several more new worksheets to
its right and rename them Practice2, Practice3, and so on. Then select them all and enter the
label "This is practice" in cell A1 of the active worksheet, Practice1. By visiting the other
Practice worksheets, you should see that they all have this label in cell A1. Finally, activate the
Worksheet you are reading now (Worksheets). This deselects the Practice worksheets.
You can delete one or more worksheets. However, if you try to delete all of the worksheets,
Excel will warn you that at least one has to remain.
Select the ones you want to delete, as explained in the previous text box. Then right-click on
any of the selected tabs. This brings up a context-sensitive menu, which has a few options you
might want to try. For now, click on Delete.
Note that if the worksheets have any contents, you will be asked if you really want to delete
them. Deleting worksheets can be dangerous because it cannot be undone. So be careful!
You can also move or copy a worksheet. You can do this in one of two ways: by dragging tabs
or through a Move or Copy menu item. The first way is easier; the second gives you more
options.
Drag its tab right or left to the position you want. If you hold down the Ctrl key while you are
dragging, you will make a copy of the worksheet.
Try it! Move this worksheet to the right of the Fill Series worksheet, and then move it back
again. Next, make a copy of this worksheet, just to the right of its current position. The copy
will have the name Worksheets (1), which you can then rename if you want. For now, delete
the copy.
Right-click on the worksheet's tab and select Move or Copy. This brings up a dialog that lets
you select the workbook you want to move or copy to (including a new workbook), the
position within that workbook, and whether you want to create a copy. (See the screenshots
to the right.) If you select a different workbook and you don't check the latter option, the
worksheet will no longer exist in the current file; it will move to the other workbook. So be
careful.
Try it! Create a new worksheet called Practice and enter some data in it. Then move it to a
new workbook. It will disappear from this workbook and appear in a new one. You can then
close the new workbook and delete the file.
Finally, you can hide or unhide a worksheet. For example, you might want to hide, but not
delete, a worksheet that contains technical data used in formulas in other worksheets. Of
course, you might be the recipient of such a file, with formulas you can't figure out because
they refer to data on a hidden worksheet. If you sense that something mysterious is going on,
check whether there are any hidden worksheets!
Click on the Format dropdown on the Home ribbon (not exactly where you would expect to
find this!). Then click on the Hide and Unhide arrow (see to the right). This gives you the
option to hide or unhide a worksheet. A telltale sign that there is at least one hidden
worksheet is that the Unhide option is enabled (not grayed out).
hem
has rows
t sheet.
ry day, so
eets.
re.
ghtmost
such as
ewing. Its
selected
b of the
e other
abs of the
l you click
ksheets
others.)
ksheets to
enter the
her
tivate the
s.
ksheets to
enter the
her
tivate the
s.
sheets,
-click on
ptions you
o delete
reful!
ging tabs
more
you are
t back
he copy
w, delete
hat lets
he
eenshots
, the
So be
it to a
an then
ut not
ts. Of
ecause
going on,
ut not
ts. Of
ecause
going on,
pect to
the
n
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
You can undo a sort, but just in case, it is often nice to have an "ID" column with consecutive
integers, 1,2,3, etc. This is the role of the Person column to the right. No matter how many
sorts you do, you can return to the original sort order by sorting (A-Z) on Person.
Note that I said to select a single cell before you click on A-Z or Z-A. If you highlight a range,
such as the entire State column, and then click on A-Z or Z-A, you will be asked if you want to
expand the selection (meaning to the full data set) or continue with the current selection. You
probably want the former option, not the latter one. If you continue with the current
selection, only the Salary values will be sorted, and the sorted salaries will not correspond to
the right persons.
Excel gives you many more sort possibilities with its Custom Sort item under the Sort & Filter
dropdown. This brings up a dialog box where, among other things, you can add levels (see to
the right). The example to the right illustrates why you might want to do this. Suppose you
want to sort so that all of the males are at the top. Then within each gender, you would like to
sort in A-Z order on State. Then if there are multiple people of a given gender in the same
state, you would like to sort them in decreasing order of Salary. This is possible only with a
custom sort with three levels: first Gender, then State, then Salary.
Try it! Sort the data to the right as explained above. Check that it works as intended.
Try it again! This time have the three levels be Salary, then State, then Gender. Do you see the
difference? There are no ties on Salary, so once Salary is sorted, no more sorting takes place.
In general, the lower levels apply only when there are ties in the levels above them.
Sorting columns of text can be tricky, especially when non-alphabetic symbols are present.
For example, sort in A-Z order on the Grade column to the right. Is this what you expected?
Probably not.
What about the Name column to the right, where some names are upper case and some are
lower case? By default, the sort order is case-insentive, that is, case doesn't matter. Try sorting
on Name with the A-Z button. They are indeed sorted in alphabetical order, except that Name
got sorted too. (Press Ctrl-z to undo this sort.) To prevent the label getting sorted, bring up
the Custom Sort dialog box and check the "My data has headers" item.
While you are in Custom Sort dialog box, note the Options button at the top. One option is to
Sorting columns of text can be tricky, especially when non-alphabetic symbols are present.
For example, sort in A-Z order on the Grade column to the right. Is this what you expected?
Probably not.
What about the Name column to the right, where some names are upper case and some are
lower case? By default, the sort order is case-insentive, that is, case doesn't matter. Try sorting
on Name with the A-Z button. They are indeed sorted in alphabetical order, except that Name
got sorted too. (Press Ctrl-z to undo this sort.) To prevent the label getting sorted, bring up
the Custom Sort dialog box and check the "My data has headers" item.
While you are in Custom Sort dialog box, note the Options button at the top. One option is to
check or uncheck the "Case sensitive" box. I believe it is unchecked by default. However, I
checked it and then sorted on the Name column to the right. It still sorted in alphabetical
order, ignoring case. Either this is a bug in Excel or something is wrong on my PC.
Sometimes you want to sort in a "natural" order, such as months in a year (Jan, Feb, etc.) or
days of the week (Sun, Mon, etc.). You can do this with a custom list. To get to this option,
bring up the Custom Sort dialog box, click on the Order dropdown, and select Custom List. As
shown to the right, you will see several of custom lists built into Excel, the months of the year
and the days of the week (either three-letter abbreviations or written out). You can also click
on NEW and enter your own custom list. This new custom list is remembered on your PC for
later uses.
Try it! Sort on Day, using the built-in custom list. Then create a new custom list with items
Morning, Afternoon, Evening (in this order), and sort on Time using this custom list.
s My Excel Tutorial.xlsx, and work with the copy.
t & Filter
s (see to
se you
uld like to
same
with a
u see the
es place.
tion is to
esent.
ected?
ome are
Try sorting B+ doug
hat Name
ing up B MARY
B- sam
C+ charlie
tion is to
ver, I C BOB
etical C- CHRIS
D+
D
D-
F
Suppose you want to fill column A, starting in cell A2, with the values 1, 2, and so on up to
1000. There is an easy way.
Enter the first value in the first cell (1 in cell A2). With the cursor in the starting cell (A2),
select the Fill dropdown in the Editing group of the Home ribbon and then select the Series
option to obtain a dialog box. Fill it out as shown below, that is, change the Rows setting to
Columns, make sure the Type setting is Linear, make sure 1 is in the Step Value box, enter the
final value (1000) in the Stop Value box, and click on OK.
As you can guess from this dialog box, many other options are possible. Don’t be afraid to
experiment with them.
Try it! The series of days in column L should go from 1 to 25, and in column O it should go
from 26 to 50.
s My Excel Tutorial.xlsx, and work with the copy.
The F5 key is called the "Go To" key. When you press it, you can type in any cell address (or
range name) and press Enter. You go immediately to that cell.
Try it! Use the Go To key to go directly to cell X100. (Then press Ctrl-Home to return to cell A1
so that you can do the next exercise below.)
The F5 key is much more flexible than indicated above. If you press F5 and then click on the
Special button, you can "go to" (that is, highlight) a number of different things. For example,
you can highlight a range, press F5, and select Blanks from the Special group (see the
screenshot to the right). All of the blanks in the range are then highlighted. The following
exercise shows how useful this can be.
The gray range to the right has a lot of missing values, and we would like to fill them in in the
obvious way. You could start dragging down, but there is a much easier way (especially if this
example were much larger).
See what happened? Each blank cell now has a formula that makes it equal to the cell above
it, so all of the labels are effectively copied down.
s My Excel Tutorial.xlsx, and work with the copy.
ess (or
to cell A1
ed.
Apr Q2
ll above
May
Jun
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Absolute and references are indicated in formulas by dollar signs (absolute) or the lack of
(relative), and they indicate what happens when you copy or move a formula to a range. You
typically want some parts of the formula to stay fixed (absolute) and others to change relative
to the cell position. This is a crucial concept for efficiency in spreadsheet operations, so you
should take some time to understand it thoroughly. Here are two important things to
remember:
(1) The dollar signs are relevant only for the purpose of copying or moving; they have no
inherent effect on the formula. For example, the formulas =5*B3 and =5*$B$3 in cell C3, say,
produce exactly the same result. Their difference is relevant only if you want to copy cell C3 to
some range.
(2) There is never any need to type the dollar signs. This can be done with the F4 key.
In fact, if you press the F4 key repeatedly, you cycle through the possibilities: B3 (neither row
nor column fixed), then $B$3 (both column B and row 3 fixed), then B$3 (only row 3 fixed),
then $B3 (only column B fixed), and back again to B3.
Try it! Enter the appropriate formula in cell M8 and copy across to P8. (Scroll to the right to
see the correct answer.)
Try it again! Enter one formula with appropriate absolute/relative addressing in cell N30 that
can be copied to N30:Q34. (Scroll to the right to see the correct answer.)
This is an extremely important concept in Excel. There is no better way to be efficient (and
avoid errors) than to set up a spreadsheet for copying. This often requires some careful
planning, but the time spent in planning is more than made up for by efficient copying. So
always be on the lookout for ways to make copying possible, and then take advantage of
relative/absolute addressing in your formulas to get the correct results.
s My Excel Tutorial.xlsx, and work with the copy.
ther row
fixed),
ight to
N30 that Table of revenues for various unit prices and units sold
Units sold
50 100 150 200
t (and Unit price $3.25
eful $3.50
ng. So
ge of $3.75
$4.00
$4.25
Fixed cost $50
Variable cost $2
Units sold
50 100 150 200
Unit price $3.25 $162.50 $325.00 $487.50 $650.00
$3.50 $175.00 $350.00 $525.00 $700.00
$3.75 $187.50 $375.00 $562.50 $750.00
$4.00 $200.00 $400.00 $600.00 $800.00
$4.25 $212.50 $425.00 $637.50 $850.00
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Speaking of relative and absolute addresses in formulas, it is pretty amazing how intelligent
spreadsheets are. When you copy a formula in cell C1 such as =A1+B1 down, it automatically
changes appropriately: =A2+B2, then =A3+B3, and so on. In a sense, these are all the same
formula. Each says to add the two values to the left of the current cell.
Excel allows you to see this equivalence even more clearly by viewing the formulas in a
different format, called R1C1 notation. In this format, each of the formulas in column C is
written as =RC[-2]+RC[-1]. R stands for row, and C stands for column. The fact that there is
nothing next to R means we stay in the same row. The numbers in brackets next to C mean to
go 2 columns to the left and 1 column to the left, respectively. (For columns, negative
numbers mean to go to the left, positive to the right. For rows, negative numbers mean to go
up, positive down.)
The usual way of expressing formulas, such as =C5+D5, is called A1 format. The new way
discussed here is called R1C1 format. You can easily toggle between them.
Select the Office button, select Excel options, select Formulas, and check or uncheck the R1C1
reference style option (see to the right).
Try it! Toggle between A1 and R1C1 reference style and for either, examine the formulas
inside the border and in the Total row.
Note: I read an Excel book where the author suggested that we should move exclusively to
R1C1 notation, arguing that it makes more logical sense. He might be right about the logic,
but this is never going to happen. Way too many people are way too used to the A1 notation,
and they are not about to change!
s My Excel Tutorial.xlsx, and work with the copy.
erence.
nce is
way
the R1C1
ulas
vely to
e logic,
notation,
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Many times, you will receive a spreadsheet from a colleague, and you will have absolutely no
idea how its various cells are related. Where are the constants? Where are the formulas?
How do the formulas incorporate the constants? How do the formulas build upon one
another? In these very common situations, Excel's auditing tools can be a huge help. They let
you find the precedents and dependents of any particular cell, defined as follows.
1. The precedents of any cell that contains a formula are all cells referenced by the formula in
that cell. (If a cell doesn't contain a formula, it can't have any precedents.)
2. The dependents of any cell are all cells with formulas that reference that cell.
The Formula Auditing group on the Formulas ribbon has buttons for tracing precedents and
dependents (see the screenshot to the right). If you highlight a cell and click on Trace
Precedents, you will see arrows from all of the cell's precedents to. If you click on Trace
Dependents, you will see arrows from the cell to all of its dependents. (Click on the Remove
Arrows button to get rid of these arrows.)
You can do this multiple times. For example, if you show a cell's dependents and then click
again on Trace Dependents, you will see all of the dependents' dependents.
Try it! In the example to the right, a company sends catalogs to customers, which costs
money. Unfortunately, only a small percentage of these customers responds by purchasing
something. Use the formula auditing buttons to learn what is related to what. This should
help you understand the business model and how it has been implemented in Excel.
Note: Many spreadsheets in real businesses have cells that aren't related to anything. That is,
they have no precendents or dependents. Typically, this is not good. It could mean that the
constants in these cells are "hard-coded" (entered as constants) in one or more formulas,
which is always a bad practice. It could also mean that these constants have been
incorporated in the model with "mental arithmetic" rather than formulas, another bad
practice. See if you can find examples of such "dangling" constants in the example to the
right. Then incorporate them with appropriate formulas.
A common wish is to see all of the formulas, not their values. This is easy. Just click on the
Show Formulas button in the Formula Auditing group. (This is equivalent to a keyboard
shortcut you might know: Ctrl-~.)
Try it! Click on the Show Formulas button to see all formulas in the model. Then click on this
button again to show the values.
s My Excel Tutorial.xlsx, and work with the copy.
ad
the
n the
rd
on this
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The SUM function is used so often to sum across rows or columns that a button (the S button)
is available to automate the procedure. In fact, this button is on the Home ribbon and the
Formulas ribbon (see the two screenshots to the right). To illustrate its use, suppose you have
a table of numbers in some rectangular range. You want the row sums to appear to the right
of the range, and you want the column sums to appear below the range. This is easy.
Note that if you select multiple cells, you get the sums automatically. If you select a single cell
(such as when you have a single column of numbers to sum), you will be shown the sum
formula “for your approval” and you will have to press Enter to actually enter it. Why does
Excel do it this way? I have no idea!
Note that there is a dropdown next to the summation button. If you want a sum, click directly
on the S button. Alternately, you can click on the dropdown for other options, including
Average, Count Numbers, Max, and Min (see to the right).
Try it! Use the summation button to fill in the row and column sums to the right.
s My Excel Tutorial.xlsx, and work with the copy.
S button) 51 94 15 7 167
d the 37 6 2 41 86
you have
he right 13 83 29 88 213
. 73 64 46 32 215
38 11 3 80 132
button.
single cell
sum
y does
k directly
ding
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Often you set up a spreadsheet and then decide that you would rather have a portion of it
transposed. That is, you would like to “turn it on its side,” so that rows become columns and
vice versa. This is simple with one of Excel’s Paste options.
To transpose a range:
Select a range that you want to transpose and press Ctrl-c to copy it. Then select the upper
left cell of the range where you want the transposed version to go, select the Paste
dropdown, and select the Transpose option (see to the right).
Make sure there is enough room for the transposed version. For example, if the original range
has 3 rows and 5 columns, the transposed version will have 5 rows and 3 columns. If you
select cell D5, say, as the upper left cell for the transposed version, everything in the range
D5:F9 will be overwritten by the transposed version.
Try it! Transpose the range L5:O8 to a range with upper left cell L11.
s My Excel Tutorial.xlsx, and work with the copy.
n of it Sales figures
mns and
Jan Feb Mar
North 2300 3200 4500
West 4300 3500 4200
upper
East 5500 6500 6000
nal range
you
range
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Range names are extremely useful for making your formulas more understandable. After all,
which formula makes more sense: =B20-B21 or =Revenue-Cost? Efficient use of range names
takes some experience, but here are a few useful tips.
Select a range that you want to name. Then type the desired range name in the upper left
“name box” on the screen. (This box is just above the column A heading. It usually shows the
cell address, such as A1, where the cursor is. See to the right.) Make sure you press Enter
after typing the range name; otherwise, the name you type won't "stick."
Many useful range name options appear in the Defined Names group on the Formulas ribbon
(see to the right). For example, you can use the Define Name option to name a range. Typing
the range name in the name box is quicker and more intuitive, but the buttons in the Defined
Names group give you many more options. By the way, range names are not case sensitive, so
that Revenue, revenue, and REVENUE can be used interchangeably.
Try it! Name the rectangular range containing the numbers Data.
To manage range names, you should use the Name Manager on the Formulas ribbon. This
enables you to modify or delete a range name.
Select the Name Manager on the Formulas ribbon. This shows a list of all range names in
your workbook (see to the right). Click on the one you want to modify or delete. Then click on
Edit or Delete. Note that if you click on Edit, you can change the name and/or the range that
the name refers to.
Try it! Rename the above range of numbers as MyData. Then delete the MyData range name.
Suppose you have the labels such as Revenue, Cost, and Profit in some range, and you would
like the adjacent cells (which will contain the values of revenue, cost, and profit) to have
these range names. There is a quick way to do this.
Select the range consisting of the labels and the cells to be named. Then click on the Create
from Selection button in the Defined Names group on the Formulas ribbon. In the resulting
dialog box, make sure the appropriate option (in this case, Left Column) is checked, and click
on OK.
Excel tries, usually successfully, to guess where the labels are that you want to use as range
names (see the screenshot to the right). You can always override its guess.
Try it! Name the ranges P34:P39, Q34:Q39, and so on according to the labels in row 33.
names (see the screenshot to the right). You can always override its guess.
Try it! Name the ranges P34:P39, Q34:Q39, and so on according to the labels in row 33.
Sometimes you enter a formula using cell addresses, such as =B20-B21. Later, you name B20
as Revenue and B21 as Cost. The formula does not change to =Revenue-Cost automatically.
However, you can make it change (and hence become more readable) as follows.
Highlight the formula, and select Apply Names from the Define Name dropdown in the
Defined Names group (see to the right). Then highlight all range names that apply to this
formula. (Actually, you can highlight several formulas and apply range names to them all at
once.)
Try it! You should now have the range names UnitsSold and Revenue for the ranges M34:M39
and O34:O39. Apply these to the SUM formulas in cells M40 and O40.
If you have many range names, it is often useful to show a list of them and the range
addresses they apply to.
Select a cell with plenty of blank space below it, select the Use in Formula dropdown in the
Defined Names group, and click on the Paste Names option.
Try it! Paste a list of all range names, starting in cell P63.
s My Excel Tutorial.xlsx, and work with the copy.
After all, 71 31 9 69 5
ge names 15 74 46 84 27
14 49 25 38 83
40 43 20 75 83
28 72 30 92 75
er left
hows the 41 56 90 89 73
Enter 28 81 43 81 61
as ribbon
e. Typing
e Defined
nsitive, so
n. This
es in
n click on
nge that
ge name.
33.
33.
ame B20
atically.
he
this
m all at
M34:M39
n in the
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Printing Excel worksheets is easy -- well, sort of. If you want to print a worksheet, activate it
and press Ctrl-p. This brings up the dialog box to the right, showing the printer and a number
of settings. You can simply click on OK and hope for the best. However, as you have probably
experienced, the printout might not be what you want. There might be too many pieces of
paper printed, and they might be broken into pages in an unappealing way.
You can gain a lot more control over printing by first visiting the Page Setup dialog box. You
get this dialog box from the Page Layout ribbon by clicking on the little arrow at the bottom
right of the Page Setup group. (You can try the other buttons in this group, but I like the Page
Setup dialog box, which is unchanged from previous versions of Excel.) The Page Setup dialog
box has four tabs, two of which are shown below. Here are some comments/suggestions.
1. The Page tab allows you to choose between Portrait and Landscape. In the Scaling section,
you can change the settings to get a better fit to the paper. If I don't have too much on a
worksheet, I tend to select the "Fit to" option and let everything else as is. Then I am assured
that my selected Print area (see next point) will be printed on a single piece of paper.
2. The Sheet tab lets you specify the Print area you want printed. You can also specify
whether you want Gridlines and/or Row and column headings to show.
So experiment with these (and many other ) print options. You do have a lot of control over
what is printed and how it looks on the paper. Save some trees!
By the way, you might sometimes find that certain objects like text boxes, buttons, and arrows
do not get printed. To remedy this, right-click on the object, select Size and Properties, and
click on the Properties tab. This contains a "Print object" option that you can check or
uncheck.
s My Excel Tutorial.xlsx, and work with the copy.
tivate it
number
probably
eces of
ox. You
bottom
the Page
up dialog
tions.
section,
on a
m assured
.
ol over
nd arrows
es, and
or
Payment #NUM!
There are many useful functions in Excel. You should become familiar with the ones most
useful to you. For example, financial analysts should learn the financial functions. But there
are a few that everyone should know, and they are covered in this section.
By the way, I capitalize the names of these functions, just for emphasis. However, they are not
case sensitive. You can enter SUM or sum, for example, with the same result.
Some of these functions are so useful that Excel automatically applies them to selected
ranges (when at least two cells are selected). The results are displayed in the status bar at the
bottom of the screen. If you right-click in any blank space on the status bar, you can check the
functions you want to be visible.
Try it! Highlight any parts of the data to the right and look at the status bar.
s My Excel Tutorial.xlsx, and work with the copy.
If you haven’t used the fx button located just to the left of the formula bar, you should give it a
try. I like to call it the function wizard. It not only lists all of the functions available in Excel (by
category), but it also leads you through the use of them. As an example, suppose you know
there is an Excel function that calculates payments on a loan, but you are not sure what its
name is or how to use it. You could proceed as follows.
Select a blank cell where you want the function to go. Press the fx button and click on the
category that seems most appropriate (Financial in this case). Scan through the list for a likely
candidate and select it (try PMT). At this point you can get help, or you can press the OK
button and enter the appropriate arguments for the function (interest rate, term, and
principal, the latter expressed as a negative number).
Some people use the function wizard as a "crutch" every time they want to enter an Excel
function. I don't recommend this for functions you know well because it takes more time.
However, the function wizard is great for learning how to use functions you are less familiar
with.
Try it! Use the function wizard to help you determine the function in cell M8. (Scroll to the
right to see the correct formula.)
s My Excel Tutorial.xlsx, and work with the copy.
d give it a Payments for Mr. Jones, who just bought a new car
Excel (by
u know
hat its Amount financed $15,000
Annual interest rate 8.90%
Term (number of months financed) 36
Monthly payment
n the
or a likely
OK
d
Excel
time.
familiar
to the
Payment $476.30
The SUM function is probably the most used Excel function of all. It sums all values in one or
more ranges.
Enter the formula =SUM(range), where range is any range. This sums the numeric values in
the range. If there are any nonnumeric or blank cells in this range, they are ignored.
Actually, it is possible to include more than one range in a SUM formula, separated by
commas. (This can also be done with the COUNT, COUNTA, AVERAGE, MAX, and MIN
functions.) For example, =SUM(B5,C10:D12,Revenues) is allowable (where Revenues is the
name for some range). The result is the sum of the numeric values in all of these ranges
combined. Again, if any cells in any of these ranges are nonnumeric or blank, they are
ignored.
Try it! Use the SUM function in cell M12 to calculate the total of all costs.
Enter the formula =AVERAGE(range) where range is any range. This produces the average of
the numeric values in the range.
Note that the AVERAGE function ignores labels and blank cells. So, for example, if the range
C3:C50 includes scores for students on a test, but cells C6 and C32 are blank because these
students haven’t yet taken the test, then =AVERAGE(C3:C50) averages only the scores for the
students who took the test. (It does not automatically average in 0s for the two who didn’t
take the test.)
Try it! Use the AVERAGE function to calculate the averages in cells P21 and P24. (For P24, you
will have to replicate the exam scores in column N and make some changes.)
s My Excel Tutorial.xlsx, and work with the copy.
n one or Table of costs for units produced in one month (along side)
for use in another month (along top)
Student ID Exam score Average (for students who took the exam)
1533 68
8031 74
erage of 9859 80 Average (giving 0s to students who were absent)
9106 63
e range 3535 72
e these 8192 Absent
es for the 6102 85
didn’t
6774 70
7558 64
P24, you
314 72
9082 81
2397 75
2517 80
2432 73
6016 63
5269 80
4847 88
6537 71
9922 73
4525 71
1491 71
7897 68
4088 82
166 76
7925 75
6405 81
802 76
2931 83
7625 67
2628 67
5417 92
7804 72
3994 69
394 85
8847 78
7855 81
8668 Absent
3738 77
5534 70
6965 71
8863 69
8762 73
6466 60
6100 76
1878 74
5970 67
9691 62
8666 77
4865 91
6198 81
8554 87
6753 76
9574 77
3891 81
8186 Absent
1306 73
6835 83
3136 59
4938 74
4807 74
4421 78
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The COUNT function counts all of the cells in a range with numeric values. The COUNTA
function counts all nonblank cells in a range. The COUNTBLANK function counts all blank cells
in a range.
To use the COUNT function:
Enter the formula =COUNT(range), where range is any range. This returns the number of
numeric values in the range.
For example, if cells A1, A2, and A3 contain Month, 1, and 2, respectively, then
=COUNT(A1:A3) returns 2, whereas =COUNTA(A1:A3) returns 3.
Note that Excel is a bit inconsistent in the terms it uses on the status bar. If you highlight a
range and look at the status bar, it will show "Count" and "Numerical Count." The first
corresponds to COUNTA, and the second corresponds to COUNT.
Try it! Use the COUNT, COUNTA, and COUNTBLANK functions to fill in cells O4, O7, and O10.
s My Excel Tutorial.xlsx, and work with the copy.
The MAX function returns the largest numeric value in a range. Similarly, the MIN function
returns the smallest numeric value in a range.
Try it! Use the MAX and MIN functions to fill in the range M9:N10.
Note that MAX and MIN work only on numeric data. If you have a list of names, you might
expect MIN and MAX to return the first and last in alphabetical order, but they don't. Too bad!
(There are two other functions called MAXA and MINA, but I'm not sure why anyone would
want to use them.)
s My Excel Tutorial.xlsx, and work with the copy.
oduce
Min sales Max sales
Jan
Feb
might
. Too bad!
would
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
IF functions are very useful for performing logic, and they vary from simple to complex. I will
provide a few examples.
A simple example is =IF(A1<5,10,“NA”). Note that if either of the expressions is a label (as
opposed to a numeric value), it should be enclosed in double quotes.
Try it! Enter appropriate IF formulas in columns C and D. (Scroll to the right to see the
answer.)
Sometimes IF functions are nested. For example, there might be three possibilities,
depending on whether the value in cell A1 is negative, zero, or positive. A nested IF formula
can then be used as follows.
Try it! Use a nested IF function to fill in the grades in column C. (Scroll to the right to see the
answer.)
Sometimes more complex conditions (AND/OR conditions) are useful in IF functions. These
are not difficult once you know the syntax.
Note the syntax. The keyword AND is followed by the conditions, separated by a comma and
enclosed within parentheses. Also, note that more than two conditions could be included in
the AND, all separated by commas.
Try it! Use an IF function with an AND condition to fill in the bordered range. (Scroll to the
right to see the correct answer. Make sure you use double quotes for labels.)
Try it! Use an IF function with an AND condition to fill in the bordered range. (Scroll to the
right to see the correct answer. Make sure you use double quotes for labels.)
Try it! Use an IF function with an OR condition to fill in the bonuses in column F. (Scroll to the
right to see the answer.)
s My Excel Tutorial.xlsx, and work with the copy.
ex. I will For each product, if the end inventory is less than or equal to 50 units,
enough units are ordered to bring stock back up to 200; otherwise, no
units of that product are ordered
ndition Product End inventory Order placed (yes or no)? # of units ordered
true, and
1 100
2 40
el (as 3 20
4 70
e
Each student gets an A (if score is 90 or above), S for satisfactory (if score
ormula if 60 or above but less than 90) or U for unsatisfactory if score is below 60
. These Investor sells stock only if its price has gone up three consecutive days
(including the current day)
Any student who scores at least 95 on any of the exams gets a bonus
which is 1% of their total score.
ults in
it results
Student Exam 1 Exam 2 Exam 3 Exam 4 Bonus
1 87 83 83 80
2 77 72 74 97
oll to the 3 80 95 79 75
4 82 87 96 88
5 78 94 81 79
6 75 83 80 72
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Lookup tables are useful when you want to compare a particular value to a set of values, and
depending on where your value falls, assign a given “answer.” For example, you might have a
tax table that shows, for any gross adjusted income, what the corresponding tax is. There are
two versions of lookup tables, vertical (VLOOKUP) and horizontal (HLOOKUP). Because they
are virtually identical except that vertical goes down and horizontal goes across, I will discuss
only the VLOOKUP function. Besides, VLOOKUP appears to be used much more frequently
than HLOOKUP.
The VLOOKUP function takes three arguments plus an optional fourth argument: (1) the value
to be compared, (2) a lookup table, with the values to be compared against always in the
leftmost column, and (3) the column number of the lookup table where you find the
“answer”; and (4) TRUE or FALSE (which is TRUE by default if omitted). Because the VLOOKUP
function is often copied down a column, it is usually necessary to make the second argument
an absolute reference. This can be accomplished by giving the lookup table a range name
such as LookupTable (range names are always treated as absolute references), but a range
name is not necessary.
The most common use of a lookup table is when the values in the first column (the
comparison column) are sorted in ascending order. (Then the fourth argument can be
omitted.) Let’s say you want to assign letter grades to students based on a straight scale:
below 60, an F: at least 60 but below 70, a D; at least 70 but below 80, a C; at least 80 but
below 90, a B; and 90 or above, an A. The example to the right shows how you would set this
up. The comparison column in the lookup table starts at 0 (the lowest grade possible), then
records the cutoff scores 60 through 90.
Create a lookup table with at least two columns, where the values in the left column are in
ascending order. Then enter the formula =VLOOKUP(value,lookup table,column #), as
described above.
Try it! Enter a lookup table in columns P and Q, and VLOOKUP functions in column N. Assume
there is a quantity discount pricing scheme: for orders less than 300 units, the unit price is $3;
for orders of at least 300 units but less than 400, the unit price is $2.50; for orders of 400
units or more, the unit price is $2. (Scroll to the right to see the answer.)
There are times where the first column of the lookup table are not sorted in ascending order.
This is still allowable, but then you need to include the fourth argument with value FALSE in
the VLOOKUP function. In this case, VLOOKUP will look for an exact match and will return an
error if doesn’t find an exact match.
Try it! Use a VLOOKUP function in column N to find the gradepoints for each student.
Note that the grades in column P of the lookup table are in the “natural” order, but they are
There are times where the first column of the lookup table are not sorted in ascending order.
This is still allowable, but then you need to include the fourth argument with value FALSE in
the VLOOKUP function. In this case, VLOOKUP will look for an exact match and will return an
error if doesn’t find an exact match.
Try it! Use a VLOOKUP function in column N to find the gradepoints for each student.
Note that the grades in column P of the lookup table are in the “natural” order, but they are
not in Excel’s A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the
VLOOKUP function.
s My Excel Tutorial.xlsx, and work with the copy.
e
cale:
0 but
d set this
e), then
n N. This
rgest
KUP
table
.
hey are
ng order.
ALSE in
eturn an
Davis A- 3.7 A- 3.7
Edwards C+ 2.3 B+ 3.3
. Johnson B- 2.7 B 3
hey are Myers B+ 2.7 B- 2.7
nt in the Smith A 4 C+ 2.3
Thomson C 2.7 C 2
C- 1.7
Total cost Lookup table
$932.50 0 $3.00
$950.00 300 $2.50
$918.00 400 $2.00
$882.00
$714.00
$872.50
$860.00
$609.00
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
There are a number of math functions you might find useful. I will list a few of the most
common ones here. For more technical math functions, click on the fx button and browse the
Math and Trig category.
The INT function takes a decimal value and returns an integer by "chopping off" the decimal.
More exactly, it returns the integer just to the left of the given decimal number on the
number line. It does not round to the nearest integer. To use it:
Enter the formula =INT(value), where value is a number or a reference to a cell with a
number.
Try it! In row 8, apply the INT function to the numbers in row 7.
The ROUND function rounds a value to the number of decimals you specify. To use it:
Try it! In row 18, apply the ROUND function to the numbers in row 16, using the decimals
values in row 17.
The ABS function returns the absolute value of a number. To use it:
Enter the formula =ABS(value), where value is a number or a reference to a cell with a
number.
Try it! In row 27, apply the ABS function to the numbers in row 26.
The SQRT function returns the square root of a number. To use it:
Enter the formula =SQRT(value), where value is a number or a reference to a cell with a
number. If value is negative, this returns an error.
Try it! In row 34, apply the SQRT function to the numbers in row 33.
Enter the formula =LN(value), where value is a number or a reference to a cell with a number.
If value is zero or negative, this returns an error.
Try it! In row 41, apply the LN function to the numbers in row 40.
Note: There is also a LOG10 function, which returns the log to the base 10 that you might
have learned in high school. There is also a LOG function, where you can supply the base. But
LN tends to be used in most real applications.
If value is zero or negative, this returns an error.
Try it! In row 41, apply the LN function to the numbers in row 40.
Note: There is also a LOG10 function, which returns the log to the base 10 that you might
have learned in high school. There is also a LOG function, where you can supply the base. But
LN tends to be used in most real applications.
The EXP function returns the exponential function of a number. That is, if you apply EXP to
some number x, the result is the special number e to the power x, where e is approximately
2.718. In math books, you see this written as ex.
It turns out that EXP and LN are "inverses" of one another. If you start with a number x and
take EXP of it, and then take LN of the result, you end up with x.
To use the EXP function:
Enter the formula =EXP(value), where value is a number or a reference to a cell with a
number.
Try it! In row 52, apply the EXP function to the numbers in row 51. Then in row 53, apply the
LN function to the numbers in row 52. Note that the value you get in cell L52 is e.
The SUMSQ function returns the sum of squares of numbers. To use it:
The RAND function returns a random number uniformly distributed between 0 and 1. That is,
the random number is just as likely to be near any number between from 0 to 1 as to any
other number between 0 and 1. To use it:
Enter the formula =RAND(). This is a function with no arguments (nothing inside the
parentheses), but the parentheses must be included.
You can enter this formula in as many cells as you like, and each will have a different random
number. Also, these numbers are "live." If you press the recalc (F9) key, they will all change.
Try it! Enter the RAND function in cell L72 and copy it to some range. Then press the F9 key a
few times and watch the random numbers change.
Until Excel 2007, the RAND function was the only function for generating random numbers.
Fortunately, another very useful function, RANDBETWEEN, was added in Excel 2007. It takes
two integer arguments and generates a random integer between these two values (inclusive)
so that all of the possibilities are equally likely. To use it:
Enter the formula =RANDBETWEEN(min,max), where min and max are two integers (with
min less than max).
Try it! Generate random rolls of a die (1 to 6) in several cells to the right. Then press the F9
key to see how they change randomly.
so that all of the possibilities are equally likely. To use it:
Enter the formula =RANDBETWEEN(min,max), where min and max are two integers (with
min less than max).
Try it! Generate random rolls of a die (1 to 6) in several cells to the right. Then press the F9
key to see how they change randomly.
s My Excel Tutorial.xlsx, and work with the copy.
ost
owse the
:
100.35 14325 16.3467 154432 0.3569
e to a cell 0 -2 2 -3 1
decimals
cimals. If
d
imals
6 -50 0
ha
64 0.5 -20 0
th a
a number.
might
base. But
might
base. But
EXP to 1 -4 2.3 0 15
imately
r x and
pply the
21 43 4 21 35
1. That is,
o any
random
change.
F9 key a
mbers.
It takes
nclusive)
(with
the F9
(with
the F9
Payment $0.00
Nothing tells a story better than a well-designed chart, and Excel provides many, many
charting possibilities. In fact, whole books have been devoted to Excel charts. I can't hope to
cover all of the possibilities here, but I can illustrate how to create basic charts quickly and
easily.
If you have created a lot of charts in Excel 2003, but you are new to Excel 2007, you will see
some significant changes. The most important are listed below.
1. To create a chart, use the Insert ribbon. It has a Charts group with buttons for Column, Line,
Pie, Bar, Area, Scatter, and Other Charts. Each button has a dropdown for the various
subtypes.
2. Once you have a chart and then select it (that is, click somewhere on it), you get three new
Chart Tools tabs: Design, Layout, and Format (see below). The corresponding ribbons have
plenty of buttons for modifying an existing chart. Probably the most important of these is the
Select Data button on the Design ribbon, which lets you edit the data range(s) the chart is
based on. Of course, you can experiment with the other buttons, and you can also
experiment by right-clicking on various parts of a chart to see the possibilities.
You could spend a lot of time reading thick chapters or even entire books on Excel charts, but
it is better to experiment on your own. You can learn a lot by modifying an existing chart in
various ways. You might not learn some of the esoteric tools this way, but you will learn the
tools you use most often.
s My Excel Tutorial.xlsx, and work with the copy.
ny
hope to
ly and
will see
umn, Line,
s
hree new
s have
ese is the
art is
harts, but
hart in
arn the
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Probably the easiest way to create a chart, based on a given data set, is to highlight at least
part of the data set, including the data to be charted and the labels for the horizontal axis, if
any, and select one of the chart types from the Insert ribbon. You will almost certainly want to
modify the resulting chart, but this at least gives you a good start.
The example to the right is typical. I want a column chart of monthly sales, so I highlighted
the entire data range, L3:M15 (including the labels in row 3), and selected a column chart (of
the first subtype) from the Insert ribbon. The only change I made to the chart was to delete
the legend. Excel guessed, correctly, that I wanted to chart one series, Sales, and that I
wanted the dates in column L to be used as labels for the horizontal axis.
Here is another example. I have monthly sales of two products, and I want a line chart that
contains both series. I highlighted the entire data range, L19:N31, and selected a line chart
with markers from the Insert ribbon. This time, the legend is appropriate, so I kept it.
However, there was no title above the chart, so I added one (from the Chart Tools Layout
ribbon). Note that the horizontal axis titles are vertical by default. If you would rather have
them at an angle, right-click on the horizontal axis and select to format the alignment of the
axis labels.
The most important concept in charts is a series. Every Excel chart contains one or more
series. In the first chart above, there is one series, Sales. In the second chart, there are two
series, Sales1 and Sales2. Typically, each series is a column of data, with a label at the top,
although series are sometimes in rows, as in the example to the right (which is simply the
transpose of the example above). Again, I highlighted the entire data range in rows 35-37 and
inserted a line chart. Excel guessed, correctly, that my data series were in rows, not columns.
But what if it makes the wrong guess? See the example below.
The data set to the right contains sales data for 4 products in 6 regions. I highlighted the
entire data range, L53:P59, and inserted a line chart. What are the series? By default, Excel
created a line for each product, with the region lables on the horizontal axis. That is, it
guessed that the columns are the series. Suppose you would rather have the rows as the
series, that is, you would rather have a line for each region. This is easy.
Try it! Create a column chart (of the first subtype) for the data to the right, where each series
corresponds to a product.
Sometimes you change your mind and want to have another chart type.
Click anywhere on the chart and click on the Change Chart Type button on the Chart Tools
Design ribbon.
Try it! Change the column chart you just created to a line chart. Make sure each series still
corresponds to a product.
By highlighting the appropriate data and then inserting a chart, you usually get what you
want. But suppose you create a chart and it doesn't chart the right data. You can either delete
this chart and start over, or you can modify the data series.
Click anywhere on the chart and click on the Data Series button on the Chart Tools Design
ribbon. This brings up a dialog box with the series charted on the left and the data used for
the horizontal axis labels on the right. You can then edit (or delete) any of these.
Try it! I created the line chart to right by highlighting the data range N81:Q86, without the
months or the labels in row 80. There are three problems: (1) the months should be labels on
the horizontal axis; (2) the "junk" series shouldn't be part of the chart; and (3) the two sales
series should be named by the labels in cells P80 and Q80. Open the Data Series dialog box
and fix these problems.
Try it! I created the line chart to right by highlighting the data range N81:Q86, without the
months or the labels in row 80. There are three problems: (1) the months should be labels on
the horizontal axis; (2) the "junk" series shouldn't be part of the chart; and (3) the two sales
series should be named by the labels in cells P80 and Q80. Open the Data Series dialog box
and fix these problems.
One chart type that works a bit different from the others is the scatter chart. This type of
chart is useful for detecting relationships between two variables, such as height (inches) and
weight (pounds) in the data to the right.
To create the chart, I highlighted the range M96:N106 and inserted a scatter chart of the first
subtype. I then changed the title, deleted the legend, and added horizontal and vertical axis
titles. If you open the Data Series dialog box, you will see that there is one series, Weight.
However, if you click on Edit for this series, you will see that there is a Y-series and an X-series.
By default, when you select two columns for a scatter chart, the data in the rightmost column,
in this case Weight, is the Y-series (it goes on the vertical axis), and the other is the X-series (it
goes on the horizontal axis). If you want them reversed, you have to go through the Data
Series dialog box.
Try it! Starting with the scatter chart to the right, change it so that Height is on the vertical
axis and Weight is on the horizontal axis. (You will have to change the axis titles manually.)
s My Excel Tutorial.xlsx, and work with the copy.
ore Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09
re two Sales1 $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586
e top,
y the Sales2 $8,452 $6,801 $5,497 $10,329 $5,995 $8,103 $6,386 $5,047
5-37 and
olumns.
the Product1 Product2 Product3 Product4
, Excel Region1 $4,311 $3,683 $4,255 $4,673
it
the Region2 $1,838 $2,372 $2,496 $1,207
Region3 $2,643 $1,245 $3,963 $2,182
Region4 $3,394 $3,539 $2,877 $1,989
Region5 $1,058 $3,669 $4,127 $4,279
rt Tools Region6 $4,417 $4,151 $4,127 $3,077
6000
you Month Junk1 Junk2 Sales1 Sales2
her delete Jan-09 79 91 $3,508 $4,333 5000
Feb-09 28 12 $3,681 $4,781
4000
Mar-09 31 69 $3,109 $3,935
Apr-09 1 16 $4,440 $2,399
Design 3000
sed for May-09 89 41 $1,947 $1,749
Jun-09 30 52 $1,333 $4,449 2000
ut the
labels on 1000
wo sales
log box 0
1 2 3
ut the
labels on 1000
wo sales
log box 0
1 2 3
1 2 3 4 5 6
1 2 3 4 5 6
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
A chart can be placed in one of two locations: on a worksheet (probably the worksheet that
contains the data the chart is based on), or on a separate chart sheet (a sheet that has no
rows or columns, only a chart). Some people prefer the first option, and others prefer the
second. It is totally a matter of taste. When you create a chart from the Insert ribbon, the
chart automatically goes on the worksheet with the data. However, it is easy to move it.
Highlight the chart, and click on the Move Chart button on the Chart Tools Design ribbon (see
below). You can then choose from the above two options.
Try it! Move the chart to the right to a separate chart sheet. (This chart sheet will have a
generic name like Chart1, but you can rename it if you like.) Then move the chart back to this
worksheet. Note that when you move the chart back to this worksheet, the chart sheet will
disappear.
s My Excel Tutorial.xlsx, and work with the copy.
Once you create a chart and ensure that it charts the correct series, you are usually still not
finished. Just about everything you see on the chart can be modified to suit your taste (or tell
the story better). Here are some, but certainly not all, of the changes you can make:
Try it! I got the top chart to the right by highlighting the range M3:N15 and inserting a scatter
chart of the first subtype. Then I modified it quite a lot to produce the bottom chart. Repeat
this exercise by creating the default scatter chart and then modifying it to look like my
finished version.
Hints: If you click on a point on a scatter chart, you select all of the points. But you can select
a single point by clicking twice in a row (not double-clicking but clicking once and then
clicking again.) However, this still didn't help with the label at the top. The only data labels
you can add to points on a scatter chart are the X-values or the Y-values. I wanted to add the
month label to the point near the top, so I had to resort to a text box (from the Insert ribbon).
Clearly, you can spend a lot of time modifying a chart. Sometimes it is time well spent, and
sometimes it isn't. You have to use common sense. My best advice is: Make sure it looks
professional, make sure it tells the story clearly, and keep it simple! Usually simple charts look
best and tell the story best.
s My Excel Tutorial.xlsx, and work with the copy.
an select
en Sale of product 2 versus sales of product 1
labels
35,000.0
add the March
t ribbon). 32,500.0
30,000.0
nt, and
Product 2 ($1000s)
ooks 27,500.0
harts look
25,000.0
22,500.0
20,000.0
17,500.0
15,000.0
5,000 6,000 7,000 8,000 9,000 1
Product 1 ($1000s)
Sales2
$9,000 $10,000
s of product 1
This tutorial is built around hyperlinks, links like the one in cell A1 that let you maneuver
easily from one worksheet to another. If you have never tried using hyperlinks in your Excel
files, you should start now. They are really easy.
To create a hyperlink such as the one in cell A1 that takes you back to the Table of Contents
worksheet, right-click on a cell and select Hyperlink to bring up the dialog box below. Enter
the label you want in the "Text to display" box. Then, as you can see in the list on the left, you
can choose several types of hyperlinks. The ones I have used for this tutorial are of type
"Place in This Document", where you can select a worksheet and a cell reference to jump to.
The other types you will probably use most often are "Existing File or Web Page" and "E-mail
Address". Actually, Excel is quite smart about Web sites and email adresses. For example, if
you enter a URL in a cell such as http://www.amazon.com, you won't even need the dialog
box to the right. Excel will immediately sense that this is a URL, and it will add the hyperlink
automatically. Then when you select this cell, your default browser will open and take you to
the specified URL. Or if you enter an address that looks like an email address, such as
jones@aol.com, Excel will sense that this is an email address and will add a hyperlink
automatically. Then when you select this cell, your default email program will start up, with a
new message to this address.
Once you have a hyperlink in a cell, you can modify or delete it by right-clicking on the cell
and choosing Edit Hyperlink or Remove Hyperlink.
s My Excel Tutorial.xlsx, and work with the copy.
uver
ur Excel
ontents
. Enter
e left, you
ype
ump to.
d "E-mail
mple, if
dialog
perlink
e you to
s
k
p, with a
he cell
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Do you remember your high school algebra class where you had to solve a single equation for
a single "unknown" value? You can do this in Excel with the Goal Seek tool. The unknown is
called a changing cell. Essentially, you want to change the value in this cell to force a formula
in some other cell to be equal to a specified value.
A simple example of this appears to the right. Demand for a company's product is determined
by a linear demand curve: the higher the price, the lower the demand. The company
produces exactly enough to meet demand, with the given unit cost of production. The
company wants to find the breakeven price, that is, the price that makes profit equal to 0. We
can do this with Goal Seek. Here are the steps.
1. Choose Goal Seek from the What-If Analysis dropdown on the Data ribbon.
2. Fill in the resulting dialog box as shown to the right. Specifically, the price in cell M4 should
be changed so that the profit in cell M12 is 0.
If you try this, you will see that the result isn't very interesting. It turns out that the price
should be set to 100, at which point the demand is 0, and this yields no sales and no profit. It
is probably more interesting to force the profit to some positive value.
Try it! See if you can change the price so that profit equals $12,500.
Note: For numerical reasons, Goal Seek can't force profit to exactly the value you specify; it
only gets close. For example, when I tried to force profit to 0, I got the result in the dialog box
to the right, indicating that profit got forced to the very small "current value" shown. If this
isn't close enough, you can change an Excel setting to make it closer. Click on the Office
button, then on Excel Options, and choose the Formulas group. Then change the "Maximum
Change" to a smaller value (more decimals).
s My Excel Tutorial.xlsx, and work with the copy.
price
profit. It
ecify; it
ialog box
. If this
ffice
aximum
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Data tables, also called what-if tables, allow you to see very quickly how one or more outputs
change as one or two key inputs change. This is called sensitivity analysis, or simply what-if
analysis, and it is a key part of most business models.
There are two types of data tables: one-way tables and two-way tables. A one-way table has
one input and any number of outputs. A two-way table has two inputs but only one output. I
will demonstrate both types on the following two worksheets.
Business models are all about what-if questions. What would happen to profit if our unit cost
increased by x%? What would happen to our sales if our competitor's production decreased
by y%? And so on. Data tables are perfect for answering these types of questions in a
systematic way, and they are surprisingly easy to create. Therefore, it is always surprising to
me that so few business students (and business employees) are aware of data tables. This is a
very valuable skill, so make sure you learn it!
Some data tables are very long (many rows), and each value might require the recalculation
of a complex business model, so the recalculation of the entire data table might take a while,
several seconds or even minutes. By default, this recalculation occurs every time anything in
the spreadsheet changes. So you could be waiting and waiting for many data table
recalculations. For this reason, there is an Excel calculation setting you can change.
Click on the Office button, then Excel Options, then on Formulas. There you can change the
Calculation mode from Automatic to Automatic except for data tables (see to the right).
With this setting, a data table will not recalculate until you want it to. You can force it to
recalculate by pressing the Recalc (F9) key.
By the way, there is one other calculation setting you will see, Manual. With this setting,
nothing recalculates until you press the F9 key. It's hard to think of a time you would need this
setting, except maybe to mess with your colleagues's minds!
s My Excel Tutorial.xlsx, and work with the copy.
e outputs
what-if
able has
output. I
unit cost
creased
a
ising to
. This is a
ulation
a while,
ything in
nge the
ht).
t to
tting,
need this
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
A one-way data table lets you see how one or more selected outputs change as a single input
varies over some range.
To illustrate, suppose Mr. Jones buys a new car for $20,000, makes a $5,000 down payment,
and finances the remaining amount over the next 36 months at a 6.5% annual interest rate.
There are at least two outputs that might be of interest: the monthly payment and the total
interest paid through the duration of the loan. These are affected by the four inputs in blue to
the right.
Let’s first look at a simple one-way data table, which illustrates how a single output, monthly
payment, varies as the annual interest rate varies. This is shown in the example to the right.
Enter a link for the output in cell P5. Specifically, because the monthly payment was
calculated with the PMT function in cell M9, enter the formula =M9 in cell P5. Then, starting
in cell O6, enter any sequence of interest rates. Select the entire table—the range O5:P10.
Next, select the Data tab, and in the Data Tools group, select Data Table from the What-If
Analysis dropdown (see top screenshot to the right). Finally, enter M6, the interest rate cell,
as the column input cell. There is no row input cell, so leave it blank (see bottom screenshot
to the right).
It is important to understand exactly what happens when you do this, so read this paragraph
several times until it sinks in. Excel takes each interest rate in column O, substitutes it into the
column input cell you designated (cell M6), recalculates the formula in cell M9 with this new
interest rate (and hence the link in cell P5, the one I colored gray for emphasis), and records
the answer in the data table. You use a column input cell because the possible values of the
input (the interest rates) are listed in a column.
You can tell you have a data table by looking at any of the "answer" cells, such as cell P6. It
contains a formula =TABLE(,M6), surrounded by curly brackets. The part inside the
parentheses shows the row and column input cells, the first of which is blank in this example.
The curly brackets indicate that this is an array formula. Essentially, this means that it is
entered in all of the answer cells of the data table at once, as a group. You never need to
enter this formula; you create the table as explained above. However, the formula documents
what the answer range contains.
It is also possible to capture multiple outputs in a one-way data table. An example appears to
the right, where the single input is still the interest rate, but there are two outputs: monthly
payment and total interest paid. This table is formed exactly as before except that the table
range is now O39:Q44.
Try it! Create a one-way data table that shows the monthly payments and the total interest
paid for each term (value in cell M51) from 12 to 48 in increments of 12. (Scroll to the right
for the answer.)
Try it again! Delete the data table you just created. Next, change the calculation setting from
Automatic to Automatic except for data tables, as explained on the previous worksheet.
Create the data table again. You should see the same value through the table. Press the F9
key to get the right answers. Then go back and change the calculation setting to Automatic.
s My Excel Tutorial.xlsx, and work with the copy.
starting
5:P10.
hat-If
ate cell,
eenshot
aragraph
t into the
this new
records
s of the
l P6. It
example.
t is
ed to
ocuments
Two-way tables allow you to vary two inputs, one along a row and one along a column, and
capture a single output in the body of the table. The example to the right illustrates this,
where the annual interest rate and the amount of the down payment both vary, and the
single output is the monthly payment.
To create this table (which I already did for you):
Enter the formula =M9 for the single output in the upper left corner, cell O4, of the data table.
(Again, I colored this cell gray for emphasis.) Enter any sequence of down payments to the
right of this and any sequence of interest rates below this. Next, select the Data menu, and in
the Data Tools group, select Data Table from the What-If Analysis dropdown. Finally, enter M4
as the row input cell, and enter M6 as the column input cell (see to the right).
As with one-way tables, you can tell you have a data table by looking at any of the "answer"
cells, such as cell P5. Each contains the formula =TABLE(M4,M6), surrounded by curly
brackets. This formula indicates that M4 is the row input cell and M6 is the column input cell.
In words, the values for down payment go across the top row of the table, and the values for
interest rate go down the left column of the table.
Remember that a two-way data table allows only one output. If you want to analyze multiple
outputs, you have to create multiple data tables, one for each output.
Try it! Create a two-way data table that shows the total interest paid for each term from 12 to
60 in increments of 12, and each down payment from $4000 to $6000 in increments of
$1000. Put down payments along the top, terms along the side. (Scroll to the right for the
answer.)
s My Excel Tutorial.xlsx, and work with the copy.
nswer"
y
nput cell.
alues for
multiple
It is very common to work with "data sets" in Excel, where a data set is typically arranged in a
rectangular range with "observations" in the rows, "attributes" in the columns, and attribute
names in the top row. (Attributes are also called variables or fields.) A typical data set appears
to the right. Each row is an observation on some person, and each column is lists an attribute
about the people.
Excel users have worked with data sets for years, and for several versions of Excel, they were
known somewhat informally as "lists." But in Excel 2007, they gained much more prominence
and became known as "tables." This was a much needed change. You can do so many useful
tasks with the new tables that you either couldn't do before or could do only with extra work.
Now these tasks are easy.
It is not enough to have a rectangular range of data to apply the new tools. You must
designate the range as a table. There are two ways to do this, both equally easy. For each,
make sure your cursor is somewhere (anywhere) in the table. Then:
Excel guesses that the range "surrounding" the cursor position is the table range, but you can
override this guess if necessary.
Try it! Designate the data set to the right as a table. You will see that the formatting changes,
and you will see two other important changes. First, there is a dropdown arrow next to each
attribute name. These are used for sorting and filtering, as discussed below. Second, if your
cursor is inside the table, there is a new Table Tools Design tab and corresponding ribbon. It
contains the tools for manipulating the table.
If you don't want the range to be a table, I suggest that you first select a table style that is
"plain" (like a regular worksheet). Then click on Convert to Range on the Table Tools Design
ribbon. The dropdown arrows will disappear. Try this on the table you just created.
One of the main uses of tables is filtering, that is, hiding (but not deleting) rows that don't
match various conditions. Filtering is done through the dropdown arrows next to the column
headings. I won't even begin to explain all of the options, but with a little bit of
experimenting, you should be able to master them in no time. Just remember that they build
upon one another. For example, if you filter on Gender so that only males are showing, and
you then filter on Children so that only people with at least 2 children are showing, you will
see only males with at least 2 children.
Try it! Designate the data set to the right as a table if necessary, and then experiment with the
filters. Note that there are number filters, text filters, and date filters. Experiment with all of
them.
To clear a filter, click on the columns dropdown arrow and select the Clear Filter item. To clear
all filters, click on the Clear button in the Sort & Filter group on the Home ribbon. (It is also on
the Data ribbon.) Try it now by clearing all your filters.
To clear a filter, click on the columns dropdown arrow and select the Clear Filter item. To clear
all filters, click on the Clear button in the Sort & Filter group on the Home ribbon. (It is also on
the Data ribbon.) Try it now by clearing all your filters.
You probably noticed that when you clicked on a column dropdown arrow, there are also
sorting options. I already discussed sorting in a previous worksheet, and the options here are
about the same. If sorting in tables provides any advantages over sorting in regular (non-
table) data sets, I haven't noticed them.
One important advantage of a table is that you can summarize filtered data easily. To do so,
check the Total Row box on the Table Tools Design ribbon. This generates a "total" row below
the table. By default, it shows the sum of the values in the rightmost column. But it gives you
many more options. If you click on any cell in the total row, you will see a dropdown list of
ways you can summarize the column (count, sum, average, and others). And importantly, if
you then filter the data, the summary measures will be only for the filtered data. (This
couldn't be done, at least not easily, before Excel 2007.)
Try it! Create a total row fo the table to the right, and show summary measures that seem
appropriate. Then filter in some way and see whether the summary measures change.
A feature of tables that business people will love is that they expand automatically as new
data is added. For example, suppose you designate the data set to the right as a table. Later
you add new products to the right or new monthly sales at the bottom. These will
automatically be part of the table. Better yet, if you build a chart from the table, the chart will
update automatically to include new data. (The same is true of pivot tables built from tables.)
Try it! Designate the data set to the right as a table. Next, highlight the entire table and insert
a line chart. By default, you should see a line for each product, with time on the horizontal
axis. Now add a couple more months of data at the bottom of the table and add a new
product with some reasonable data at the right of the table. The chart should update
automatically!
s My Excel Tutorial.xlsx, and work with the copy.
seem
e.
Pivot tables are a manager's dream. They allow you "slice and dice" data in a typical data set
in all sorts of ways. Essentially, you use pivot tables to break down variables like revenue or
items sold by categories, such as by region, by month, by store, and so on.
Pivot tables have been included in Excel since the late 1990s, and each new version has
changed them slightly. Then Excel 2007 changed them a lot, or at least it changed the user
interface for pivot tables a lot. This was evidently in response to users who complained that
the old interface was not very user friendly. Although I don't happen to agree with this
complaint (I always though pivot tables were pretty easy to use), I agree that the Excel 2007
user interface is better than ever. In fact, I know of no tool in any software package that
enables you to get so much information so quickly and easily.
Probably the only thing that makes pivot tables difficult for some users is that there are so
many options. Whole books have been written about pivot tables. I don't recommend them,
simply because they spend a lot of pages and directions explaining options that are quite
intuitive. Rather than read such books, I recommend that you learn the essentials and then
experiment. The discussion here will get you started, but I make no attempt to explain
anywhere near all of the possibilities.
The data set to the right is typical. Each row is a sale to some customer. The last two variables,
Items Ordered and Total Cost, are numeric, so they are candidates for breaking down by the
categorical variables to their left.
To create a pivot table, place your cursor somewhere (anywhere) in the data set and click on
the Pivot Table button on the Insert ribbon. Excel guesses the data range, which you can
override if necessary, and it asks where you want the pivot table to be placed.
Try it! Create a pivot table from this data set, and place it on a new worksheet. The new
worksheet's name will be something generic like Sheet9, and it will be located just to the left
of this worksheet. Rename the new worksheet Practice Pivot Table. (To keep from having to
go back and forth between worksheets, you might want to copy this text box and the ones
below to the new worksheet.)
You should see a blank pivot table to the left, and if your cursor is inside it, you should see a
Pivot Table Field List window on the right and two PivotTable Tools tabs (Options and Design)
and corresponding ribbons at the top. (I'll say it again. The field list window and the pivot
table tabs are visible only when your cursor is inside a pivot table. So if they disappear, you'll
know why.)
The key is the field list on the right. The top pane shows all of the available fields (columns),
and the bottom pane shows the four areas you can drag these to. Rather than listen to a long
explanation, try the following:
Drag Gender to the Row Labels area, drag Region to the Column Labels area, drag Paid With
to the Report Filter area, and drag Total Cost to the Values area. You have just broken down
Total Cost by Gender, Region, and Paid With. Each number in the pivot table is the sum of
Total Cost for its particular category values.
Here are some other things you can do to the pivot table you just built:
1. By default, the sums are for all categories of the Report Filter variable. To show sums only
for VISA sales, say, click on the dropdown arrow next to Paid With and select VISA.
2. You can hide any row or column categories. For example, click on the Column Labels
dropdown and select only Midwest and West.
3. You can change the way Total Cost is summarized and the way its values are formatted. To
do so, right-click on any of the numbers in the pivot table and select Value Field Settings. (You
will do this often, so remember it.) In the Summarize by list, select Average. Then click on the
Number Format button and select a number format in the usual way. Now you see the
average of Total Cost for the various categories.
4. In the bottom pane of the field settings window, drag Gender to the column area and
Region to the row area. This is called pivoting. (So guess why they're called pivot tables!)
5. In the bottom pane of the field settings window, drag any of the fields to a blank space on
the worksheet (or simply uncheck its box in the top pane). This removes the field from the
pivot table. There is no requirement that each of the four areas must contain a field.
6. You can have two (or even more) fields in a given area. For example, put both Region and
Time in the row area. It starts to get "busy," but you are certainly allowed to do it.
7. You can sort the values in the row or column area through the dropdown arrows, but the
sort order might not be the "natural" order. For example, drag Time to the row area (and drag
any other variable off). The natural order is Morning, Afternoon, Evening, but this isn't what
you get with a sort. Fortunately, there is a trick. Select the Morning cell, and place your cursor
at the bottom of the cell so that it becomes a 4-way arrow. Now drag it up above Afternoon.
8. With your cursor in the pivot table, click on the PivotChart button on the PivotTable Tools
Options ribbon, and select a chart type. You not only get a very nice-looking Excel chart, but it
updates automatically as you make changes in the pivot table. That is, the pivot table and the
corresponding pivot chart are perfectly synchronized. Make some changes to the pivot table
to see what I mean. This is almost too good to be true!
If the field in the Values area is numeric, as it usually is, then you probably want to summarize
it by sums or averages. But you can also summarize by counts. Then it doesn't matter which
field is in the Values area.
Try it! Start over by dragging everthing off the pivot table. Now drag Region to the row area,
Gender to the column area, and any variable to the Values area.
If you drag a text variable to the Values area, you get counts by default. But let's say you drag
a numeric variable such as Total Cost to the Values area. Then you will have to right-click on
any number in the pivot table, select Value Field Settings, and select Count to summarize by.
(If you do the latter, it's a good idea to change the Custom Name in the Value Field Settings
dialog box to Count, rather than Count of Total Cost. The reason is that Total Cost has nothing
to do with the counts, so including it in the label is misleading.) In either case, you can then
reformat the counts as integers if necessary.
Each count shows the number of customers in the category. For example, you should see that
there are 43 females from the Midwest.
If you drag a text variable to the Values area, you get counts by default. But let's say you drag
a numeric variable such as Total Cost to the Values area. Then you will have to right-click on
any number in the pivot table, select Value Field Settings, and select Count to summarize by.
(If you do the latter, it's a good idea to change the Custom Name in the Value Field Settings
dialog box to Count, rather than Count of Total Cost. The reason is that Total Cost has nothing
to do with the counts, so including it in the label is misleading.) In either case, you can then
reformat the counts as integers if necessary.
Each count shows the number of customers in the category. For example, you should see that
there are 43 females from the Midwest.
Sometimes it is more informative to display the counts as percentages. To do this, open the
Value Field Settings dialog box in the usual way, click on the "Show values as" tab, and select
the "% of row" item from the dropdown list. You should see, for example, that 26.5% of all
female customers are from the NorthEast. Do it again, but this time select the "% of column"
item. Now you should see, for example, that 32.26% of all South customers are male. You can
experiment with these and other "Show values as" options. It all depends on how you want to
"tell the story."
The last useful feature I will discuss is grouping. If you drag a field to, say, the row area, you
will get a row for each distinct value of that field. If there are a lot of distinct values, the pivot
table will become unwieldy and probably not very useful. In this case, it is a good idea to
group on the field.
Try it! Start over by dragging all of the fields off the pivot table. Then drag Date to the row
area and Total Cost to the Values area.
Note that there is some summarizing going on here because multiple sales were made on
some of the dates, but there are too many dates for a manager to get much sense of what is
happening through time. So it is useful to group on dates.
Try it! Right-click on any date, select Group, and then select Month. Now you see total sales in
each of the 4 months.
If this data set were over a multi-year period and you grouped as above, you would see all of
the Januaries lumped together, and similarly for the other months. To see them broken down
by year, the trick is to select Month and Year from the Group dialog box.
There can be a distinct advantage to building a pivot table from a table instead of from a fixed
range. The advantage is that if you decide to add rows or columns to the table, the table
expands automatically, as explained in the previous worksheet, and the pivot table can then
be refreshed with the click of a button to accommodate the new data. That is, you do not
need to build a new pivot table.
Try it! Designate the data to the right as a table. It will get a default table name, such as
Table2, which you can change if you like. Then build a pivot table from the table. You will
notice that the data source box (labeled Table/Range) contains the name of the table, not a
range address. This is what you want. Now go back and add a new column to the right of the
table (possibly with a formula) and/or add some extra data to the bottom of the table. Go
back to the pivot table and click on the Refresh button on the PivotTable Tools Options
ribbon. The pivot table is automatically populated with the new data!
back to the pivot table and click on the Refresh button on the PivotTable Tools Options
ribbon. The pivot table is automatically populated with the new data!
Excel 2010 includes a new feature for pivot tables called a slicer. As far as I can tell, this is
essentially equivalent, except for the user interface, to a variable placed in the Report Filter
area. For example, if you build a pivot table from the data to the right, you can then select to
insert a slicer based on the Time variable. You will see a new window for this slicer with three
buttons: Morning, Afternoon, and Evening. By clicking on any of them (or any combination of
them), you are simply filtering the pivot table on these categories. Maybe after some
experience, I will see some benefit of a slicer over a variable in the Report Filter area, but I
haven't seen it yet.
s My Excel Tutorial.xlsx, and work with the copy.
data set Date Day Time Region Paid With Gender Items Ordered
nue or 10-Mar Mon Morning West VISA Female 4
10-Mar Mon Morning West Mastercard Female 1
has 10-Mar Mon Afternoon West VISA Female 5
e user 10-Mar Mon Afternoon NorthEast VISA Female 1
ed that
his 10-Mar Mon Afternoon West Mastercard Male 4
el 2007 10-Mar Mon Afternoon NorthEast VISA Female 5
hat 11-Mar Tues Evening West Mastercard Male 1
11-Mar Tues Evening South VISA Male 4
are so 11-Mar Tues Evening West Cash Male 2
d them,
quite 12-Mar Wed Morning MidWest Mastercard Female 1
d then 12-Mar Wed Morning NorthEast Mastercard Female 2
in 12-Mar Wed Afternoon South VISA Male 2
13-Mar Thurs Morning NorthEast VISA Male 3
13-Mar Thurs Afternoon NorthEast Mastercard Male 1
14-Mar Fri Morning West Mastercard Female 3
14-Mar Fri Afternoon West VISA Male 5
14-Mar Fri Afternoon South Cash Female 6
variables, 14-Mar Fri Afternoon West VISA Female 4
n by the 15-Mar Sat Morning South Mastercard Male 1
15-Mar Sat Afternoon South Cash Male 1
click on 16-Mar Sun Morning West VISA Male 4
can 16-Mar Sun Afternoon West VISA Male 2
16-Mar Sun Evening West Mastercard Female 9
ew 17-Mar Mon Afternoon South VISA Female 1
o the left 17-Mar Mon Evening West VISA Male 3
aving to
e ones 18-Mar Tues Morning NorthEast Mastercard Female 5
18-Mar Tues Afternoon South Mastercard Male 3
ld see a 18-Mar Tues Evening MidWest Mastercard Male 3
d Design) 19-Mar Wed Afternoon MidWest VISA Male 1
pivot 19-Mar Wed Afternoon South Cash Female 2
ar, you'll
20-Mar Thurs Morning West Mastercard Female 3
20-Mar Thurs Afternoon NorthEast VISA Male 4
lumns), 20-Mar Thurs Afternoon NorthEast VISA Female 2
to a long
20-Mar Thurs Evening West VISA Female 2
21-Mar Fri Morning West VISA Female 7
id With 21-Mar Fri Afternoon South Mastercard Female 2
n down
um of 21-Mar Fri Evening NorthEast VISA Male 4
22-Mar Sat Morning NorthEast Mastercard Female 2
22-Mar Sat Morning MidWest Mastercard Male 2
22-Mar Sat Morning NorthEast Cash Female 8
22-Mar Sat Evening West VISA Male 4
22-Mar Sat Evening West Mastercard Male 6
22-Mar Sat Evening West Cash Female 1
22-Mar Sat Evening West VISA Male 2
23-Mar Sun Afternoon MidWest VISA Female 1
24-Mar Mon Morning South Mastercard Female 3
ms only
24-Mar Mon Morning NorthEast Mastercard Female 6
24-Mar Mon Afternoon South Mastercard Female 1
els 24-Mar Mon Afternoon West Mastercard Female 3
24-Mar Mon Afternoon South Cash Female 2
atted. To 25-Mar Tues Morning West Mastercard Female 2
ngs. (You 25-Mar Tues Afternoon South Mastercard Female 5
ck on the
he 25-Mar Tues Evening West Cash Male 4
26-Mar Wed Morning West VISA Female 2
and 27-Mar Thurs Morning West Mastercard Female 4
les!) 27-Mar Thurs Afternoon West Cash Female 8
28-Mar Fri Morning NorthEast Mastercard Female 1
pace on
m the 28-Mar Fri Afternoon South Mastercard Female 1
28-Mar Fri Afternoon West Mastercard Male 3
28-Mar Fri Evening NorthEast VISA Male 2
on and
29-Mar Sat Morning NorthEast VISA Female 2
29-Mar Sat Morning NorthEast Cash Male 4
but the 29-Mar Sat Morning MidWest Mastercard Male 3
(and drag
n't what 29-Mar Sat Morning NorthEast Mastercard Female 3
our cursor 29-Mar Sat Afternoon NorthEast Cash Female 3
ernoon.
29-Mar Sat Afternoon MidWest Cash Male 2
le Tools 29-Mar Sat Afternoon South VISA Female 1
art, but it 29-Mar Sat Afternoon MidWest VISA Male 4
e and the
ot table 29-Mar Sat Evening NorthEast Cash Male 4
29-Mar Sat Evening South VISA Female 2
30-Mar Mon Afternoon South Mastercard Female 2
30-Mar Mon Evening West VISA Female 2
31-Mar Wed Afternoon South VISA Female 7
31-Mar Wed Afternoon MidWest Mastercard Male 5
31-Mar Wed Evening West Mastercard Male 6
31-Mar Wed Evening NorthEast Cash Male 2
1-Apr Thurs Morning NorthEast Cash Male 4
1-Apr Thurs Afternoon West Mastercard Female 9
ummarize 1-Apr Thurs Afternoon NorthEast Cash Female 6
r which 1-Apr Thurs Afternoon West Mastercard Female 1
2-Apr Fri Morning MidWest Mastercard Female 3
w area, 2-Apr Fri Afternoon MidWest Mastercard Female 2
2-Apr Fri Afternoon NorthEast VISA Female 6
you drag 2-Apr Fri Afternoon NorthEast Mastercard Female 3
click on 3-Apr Sat Morning South VISA Female 4
arize by. 3-Apr Sat Afternoon South Mastercard Male 3
ettings
s nothing 3-Apr Sat Afternoon West VISA Female 2
an then
d see that
you drag
click on
arize by.
ettings
s nothing
an then 3-Apr Sat Evening NorthEast Mastercard Male 3
4-Apr Sun Morning MidWest VISA Female 1
d see that 4-Apr Sun Afternoon South Cash Male 3
5-Apr Mon Morning NorthEast VISA Male Low
pen the 5-Apr Mon Afternoon MidWest VISA Male Low
d select 5-Apr Mon Afternoon MidWest Mastercard Female Low
% of all 5-Apr Mon Afternoon NorthEast Mastercard Female Low
column"
. You can 5-Apr Mon Evening NorthEast VISA Female Low
u want to 6-Apr Tues Morning NorthEast Cash Female Low
6-Apr Tues Afternoon NorthEast VISA Female Low
6-Apr Tues Afternoon South Mastercard Female Medium
6-Apr Tues Evening MidWest Mastercard Female High
7-Apr Wed Evening West VISA Male Low
8-Apr Thurs Morning NorthEast VISA Male Low
8-Apr Thurs Morning West Cash Female High
ea, you 8-Apr Thurs Morning West Mastercard Female Low
the pivot 8-Apr Thurs Evening MidWest Cash Male Low
ea to
9-Apr Fri Morning West VISA Male Medium
9-Apr Fri Morning NorthEast Mastercard Male Low
e row 9-Apr Fri Morning West Mastercard Male Low
9-Apr Fri Morning NorthEast Mastercard Female High
de on 9-Apr Fri Morning West Cash Male High
f what is 10-Apr Sat Morning South Mastercard Female Low
10-Apr Sat Morning MidWest Cash Female Low
al sales in 10-Apr Sat Afternoon MidWest Mastercard Male Medium
10-Apr Sat Afternoon South Mastercard Female High
see all of 10-Apr Sat Evening NorthEast Cash Male Low
ken down 10-Apr Sat Evening MidWest VISA Male Low
11-Apr Sun Afternoon West VISA Female High
12-Apr Tues Morning MidWest Mastercard Female High
12-Apr Tues Morning NorthEast Mastercard Female High
12-Apr Tues Afternoon South Mastercard Female High
12-Apr Tues Afternoon NorthEast Mastercard Female High
om a fixed 13-Apr Wed Afternoon South Mastercard Female High
able 14-Apr Fri Morning South Cash Female Medium
an then
o not 14-Apr Fri Afternoon MidWest Mastercard Male Medium
14-Apr Fri Afternoon West VISA Female High
15-Apr Sat Morning South Cash Male Low
h as
will 15-Apr Sat Morning MidWest VISA Female Medium
e, not a 15-Apr Sat Morning MidWest VISA Female Low
ht of the 15-Apr Sat Afternoon West VISA Male Medium
e. Go
ns 15-Apr Sat Afternoon NorthEast Cash Female Low
15-Apr Sat Evening MidWest Cash Female High
15-Apr Sat Evening West Mastercard Female High
16-Apr Sun Afternoon West Cash Male High
ns
Of all the tools available in Excel, conditional formatting is arguably the "coolest." As the
name implies, conditional formatting allows you to format cells depending on conditions you
specify. The cool part is that the formatting changes automatically if the cell values change.
For example, suppose you use conditional formatting to color a cell red if its value is greater
than 100. If its current value is 90, it won't be red, but if you change its value to 110, it will
turn red automatically.
Conditional formatting was available before Excel 2007, but it wasn't very prominent, and
most users didn't even know it was available. Now it is very prominent, right in the middle of
the Home ribbon. It is also much easier to use. As illustrated below, many uses of conditional
formatting are really easy, but a few are tricky.
A typical use of conditional formatting is to color all "high" values one color and all "low"
values another color. In the example to the right, suppose you want to color all high scores
green and all low scores, where a high score is greater than the value in cell O4 and a low
score is less than the value in cell O5. To do so:
Try it! Perform the above steps. Then change the values in cells O4 and O5 and watch how the
formatting changes automatically.
If you want to get rid of the formatting, click on the Conditional Formatting dropdown and
then on Clear Rules.
If you want to change the formatting rules, click on the Conditional Formatting dropdown and
then on Manage Rules.
As you can see when you click on the Conditional Formatting dropdown, there are a lot of
"built-in" choices that are very easy to apply. Try out some of the following:
The Highlight Cell rules let you format numbers that satisfy inequalities, as in the example
above, and they also let you format text or dates that satisfy natural conditions.
The Top/Bottom rules let you format the top (or bottom) x items (or x percent of items),
where you can choose x. For example, you can format the maximum number in a list by
specifying the top 1 item.
The Data Bars, Color Scales, and Icon Sets are amazing (and can be overdone). The point of
all of them is to different levels of values, such as salaries or sales values.
Try it! Use any interesting formats you like to format the dates, text, or numbers to the right.
Remember that you can always modify the formats or clear them.
The Data Bars, Color Scales, and Icon Sets are amazing (and can be overdone). The point of
all of them is to different levels of values, such as salaries or sales values.
Try it! Use any interesting formats you like to format the dates, text, or numbers to the right.
Remember that you can always modify the formats or clear them.
You can get even more control by building your own rules. You do this by clicking on the
Conditional Formatting dropdown and then on New Rule. The resulting dialog box has more
options than I can explain here, so I will provide just one example.
In the data set to the right, I have entered monthly sales data for 6 regions. Actually, I have
entered these as random numbers with the RANDBETWEEN function, so if you press the F9
key, they will all change in a random way. (This makes the example even more impressive!)
Suppose we want to color the maximum sales value in each column green. One way is to do it
separately for each column, formatting the top 1 item. However, this takes too much time,
especially if there were many more columns. Here is a better way.
If you can understand how this formula works, you can do some pretty amazing conditional
formatting. Remember that you highlighted the entire sales range, but M57 is the active cell
(because you started the dragging from it). The formula as written applies to cell M57.
Specifically, if its value is the maximum value in column M, it is formatted green. But because
the entire sales range is highlighted, the formula is applied, in a relative sense, to each cell in
the range. The rows in the MAX function are made absolute because the maximum is always
over these rows.
s My Excel Tutorial.xlsx, and work with the copy.
he right.
22 2/9/1947 Male Illinois 1 $62,100
23 4/1/1989 Male Wisconsin 0 $78,000
24 3/12/1970 Male Ohio 0 $43,200
25 3/28/1970 Male Indiana 1 $44,500
26 5/6/1963 Male Michigan 1 $43,300
the 27 5/7/1959 Male Ohio 3 $45,400
as more 28 3/6/1987 Male Indiana 2 $53,900
29 2/9/1958 Male Michigan 1 $44,100
I have 30 8/4/1955 Female Indiana 2 $31,000
the F9
ssive!)
is to do it Month Region1 Region2 Region3 Region4 Region5 Region6
h time, Jan-09 $4,375 $2,045 $3,136 $2,000 $3,958 $2,924
Feb-09 $2,355 $4,426 $2,244 $1,082 $4,898 $1,153
Mar-09 $3,496 $4,302 $1,231 $2,578 $2,918 $2,179
ea Apr-09 $4,054 $2,209 $3,421 $1,553 $2,015 $4,481
May-09 $1,530 $2,145 $4,597 $2,836 $2,429 $3,118
Jun-09 $2,041 $1,455 $2,771 $1,537 $4,147 $4,327
Jul-09 $1,182 $4,843 $2,754 $1,816 $2,036 $4,559
minimum
en and Aug-09 $1,184 $1,550 $4,902 $3,220 $2,225 $2,865
Sep-09 $3,937 $1,752 $1,205 $1,005 $3,501 $1,119
Oct-09 $2,781 $4,371 $2,295 $1,170 $1,439 $2,882
ditional
ctive cell Nov-09 $4,342 $1,840 $3,925 $3,206 $4,614 $4,925
7. Dec-09 $4,536 $1,797 $2,650 $1,050 $3,731 $2,249
because
ch cell in
s always
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
At some point, you might be developing spreadsheets for others to use, and you might want
to force them to use certain values in certain cells because other values wouldn't make sense
or wouldn't satisfy business rules. You can do this fairly easily with data validation. There are
actually many, many possibilities, but I will illustrate only the most common here. All of the
options are found from the Data Validation item on the Data Validation dropdown on the
Data ribbon. This leads to a fairly self-explanatory dialog box (see to the right). All of the
examples below assume you have selected the cell you want to validate, and they assume
that you have opened this dialog box and have chosen the Settings tab.
Try it! Force the values in the gray cells in column L to have values indicated by the labels to
their right. Add your own input messages and error alerts. Then try entering some
appropriate and inappropriate values in the gray cells.
Probably the easiest data validation is to allow the user to choose from a dropdown list of
values. To do this, first create the list somewhere, usually out of sight to the far right. Then
from the Allow dropdown in the Data Validation dialog box, select the List item, and in the
Source box, provide a cell reference to the list. When the user selects the cell to be validated,
a dropdown arrow will automatically appear, with the values in the list to choose from.
Try it! The example to the right lets a user enter an amount to be financed, an annual interest
rate, and a term (number of months to pay), and it returns the monthly payment (using the
PMT function that has already been entered). Create a list out to the right somewhere that
contains the possible terms: 12, 24, 36, 48, and 60, and then create a data validation for the
term cell that lets the user choose from these 5 values. Check that it works.
Suppose you want to make sure the person enters a valid date in a cell. This is a great place
for a data validation. By choosing the Date option from the Allow dropdown, you can force
the user to enter only values that are recognized as dates. This is no small achievement!
In addition, you can put limits on the dates. For example, suppose you want the person to
enter the date he took out a loan. This must not only be a date, but it can't be in the future.
To allow only such dates, you can select "less than or equal to" from the Data dropdown and
then enter the following formula in the End date box: =TODAY(). The effect is that the user
will not be allowed to enter a future date, regardless of today's date.
Try it! Create the date validation just described in cell M39. Then enter incorrect and correct
entries to see how it works. (Can you change it so that only dates at least a week ago are
allowed? Just change the formula slightly.)
In addition, you can put limits on the dates. For example, suppose you want the person to
enter the date he took out a loan. This must not only be a date, but it can't be in the future.
To allow only such dates, you can select "less than or equal to" from the Data dropdown and
then enter the following formula in the End date box: =TODAY(). The effect is that the user
will not be allowed to enter a future date, regardless of today's date.
Try it! Create the date validation just described in cell M39. Then enter incorrect and correct
entries to see how it works. (Can you change it so that only dates at least a week ago are
allowed? Just change the formula slightly.)
s My Excel Tutorial.xlsx, and work with the copy.
ht want
ake sense
here are
of the
n the
the
sume
n, choose
can also
options in
abs, Input
when she
hat the
any integer between 1 and 10
abels to any decimal number between 1 and 10
any positive integer
any negative decimal number
any integer between the values in cells N25 and O25
30 40
son to
future.
own and
e user
d correct
o are
son to
future.
own and
e user
d correct
o are
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
If you are creating an Excel file for others to use, you probably don't want them to mess up
the formulas you entered so carefully. In fact, you might not even want them to be able to see
the formulas (company secrets?). Excel gives you plenty of options for protecting (or
unprotecting) your work. I will explain a few of them here. You can then experiment with
others.
The key idea is locking cells. Right-click on any cell on this sheet, select Format Cells, and click
on the Protection tab. You will see that the Locked option is checked. By default, all cells are
locked until you unlock them. But this locking has no effect until you protect the worksheet
(or the workbook). Therefore, protecting is a two-step process.
1. Unlock all cells you want users to have access to. These are typically "input" cells where a
user can enter data like unit cost, amount ordered, and so on.
2. Protect the worksheet (or workbook). To do this, select Protect Sheet (or Protect
Workbook) from the Review ribbon. For example, when you select Protect Sheet, you see the
dialog box to the right. It is clear that you have a lot of options for what you want to allow
users to do. For example, with the settings shown, users will be allowed to select locked cells
but not modify them. If the "Select locked cells" were unchecked, users wouldn't even be
allowed to select locked cells, so any formulas in these cells would be hidden. Note that you
can also add a password when you protect a worksheet or workbook. Just be careful to
remember it. Otherwise, you won't be able to unprotect (and then modify) your own work!
s My Excel Tutorial.xlsx, and work with the copy.
ess up
ble to see
with
and click
cells are
ksheet
where a
u see the
allow
ked cells
en be
hat you
to
n work!
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
I already discussed the COUNT, COUNTA, SUM, and AVERAGE functions, arguably the most
frequently used functions in Excel. In this section I discuss some less common functions for
counting, summing, and averaging. Although they are less common and are considered more
"advanced," they are extremely useful in certain situations. The functions on the next two
sheets allow you to count, sum, or average, but only over rows that satisfy certain conditions.
They all contain IF in their name, such as COUNTIF and SUMIFS. The last function in this
section, SUMPRODUCT, does exactly what its name implies. It is absolutely indispensable in
many business models.
s My Excel Tutorial.xlsx, and work with the copy.
e most
ons for
ed more
xt two
onditions.
his
able in
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
There are several Excel functions that allow you to count values, or sum or average values,
subject to conditions. Until Excel 2007, this was possible only for a single condition, such as all
people younger than 35 years old, and there were only two functions available, COUNTIF and
SUMIF. In response to a lot of customer demand, Microsoft added four new functions in Excel
2007: AVERAGEIF (for a single condition), and COUNTIFS, SUMIFS, and AVERAGEIFS (for
multiple conditions). These are all very handy functions, and you should definitely learn how
to use them.
The COUNTIF function counts all values in a specified range that satisfy a certain condition.
The condition can be tricky to specify. If we want a specific value, such as Male, we can
specify it easily as "Male" (quotes required), or we can use a cell reference such as R3. Also, if
we want a specific inequality, such as younger than 20, we can specify it literally as "<20". But
if we want it to be younger than the value in cell R4, then we need to piece it together as a
literal part, "<", and a variable part, whatever is in cell R4. The correct syntax is "<"&R4. The
ampersand (&) symbol connects the two pieces. For example, if we want to know the number
of students who are older than 20, the correct formula is =COUNTIF(M4:M75,">"&R4).
Try it! Use COUNTIF in cell R7 to find the number of students who scored at least as high as
the value in cell R5. (Scroll to the right for the answer.)
The SUMIF function sums values in one range where a condition in a corresponding range is
satisfied. Similarly, the AVERAGEIF function averages values where a condition is satisfied.
Usually, the setup is like the example to the right, where we want to sum or average scores in
one column (O), but only for rows that satisfy a condition on another column (M or N).
Try it! Calculate the sum of all scores, and the average of all scores, for the males; for all
students who are younger than the cutoff value in cell R4; for all students who are at least as
old as the cutoff value in cell R4. Enter these six formulas in the range R9:R14. (Scroll to the
right for the answers.)
s My Excel Tutorial.xlsx, and work with the copy.
# of "high" scores
The "plural" functions discussed here, COUNTIFS, SUMIFS, and AVERAGEIFS, are recent
additions in Excel 2007. They allow you to impose multiple conditions, such as male and
younger than the value in cell R4. Their arguments, described in more detail below, include
any number of pairs of ranges and criteria, such as M4:M75,"Male".
The COUNTIFS function counts the number of rows that satisfy all of the conditions.
The SUMIFS and AVERAGEIFS functions are similar in concept to SUMIF and AVERAGEIF, but
their syntax is different. (Microsoft evidently liked this new syntax better than the original, but
they didn't want to change SUMIF and AVERAGEIF syntax because it would mess up too many
existing spreadsheets.) Now the range to sum or average comes first, and the criteria ranges
and conditions come last.
Again, the setup is typically like the example to the right. There is a column such as exam
score to sum or average. The criteria impose conditions on other columns (or even the same
column). Only those rows that meet all of the conditions are part of the sum or average.
Try it! In cells R9 and R10, calculate the total of all scores made by the gender in cell R4 and
ages younger than the age cutoff in cell R5. (Scroll to the right for the answers.)
Note: According to Excel's online help, when using these functions, if a cell in a criterion range
is blank, it is treated as 0. However, this doesn't appear to be true. For example, the second
student does not currently satisfy the conditions (too old). Change her age to 0, and you will
see the answers change. Then delete her age (make it blank), and the answers will revert back
to their original values.
s My Excel Tutorial.xlsx, and work with the copy.
1342
70.632
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
There are many times when you need to sum products of values in two (or possibly more
than two) same-size ranges. Fortunately, there is a SUMPRODUCT function that sums
products quickly.
To use the SUMPRODUCT function:
Enter the formula =SUMPRODUCT(range1,range2), where range1 and range2 are exactly the
same size. For example, they might be two column ranges with 10 cells each, or they might be
two ranges with 4 rows and 10 columns each. The formula sums the products of the
corresponding values from the two ranges.
There can actually be more than two ranges in the SUMPRODUCT formula, separated by
commas, as long as all of them have exactly the same size. This is not as common as having
only two ranges, but it is sometimes useful.
Try it! Sum the products of the two ranges in the example to the right to find the total
shipping cost. Enter the result in cell M13. (The answer should be $1,609.50.)
By the way, if you are tempted to write the formula without the SUMPRODUCT function as
the sum of 9 products, as many of my students continue to do, imagine how long your
formula would be if there were 10 plants and 50 cities! The SUMPRODUCT function is
extremely efficient, so get used to using it!
s My Excel Tutorial.xlsx, and work with the copy.
tion as
ur
s
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Most people use Excel functions to calculate numbers. However, Excel also provides several
very useful functions for manipulating text. These can be real time-savers. If you have ever
been required to manipulate a list of hundreds of names or any similar mind-numbing task,
you know what I mean. This section illustrates some of the most common ways to manipulate
text in Excel.
The next worksheet describes two handy text functions, TRIM and VALUE. Then the last two
worksheets in this section discuss two common text tasks, concatenating and parsing. These
are opposites. Concatenating means to put several pieces together, such as forming the name
"John Smith" from the two pieces "John" and "Smith". Parsing means to separate text into
several pieces, such as starting with the text "Smith, John" and separating it into the first
name "John" and the last name "Smith". As you will see, concatenating is relatively easy,
whereas parsing is typically more difficult.
s My Excel Tutorial.xlsx, and work with the copy.
several
e ever
ng task,
anipulate
ast two
g. These
the name
xt into
first
easy,
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Text in a cell sometimes has leading or trailing spaces. For example, you can guess from the
alignment that the names to the right all have some leading spaces. (They also have some
trailing spaces, although this is not obvious.) This is not necessarily a problem, but sometimes
you would like to delete any leading or trailing spaces. Doing this manually could take hours,
so luckily there is a function, TRIM, that does it automatically.
Enter the formula =TRIM(cell), where cell is a reference to the cell to be trimmed.
Try it! In column M, apply the TRIM function to the names in column L. Then copy the
formulas in column M and paste them over themselves as values. Now there is no
dependence on the names in column L, so move the values in column M to column L,
replacing the originals. (This should take about 5 seconds, and it wouldn't take much longer if
you started with thousands of names . That's efficiency!)
Have you ever gotten a spreadsheet with a lot of numbers, but the numbers are left justified
in their cells, like those to the right? They are probably the result of dumping data from a
legacy system into Excel, with the result that the numbers are really text that only look like
numbers. The tipoff is that they are left justified; numbers are almost always right justified.
Try doing arithmetic on the numbers to the right, such as summing them. It won't work
because Excel interprets them as text, and it can't do arithmetic on text. And unfortunately, it
does no good to simply right justify them; they are still text. Luckily, there is a very useful
function, VALUE, that takes text that looks like a number and makes it a number.
Enter the formula =VALUE(cell), where cell is a reference to the cell that contains the text.
Try it! Use the VALUE function in column M to transform the text in column L to numbers.
Then check that you can do arithmetic on the values in column M.
s My Excel Tutorial.xlsx, and work with the copy.
om the Bob
some Jane
ometimes
e hours, Justin
Lindsay
George
Sam
Christine
Tom
e
Jenny
L, Doug
longer if
justified 19
om a 65
ok like
stified. 36
12
ork 57
unately, it
seful 93
45
e text.
bers.
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
To concatenate, we start with two or more pieces of text and “string them together.” For
example, we might concatenate “Bob” and “Jones” into “Bob Jones”. There are two
equivalent ways to concatenate: with the ampersand (&) symbol and with the CONCATENATE
function. Both are described below.
To concatenate the text in cells A1 and B1 with the ampersand symbol, enter the formula
=A1&B1 in cell C1. Literal text can also be included, such as =A1&“, ”&B1. In this case, if A1
contains “Jones” and B1 contains “Bob”, then C1 will contain “Jones, Bob”. This concatenates
the last name, a literal comma and space, and the first name. In general, separate the pieces
with ampersands, and put literal text in quotes.
To concatenate the text in cells A1 and B1 with the CONCATENATE function, enter the formula
=CONCATENATE(A1,”, “,B1). In words, you enter the “pieces” you want to concatenate,
separated by commas. These pieces can be cell references or literal text. In the latter case,
they should be enclosed in double quotes.
Try it! Concatenate the first names, middle initials, and last names in columns L, M, and N so
that full names of the form Jones, Bob E. appear in column O. You can use the ampersand
method or the CONCATENATE function.
s My Excel Tutorial.xlsx, and work with the copy.
and N so
rsand
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Suppose, for example, that someone has given you a spreadsheet such as the one to the
right. Each cell in column L has a person’s name: last name, then a comma and a space, and
then first name. Your job is to parse (that is, separate) these names as indicated for the name
in cells M3 and N3. That is, column M should have all of the first names and column N should
have all of the last names. If this sounds easy, imagine that there are 5000 names in column L.
What would you do? If you just start typing, you will be at for a long time (and you will
undoubtedly make mistakes along the way).
Fortunately, there is a much better way. The key is to look for patterns. In this example, note
that every name has a comma and a space. The first name comes after the comma and space,
and the last name comes before it. For the name "Jones, Bob", there are 10 characters,
including the comma and space, and the comma and space are characters 6 and 7. So the first
name is the rightmost 3 characters and the last name is the leftmost 5 characters. In any
parsing operation, this is the first and probably the most crucial step: find a pattern.
Once you find a pattern, you can then exploit it with a number of useful text functions. The
ones I will discuss are FIND, LEN, RIGHT, LEFT, and MID. (If you want to learn about other text
functions, click on the fx button and search under the Text category.)
The FIND function has the syntax =FIND(subtext,text,n), where subtext is a piece of text to be
found in text, text is the original text, and n is an optional integer argument. This function
returns the position of the first occurrence of subtext, if any. If there are no occurrences, it
returns an error. If the argument n is missing, the search starts at character 1; otherwise, it
the search starts at character n.
The formula =FIND(“,”,“Jones, Bob”) returns 6, because the comma is the 6th character in
Jones, Bob.
The formula =FIND(“nes”,“Jones, Bob”) returns 3, because the subtext “nes” begins in the 3rd
character of Jones, Bob.
The formula =FIND(“o”,“Jones, Bob”) returns 2, because the first occurrence of the letter “o”
occurs in the 2nd character of Jones, Bob. However, the formula =FIND(“o”, “Jones,Bob”,3)
returns 9, because the first occurrence of “o” starting from character 3 is character 9.
The formula =FIND(“t”,“Jones, Bob”) returns an error, because the letter “t” isn’t found in
Jones, Bob.
Enter the formula =LEN(text). This returns the number of characters in text.
Enter the formula =RIGHT(text, n), where n is an integer. This returns the rightmost n
characters in text. (If n is greater than LEN(text), it return the entire text.)
Enter the formula =LEFT(text, n), where n is an integer. This returns the leftmost n characters
in text. (If n is greater than LEN(text), it return the entire text.)
Enter the formula =LEFT(text, n), where n is an integer. This returns the leftmost n characters
in text. (If n is greater than LEN(text), it return the entire text.)
With these five functions—FIND, LEN, RIGHT, LEFT, and MID—you can do some powerful text
manipulation in Excel, and this can save hours of tedious typing. You will be the hero at your
office!
The above name-parsing problem can be solved in a series of steps, as indicated below.
1. In cell M71, find the length of the text in cell L71 with the LEN function.
2. In cell N71, find the position of the comma with the FIND function.
3. In cell O71, add 1 to find the position of the space after the comma.
4. In cell P71, find the first name with the RIGHT function, using the rightmost (10-7)
characters. Make sure you use cell references to enable copying down.
5. In cell Q71, find the last name with the LEFT function, using the leftmost (6-1) characters.
Again, use cell references to enable copying.
The beauty of this method is that we have to do it only once, in the first row. Then we can
copy all of the formulas down for the rest of the names, even if there are thousands of them!
Try it! Enter the formulas as indicated by the above steps and copy them down. (Scroll to the
right for the correct answers.)
Here is a tougher one. The names to the right either have a middle initial, a first initial, or no
initial. See if you can parse these names into four pieces: Last name, Used name, Initial, and
Middle initial, where:
Used name is the name (first or middle) the person goes by.
Initial is the single initial character, if any, or is blank if there is no initial.
Middle initial is "Yes" if the initial is a middle initial, "No" if it is a first initial, and blank if there
is no initial.
As in the previous exercise, you can have other "helper" columns as needed. (Hints: (1) The
FIND returns an error if it can't find the requested text. (2) There is an ISERROR function that
can check whether a cell contains an error. Scroll to the right for a solution. )
initial. See if you can parse these names into four pieces: Last name, Used name, Initial, and
Middle initial, where:
Used name is the name (first or middle) the person goes by.
Initial is the single initial character, if any, or is blank if there is no initial.
Middle initial is "Yes" if the initial is a middle initial, "No" if it is a first initial, and blank if there
is no initial.
As in the previous exercise, you can have other "helper" columns as needed. (Hints: (1) The
FIND returns an error if it can't find the requested text. (2) There is an ISERROR function that
can check whether a cell contains an error. Scroll to the right for a solution. )
OK, this one is not easy, and it requires some careful planning. But it sure beats typing a long
list of hundreds or thousands of names!
s My Excel Tutorial.xlsx, and work with the copy.
ns. The
ther text
text to be
ction
nces, it
wise, it
er in
n the 3rd
etter “o”
ob”,3)
9.
nd in
haracters
n
haracters
f n is
wise, it
erful text
at your
ow. Full name Length Comma Space First name Last name
Jones, Bob
Davis, Stephen
Thompson, Andy
Wilson, John
racters. Fredericks, Kathy
Williams, Karen
Smith, Tom
e can
of them! Jennings, Peter
Benson, Ted
oll to the
Samson, Jason
(1) The
tion that
tial, and
nk if there
Williams, Karen R.
Smith, J. Tom
(1) The
tion that Jennings, Peter
Benson, Ted C.
Samson, Jason A.
ng a long
Full name Length Comma Space
Jones, Bob 10 6 7
Davis, Stephen 14 6 7
Thompson, Andy 14 9 10
Wilson, John 12 7 8
Fredericks, Kathy 17 11 12
Williams, Karen 15 9 10
Smith, Tom 10 6 7
Jennings, Peter 15 9 10
Benson, Ted 11 7 8
Samson, Jason 13 7 8
We tend to take dates and times for granted, but they appear in many, if not most, real-world
business spreadsheets. They can actually be quite tricky to work with, and a complete
treatment of dates and times could fill a long chapter of a book. I can’t hope to cover all of
the intricacies of Excel-based dates and times in this tutorial, but I will illustrate some of the
most useful methods for working with them.
The first thing to realize is that a date-time value that appears in a cell as something like
3/14/2004 4:30 PM is really stored as a number. Excel refers to this number as the serial
value. The serial value corresponding to this particular date-time happens to be 38060.688.
The value to the left of the decimal is the number of days since a “base” date (January 1,
1900), and the decimal part indicates the fraction of time through the day, starting right after
midnight. In this example 4:30 PM is 68.8% of the way from midnight to the next midnight. If
the decimal part is omitted, then it is assumed to be midnight. In this case, you usually format
the value so that only the date, not the time, appears.
If you happen to know the numbering system for dates (that is, you somehow know that
38060 corresponds to 3/14/2004), you could enter the number 38060 in a cell and then
format it to look like a date. However, you usually enter a date like 3/14/2004 in a cell. In fact,
there are several formats Excel recognizes as dates, including 3/14/2004, March 14, 2004, 3-
14-04, and a few others, but underneath the hood, they are all stored as 38060.
The same goes for date-times, such as 3/14/2004 4:30 PM, or just times, such as 4:30 PM. If
you enter either of these in a format that Excel recognizes as a date-time or just a time, Excel
will recognize that these are date-times or times, but it will store them as numbers
(68030.688 or 0.688).
By the way, if you enter a date-time in a format that Excel doesn’t recognize, you are entirely
out of luck. It will simply be stored as a label, with no inherent “date-time” meaning. And
Excel can be fussy. For example, it doesn’t understand 3/14/2004 4:30PM, simply because
there is no space between 4:30 and PM! (I wish I were kidding, but I’m not.) On the other
hand, Excel is smart about dates. It will recognize that 9/31/1999 and 2/29/2003 are not
dates—regardless of how they are formatted.
Try it! The cells to the right include some date-times, dates (no times specified), and times (no
dates specified), formatted in several allowable ways. Format these as numbers with 3
decimals to see the serial values. Then reformat them as date-times (in any formats you
prefer).
s My Excel Tutorial.xlsx, and work with the copy.
that
hen
ll. In fact,
2004, 3-
0 PM. If
me, Excel
entirely
And
cause
other
not
times (no
3
you
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Do you remember the Y2K problem that worried everyone in late 1999? The problem was
that a large number of dates, in all kinds of systems, listed 2-digit years, such as 85 instead of
1985. How would systems know whether 05 meant 1905 or 2005? Fortunately, the predicted
disaster didn’t happen, but there is still a Y2K problem because of the ambiguity 2-digit years
can create. Excel handles it, at least for now, by interpreting a 2-digit year less than 30 as
being in the 21st century, and all others as being in the 20th century. For example, it interprets
3/14/17 as March 14, 2017 and 5/20/72 as May 20, 1972. Of course, the easiest way to avoid
the ambiguity is to use 4-digit years whenever you enter dates. This is the lesson of Y2K!
Try it! Enter a date to the right such as 3/14/29 (the last two digits less than 30). Then enter
another date such as 5/20/30 (the last two digits greater than or equal to 30). Watch how
Excel transforms the year automatically. Do you see how this could be a problem if you really
meant 3/14/29 to be the birthday of a person born in 1929?
s My Excel Tutorial.xlsx, and work with the copy.
m was
nstead of
predicted
git years
0 as
nterprets
to avoid
Y2K!
n enter
h how
ou really
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Excel has two useful functions for automatically entering the current date, or the current date
and time , TODAY and NOW.
Enter the formula =TODAY() in any blank cell. (The blank parentheses are necessary.) It
returns the current date. If you open this spreadsheet tomorrow, it will list tomorrow’s date,
that is, it will update each day.
Try it! Enter the TODAY and NOW functions in column M. Then format result of NOW as time
only—no date. After you have worked a few other exercises below, come back to this
spreadsheet and see whether the time has changed. (You might have to force a recalculation
to see the change. You can do this by pressing the F9 key.)
s My Excel Tutorial.xlsx, and work with the copy.
) It
w’s date,
sary.) It
W as time
s
culation
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
If a cell contains a date, it is easy to strip off the year, month, day, and even weekday with the
YEAR, MONTH, DAY, and WEEKDAY functions. In all of the following examples, datecell refers
to a cell that contains a date.
To use the YEAR function:
Enter the formula =YEAR(datecell). This returns a 4-digit year such as 1993.
Enter the formula =WEEKDAY(datecell). This returns a number from 1 to 7, where 1 refers to
Sunday, 2 to Monday, and so on. If you want to get the name of the day, such as Thursday, use
a VLOOKUP function, as indicated in the following exercise.
Try it! For each date in column L, return the year, month number, month name, day, weekday
number, and weekday name in columns M-R. For the month and weekday names, use the
lookup tables supplied. Do you recognize these “infamous” dates? Try one more: your own
birthdate.
s My Excel Tutorial.xlsx, and work with the copy.
with the Date Year Month number Month name Day Weekday number
ell refers 9/11/2001
1/28/1986
11/22/1963
8/6/1945
12/7/1941
4/14/1912
The DATEDIF function provides more options. (Evidently, DATEDIF has been in Excel for years,
but its documentation in online help has been sporadic. See the interesting article at
http://www.cpearson.com/excel/datedif.htm.)
Try it! Use simple subtraction of cells to find the number of days between the two dates to
the right. Then use DATEDIF with the three options described above to get the number of
days, months, and years between the two dates. (Scroll to the right for the answers.)
Note: When you do date subtraction, you sometimes need to reformat the answer as an
integer. For some odd reason, Excel sometimes formats it as a date.
s My Excel Tutorial.xlsx, and work with the copy.
y”, “m”,
returns
urns the
ates to
ber of
s an
1562
1562
51
4
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The last two date functions I will discuss are DATE and DATEVALUE. Each can be extremely
useful.
This function can be very useful for manipulating dates. For example, it can be used to
"calculate" your next birthday, given your birthdate, as we show to the right. The formula in
cell M4 is a long one, but it is just simple logic. This person's next birthday will certainly be on
July 22. The only question is whether it will be in the current year or the next year. The IF
function checks for this. Note that YEAR(TODAY()) returns the year corresponding to today.
Try it! Enter your birthdate in cell L17 and then calculate your current age in cell L18. (Scroll to
the right for the answer.)
The DATEVALUE function can be a real life-saver. It takes a date stored as text and returns the
corresponding serial value, which you can then format as a date. Why is this important?
Suppose you have a lot of data stored in some type of legacy system in your business, and you
are somehow able to “dump” it into Excel. The chances are that all dates will be imported as
text. That is, a cell value will look something like 5/20/2001, but Excel won’t recognize it as a
date. Without the DATEVALUE function, you would have to retype all of the dates! However,
DATEVALUE saves you this mind-numbing work.
Enter the formula =DATEVALUE(datetext), where datetext refers to a date stored as text. Then
format the result as a date.
Try it! Create dates in column M corresponding to the text values in column L that happen to
look like dates. (I typed an apostrophe in front of each value in column L. That’s why they are
interpreted as text, not as dates.)
s My Excel Tutorial.xlsx, and work with the copy.
umber
to
mula in
nly be on
he IF
today.
text. Then
appen to
they are
Birthdate Age
6/24/1956 68
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
There are many statistical functions built into Excel. I have already discussed the simplest
statistical function, the AVERAGE function. (Statisticians often call this the mean, or the
sample mean, but it is simply the average of a set of numbers. And there is no Excel function
named MEAN.)
In this section I will discuss a few other statistical functions. Actually, there are many more. To
see the possibilities, click on the fx button and look at the Statistical category.
s My Excel Tutorial.xlsx, and work with the copy.
plest
he
function
more. To
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The median is the “middle” value in a set of n numbers, in the sense that half are above it and
half are below it. More precisely, when the values are sorted in increasing order, it is the
middle value if n is odd, and it is the average of the two middle values if n is even.
Fortunately, Excel takes care of the details with the MEDIAN function.
Enter the formula =MEDIAN(datarange), where datarange is any range that contains a set of
values.
Note that if datarange contains labels or blank cells, these are ignored when calculating the
median. This is true for the other statistical functions. (Of course, it is also true for the
AVERAGE function.)
Try it! Find the median of the data in column L. Does it equal the average? Why or why not?
We often like to rank the values in a data set in some way. For example, if you take the SAT
exam to get into college, you essentially learn your ranking by a percentile. If you are at the
85th percentile, you know that 85% of all people scored lower than you, and only 15% scored
higher. Excel has two useful functions for finding this type of information: PERCENTILE and
QUARTILE.
The QUARTILE function is probably the easiest to understand. Imagine that you have 1000
scores. You sort them from low to high and then divide them into 4 sets of 250 scores each,
where the first set contains the smallest scores, the second set contains the next smallest
scores, and so on. The 1st, 2nd, and 3rd quartiles are the breakpoints between these sets. For
example, 25% of the scores are below the 1st quartile, and 75% are above it. By definition,
the 2nd quartile is the median.
Try it! Find all three quartiles, Q1, Q2, and Q3, for the data in column L.
The PERCENTILE function takes any percentage, expressed as a decimal number, and returns
the value such that the given percentage of all values is below this value. For example, if we
use the percentage 10% (0.10) and the PERCENTILE function returns 45, we know that 10% of
all values in the data set are below 45 and 90% are above it.
Try it! Find the requested percentiles for the data in column L. For example, P10 indicates the
10th percentile. Do you see the relationship between the quartiles and certain percentiles?
Note that the QUARTILE and PERCENTILE functions are typically used on data sets with a large
number of observations. If they are used on a very small data set, you might be surprised at
the results. In fact, you might even disagree with them. For example, if the data set has the 5
values 10, 20, 30, 40, and 50, Excel’s PERCENTILE function indicates that the 10 th percentile is
14. This is certainly not a very intuitive answer, and you might disagree with it, but we
question why anyone would want the 10th percentile of a 5-value data set in the first place!
s My Excel Tutorial.xlsx, and work with the copy.
cates the
entiles?
1
21
4
16
th a large 6
rised at 18
has the 5
centile is 18
e 2
place! 3
17
7
9
6
4
2
7
3
0
14
2
4
24
12
1
4
36
3
0
2
4
12
7
2
1
16
5
31
15
29
12
5
4
5
22
14
7
7
19
38
15
45
1
4
14
3
16
4
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Excel has a number of other statistical functions, including those for measuring the amount of
variability in a set of numbers. The most widely used measures of variability are variance and
standard deviation, and Excel implements these with the VAR and STDEV functions. (These
functions calculate the sample variance and standard deviation. There are similar functions,
VARP and STDEVP, for calculating the population variance and standard deviation. For large
data sets—over 100 values, say—the sample and population measures are practically the
same.)
The variance is essentially the average of the squared deviations from the mean, and the
standard deviation is the square root of the variance. Each measures variability, but standard
deviation is easier to understand because it is expressed in the same units as the data—
dollars, for example. In addition, many data sets have the property that about 68% of the data
are within 1 standard deviation of the mean, about 95% are within 2 standard deviations of
the mean, and virtually all of the data are within 3 standard deviations of the mean. (These
rules of thumb typically hold when the distribution of values follows a symmetric, bell-shaped
curve, that is, the normal distribution.)
Try it! Find the mean, variance, and standard deviation of the data in column L. Then use
COUNTIF to find the percentage of values that are within 1 standard deviation of the mean. Is
it about 68%? (Scroll to the right to see the answers.)
s My Excel Tutorial.xlsx, and work with the copy.
If we have two columns of data that are matched in a particular way, such as sales of two
company products in a given month, then we often like to see how they are related. If one is
unusually large, does the other tend to be unusually large? Unusually small? The statistical
measure for this is correlation, and it can be calculated with the CORREL function. A
correlation is a number between -1 and +1. If the correlation is positive, the two sets of
numbers tend to go together. If one is small, the other tends to be small; if one is large, the
other tends to be large. Exactly the opposite is true if the correlation is negative. In this case,
the two sets of numbers tend to go in opposite directions. The magnitude of the correlation
indicates the strength of the relationship between the two sets of numbers. There is a strong
relationship (positve or negative) if the correlation is close to -1 or +1. The relationship is
much weaker, or nonexistent, if the correlation is close to 0.
Enter the formula =CORREL(range1,range2), where range1 and range2 contain the two sets
of numbers.
Try it! The data to the right represent monthly sales of three products. Calculate the
correlations in column R indicated by the labels in column Q. (Scroll to the right for the
answers.)
s My Excel Tutorial.xlsx, and work with the copy.
Suppose we want to rank a set of values from 1 to N, where N is the number of values. We
can do this with Excel's RANK function. We can rank them from highest to lowest or vice
versa.
Enter the formula =RANK(value,datarange, order), where value is a single value in the
datarange, and order is an optional argument. If order is 0 (or missing), rank 1 corresponds to
the largest value and rank N to the smallest; if order is 1 (or any other nonzero value), rank 1
corresponds to the smallest value and rank N to the largest.
Typically, we start with a data set in a column. Then we use the RANK function to rank the first
value and copy it down (with datarange absolute) to rank all of the others. If two or more
values are tied, they share a rank.
Try it! Rank the values in column L from largest to smallest in column M. Then rank them from
smallest to largest in column N. How does RANK deal with the tied 55’s? (Scroll to the right for
answers.)
The LARGE and SMALL functions are less well-known Excel functions, but they can be useful.
Let’s say we have a data set with 250 values and we want the 10 largest values. Then we can
find these with the LARGE function, using arguments 1 through 10. Similarly, we can use the
SMALL function to find the 10 smallest values.
To use the LARGE function:
Enter the formula =LARGE(datarange,k), where k is any integer from 1 to the number of data
values. This returns the kth largest value.
Typically, we would enter a sequence of values of k in some column, enter the LARGE or
SMALL formula for the first of them, and then copy down.
Try it! For the data set in column L, find the 10 largest values and 10 smallest values in
columns O and P. Use cell references to the values of k in column N. (Scroll to the right for the
answers.)
s My Excel Tutorial.xlsx, and work with the copy.
es. We 55
vice 66
76
34
55
he
sponds to 68
), rank 1 75
44
nk the first 38
more 58
hem from
e right for
e useful. 679.02 1
n we can 1208.42 2
use the
1635.72 3
729.63 4
1036.08 5
er of data 716.62 6
972.92 7
1175.68 8
1271.38 9
er of data 1048.93 10
718.89
E or 1282.89
960.55
in 1356.75
ht for the 1257.66
902.38
1648.23
1111.56
750.54
1001.74
742.81
707.50
1080.94
1290.85
1115.66
1005.36
1243.57
1454.84
1491.96
991.85
1345.71
1098.38
584.24
1209.50
1416.73
530.54
1171.91
1354.49
989.32
788.77
1264.69
1594.35
1274.46
1023.20
1377.79
1090.11
963.47
623.22
591.33
1060.24
669.80
1260.54
1019.52
819.22
602.14
714.58
996.73
698.22
1116.06
851.37
1223.55
963.66
1114.35
1473.56
755.30
833.30
670.82
859.38
1109.96
1614.91
1035.87
927.74
681.50
953.19
1296.71
379.17
773.67
1235.87
1442.20
1332.61
1314.41
1102.07
894.25
949.84
899.89
842.80
737.26
853.25
1699.23
1084.52
753.02
1004.51
550.14
995.72
1284.55
1217.77
1527.33
937.32
523.64
672.17
1131.39
1283.45
822.97
1364.57
512.38
774.36
1105.61
946.32
730.95
759.13
1119.85
1139.42
1090.73
1446.34
866.76
800.82
1290.49
1477.84
977.47
1101.76
1101.66
1071.95
846.98
1222.82
1277.73
1129.76
1320.94
762.96
1145.85
985.63
664.06
808.46
808.69
1433.58
933.24
1059.90
1172.61
1334.85
752.82
1025.82
798.93
590.03
1362.43
581.92
921.59
1166.95
690.62
1472.74
931.17
1525.45
323.69
1388.36
668.07
1377.30
1374.89
968.95
637.91
592.42
1202.37
1188.52
1031.24
1004.71
1451.57
972.33
1172.22
828.66
914.55
543.38
489.87
988.93
1331.98
1211.72
999.51
963.75
1188.93
517.26
1234.76
953.21
1384.28
1059.93
1041.80
964.87
488.53
1398.93
1046.12
913.83
485.68
1335.03
1373.34
1208.25
1100.58
1051.50
1092.98
1166.45
941.87
1053.52
1095.11
1847.97
546.79
843.64
1306.94
1120.74
1289.04
1192.82
1132.86
1597.10
1078.35
1528.90
972.01
1206.63
1202.84
704.03
962.18
1252.00
1196.82
1279.00
757.50
846.49
855.45
561.13
1300.36
901.77
1015.09
1096.84
644.72
1372.65
579.08
647.23
478.23
1151.76
961.65
1241.79
1076.72
774.44
1149.76
846.46
927.77
1337.16
790.40
807.10
1201.21
1330.02
1100.30
1317.75
1080.59
1400.72
865.18
1383.26
997.08
380.33
6 4
4 7
1 10
10 1
6 4
3 8
2 9
8 3
9 2
5 6
1847.97 323.69
1699.23 379.17
1648.23 380.33
1635.72 478.23
1614.91 485.68
1597.1 488.53
1594.35 489.87
1528.9 512.38
1527.33 517.26
1525.45 523.64
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Excel has a wide assortment of financial functions that are used by thousands of financial
analysts every day. I will illustrate only a few of the most common of these. If you are going to
be a financial analyst, you will undoubtedly want to become familiar with the others. The best
way to learn is to click on the fx button and scan through the Financial category.
s My Excel Tutorial.xlsx, and work with the copy.
ncial
e going to
. The best
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The PMT function is usually used to find the monthly payment for a car loan or a home
mortgage loan. The inputs are typically an annual interest rate, a term (number of months
financed), and the amount borrowed (the principal). The PMT function finds the amount you
have to pay each month of the term. Part of this payment is principal and part is interest. At
the end of the term, you will have paid just enough to pay off the entire loan.
Enter the formula =PMT(interestrate,term,principal). For technical reasons, if you want PMT
to return a positive value, you should enter the principal as a negative number (because it is a
cash outflow, not a cash inflow). The interest rate argument should be the monthly rate
(assuming you are paying monthly), which is the annual rate divided by 12.
Try it! Suppose you take out a $30,000 loan for a new car when the annual interest rate is
6.75% and the term of the loan is 36 months. Calculate your monthly payment in cell M6.
Then use a data table (the perfect place for one!) to see how your monthly payment varies for
terms of 24, 36, 48, or 60 months. (Scroll to the right to see the answers.)
s My Excel Tutorial.xlsx, and work with the copy.
ant PMT
use it is a
ate
ate is
l M6.
varies for
Data table for payment versus term
Term Payment
$922.89
Payment $922.89 24
36
48
60
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Much of the theory of finance is about the time value of money. Basically, a dollar earned in the
future is less valuable than a dollar earned today because the dollar earned today can earn
interest. To account for this, we discount future cash inflows or outflows to get their present
values now. If we have a future stream of cash inflows and/or outflows, then the sum of all of
their present values is called the net present value, usually abbreviated NPV. If this stream is
incurred at regular time intervals—at the end of each year, say—then we can use Excel’s handy
NPV function to calculate the NPV of the stream.
Enter the formula =NPV(rate,cashstream). Here, rate is the discount rate, which is essentially
the rate the company believes it can earn on its money, and cashstream is a stream of cash
inflows or outflows that occur at the ends of successive years, starting at the end of year 1.
Note that if there is a cash inflow or outflow right away, at the beginning of year 1, it should be
entered outside the NPV function. The reason is that it doesn’t need to be discounted.
Try it! Assume a company pays $100,000 at the beginning of year 1 to get into an investment. It
then receives the cash inflows at the ends of years 1 through 5 shown to the right. What is the
NPV of this investment (inflows minus outflows) with a 12% discount rate? Does the NPV
increase or decrease as the discount rate increases? (Scroll to the right to see the answer.)
If a company incurs cash inflows or outflows at irregular times, such as January 15, then May 30,
then July 1, and so on, the NPV function cannot be used. You could go back to your finance book
to see how to discount future payments directly, but it is easier to use the little-known XNPV
function. This function is actually part of the Analysis ToolPak that ships with Excel. However, you
might not have it loaded. To check, click on the Office button, then Excel Options, then Add-Ins,
and then Go. If the Analysis ToolPak item isn’t checked, check it (see to the right, where your list
of add-ins is probably different from mine). Then you can use the XNPV function.
Typically, the first cash value will be an outflow and the rest will be inflows. In this case, the
initial outflow (investment) should be included in the XNPV function, and the NPV will be
discounted back to the date of this initial payment. This payment should be entered as a
negative number.
Try it! First make sure the Analysis ToolPak is loaded. Then find the net present value of the
stream of cash inflows shown to the right, where the first is really a payment at the beginning of
2009. (Scroll to the right to see the answer.)
s My Excel Tutorial.xlsx, and work with the copy.
NPV
ssentially
of cash
year 1.
should be
d.
estment. It
What is the
NPV
swer.)
NPV
same as
hen they are
se, the
ill be
as a
e of the
beginning of
NPV $29,806
NPV $69,805
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
Companies often have investment opportunities where they pay initially and then get returns
in the future. It is easy to show that the NPV of such an investment decreases as the discount
rate increases. In fact, for large enough discount rates, the NPV will typically become negative,
meaning that the future returns are not enough to offset the initial cost. The discount rate at
which NPV changes from positive to negative is called the internal rate of return, or IRR.
Specifically, the IRR is the discount rate at which NPV equals 0.
Companies are interested in IRR for the following reason. Typically, they have a "hurdle rate"
that they use to discount potential investments. If the NPV of an investment is positive,
discounted at the hurdle rate, it is worth pursuing. If it is negative, it is not worth pursuing.
Stated equivalently, the investment is worth pursuing only if its IRR is greater than the
company’s hurdle rate.
Fortunately, Excel has an IRR function that calculates an investment’s IRR. Otherwise, this
would be a difficult calculation. As with the NPV function, we assume the investment is
structured so that there is an initial cash payment at the beginning of year 1 and then regular
cash returns at the ends of years 1, 2, and so on.
This seems strange. Why should you have to guess at the answer? It is because Excel
calculates the IRR iteratively, starting with your guess. Your actual guess shouldn’t make any
difference in the final answer except in unusual cases.
Try it! Find the IRR for the following investment, using an initial guess of 15%. What does this
IRR say about the attractiveness of the investment? (Scroll to the right to see the answer.)
By the way, I mentioned that there is an XNPV function (in the Analysis Toolpak) for cash flows
that don't occur on regularly spaced dates. There is also an XIRR function. Look it up!
s My Excel Tutorial.xlsx, and work with the copy.
dle rate"
ve,
rsuing.
he
, this
t is
n regular
h flows,
uess for
ake any
does this
swer.)
cash flows
!
IRR 19.81%
I have heard an Excel expert make the claim that the VLOOKUP function, discussed earlier, is
the most useful Excel function of all. Whether or not you believe this claim, the VLOOKUP and
HLOOKUP functions are just two of some very useful lookup and reference functions in Excel’s
arsenal. If you click on the fx button for online help on Excel functions, you will see a Lookup
and Reference category of functions that includes VLOOKUP, HLOOKUP, and several others. I
will illustrate a few of these others here, specifically INDEX, MATCH, and OFFSET. Although
they are arguably not as useful as VLOOKUP, they can definitely come in handy in certain
situations.
s My Excel Tutorial.xlsx, and work with the copy.
arlier, is
OKUP and
in Excel’s
Lookup
others. I
hough
rtain
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The INDEX function is useful for finding the value in a particular cell of a rectangular range.
You access this value by the indexes of the cell you want. Specifically, you specify a row index
and a column index. For example, if the range has 10 rows and 20 columns, the index 4,8
indicates the 4th row and 8th column of the range.
To use the INDEX function:
Enter the formula =INDEX(range,r_index,c_index), where r_index is an integer (for row) and
c_index is an integer (for column).
For example, the formula =INDEX(D11:F20,4,2) refers to the value in cell E14, the cell in the
4th row and 2nd column of the range.
If range is a single-column range, then the c_index argument can be omitted. In that case,
=INDEX(range,r_index) returns the value in row r_index of the range. For example, the
formula =INDEX(A11:A20,3) refers to the value in cell A13, the 3rd cell in the range.
Similarly, if range is a single-row range, only c_index needs to be included. For example, the
formula =INDEX(B10:E10,3) refers to the value in cell D10, the 3rd cell in the range.
Try it! Find the unit shipping cost from Plant2 to City3 with a formula in cell M8. Then enter a
formula in cell M12 that finds the unit shipping cost from the plant to the city specified in
cells M10 and M11. This formula should respond appropriately to whatever plant and city
indexes are entered in cells M10 and M11. (Scroll to the right for the answers.)
s My Excel Tutorial.xlsx, and work with the copy.
Plant 1
l in the
City 2
Unit shipping cost
case,
he
ple, the
n enter a
ed in
d city
1.25
1.35
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
The MATCH function is handy for finding a cell in a range that matches a given value. It is
often used in the following situation. Suppose you have decision variable such as order
quantity that needs to be chosen to maximize profit. You enter some formulas that link order
quantity to profit. Then you create a data table that finds the profit for a number of possible
order quantities. The MATCH function lets you locate the cell in the data table with the largest
profit.
Enter the formula =MATCH(value,range,0). This returns the index of the cell in range that
matches value. For example, if the match occurs in the 3rd cell of the range, this returns 3.
The last argument, 0, indicates that we want an exact match. If there is no exact match, the
formula returns an error. The MATCH function can also look for an inexact match by using a +1
or -1 for the 3rd argument. You can look up the details in online help.
The example to the right indicates how MATCH can be used in conjunction with INDEX.
Imagine that a profit model has led to the table shown, where each order quantity listed
leads to the corresponding profit. For this small example, it is obvious that the largest profit is
$5,640, which corresponds to an order quantity of 300. However, if inputs (not shown) that
drive the profit model change, the best order quantity and the corresponding profit could
change. We want formulas in cells M11 and M12 to show the best profit and best order
quantity regardless of where they appear in the table.
Try it! The table to the right shows the profit for each order quantity (along the side) and each
unit stockout cost (along the top). Enter formulas in the range M39:P39 to find the best order
quantity for each unit stockout cost. (Scroll to the right to see the answer.)
s My Excel Tutorial.xlsx, and work with the copy.
EX.
sted
st profit is
n) that
could
der
e of the
know the
ich one.
and each Profit for various order quantities (column L) and unit stockout costs (row 32)
est order $2 $3 $4 $5
200 $5,235 $5,175 $5,025 $4,935
250 $5,465 $5,285 $5,190 $5,085
300 $5,355 $5,325 $5,265 $5,100
350 $5,215 $5,195 $5,130 $5,125
400 $5,145 $5,085 $5,015 $5,005
The OFFSET function allows us to reference a range (or single cell) relative to another cell. It is
hard to appreciate unless you see some examples, so I will present some below.
As another example, the formula =OFFSET(F4,0,-3) refers to a single cell (because the last two
arguments are missing), and this single cell is 3 columns to the left of F4, namely, C4.
A good example of the OFFSET function appears in the example to the right. A company sells
to a retailer, and the retailer pays a certain number of months later, as indicated by the
payment delay (in months) in cell M20. The sales occur as indicated in row 23, but the
receipts from the retailer occur 2 months later, as indicated in row 24.
Without the OFFSET function, we could simply put links in the Receipts row that point to sales
2 months earlier. For example, the formula for receipts in January would be =N23. But what if
the retailer decides to delay payments by 3 months instead of 2? Then we would need to fix
the links in the Receipts row. However, a clever use of OFFSET avoids this updating of links.
We use the formula =OFFSET(P6,0,-$M$20) in cell P24 for January and then copy it across
row 24 for the other months. This formula says to start in the January sales cell and go a
certain number of cells to the left (because of the minus sign), where this number is specified
in cell M20. To see how it works, try changing the value in cell M20 to 3 or 1.
Try it! Suppose that a manufacturing company buys raw materials from a supplier. If the cost
in any month is $x, the company pays 40% of this cost 1 month from now and the other 60%
2 months from now. Use the OFFSET function to calculate the payments made in January
through August, based on the costs through July. These calculated payments should change
automatically if you change the inputs in cells M33, M34, O33, and O34. For example, make
sure your formulas react correctly if you enter 2 and 3 in cells O33 and O34. (Scroll to the
right to see the answer.)
Another great use of the OFFSET function is to create a dynamic range name, one that
expands or contracts depending on the number of data values in a range. Consider the
example to the right, where monthly sales values are entered in column M, and the total of all
sales values is calculated in cell P41. Every month, an extra sales value and its month label are
appended to the list in columns L and M. We can make the formula in cell P41 automatically
adjust to the appended values by using a dynamic range name.
To do this, I selected the Define Name dropdown in the Formulas ribbon. In the Name box at
the top of the resulting dialog box, I entered Sales as the range name. In the Refers To box at
the bottom, I entered the formula =OFFSET($M$42,0,0,COUNTA($M:$M)-
COUNTA($M$1:$M$41),1). Then I clicked on OK. Finally, I entered the formula =SUM(Sales) in
cell P41. Note that COUNTA($M:$M) refers to the count of all nonblank cells in column M,
expands or contracts depending on the number of data values in a range. Consider the
example to the right, where monthly sales values are entered in column M, and the total of all
sales values is calculated in cell P41. Every month, an extra sales value and its month label are
appended to the list in columns L and M. We can make the formula in cell P41 automatically
adjust to the appended values by using a dynamic range name.
To do this, I selected the Define Name dropdown in the Formulas ribbon. In the Name box at
the top of the resulting dialog box, I entered Sales as the range name. In the Refers To box at
the bottom, I entered the formula =OFFSET($M$42,0,0,COUNTA($M:$M)-
COUNTA($M$1:$M$41),1). Then I clicked on OK. Finally, I entered the formula =SUM(Sales) in
cell P41. Note that COUNTA($M:$M) refers to the count of all nonblank cells in column M,
and COUNTA($M$1:$M$41) refers to all the nonblank in column M above the first sales
figure. So the difference is the number of sales values in column M. Therefore, this OFFSET
function refers to a range that starts in cell M42 and has as many rows as there are sales
values in column M. To see how it adjusts, enter a sales value for June in cell M47 and watch
how the total changes automatically.
Again, that COUNTA($M:$M) counts all of the nonblank values in column M, so if there were
some other numbers down below sales, they would mess up the logic in the OFFSET function.
For example, suppose there were a numeric value in cell M200. Then the fourth argument in
the OFFSET function would return 6, not 5, so at that point, the Sales range name would refer
to the range M42:M47, that is, 6 cells starting with M42. The moral is that if you want to use
dynamic range names, you have to be careful about “junk” in the affected columns or rows.
Try it! The data way out to the right has sales by month and by salesperson. We want to sum
sales over all months and salespeople in cell AL65. Create a dynamic range name that updates
when new months are added and when salesperson columns are added or deleted. Then use
this range name to sum sales in cell AL65. (Scroll across to see answer. Note that I placed this
example way out to the right so that no "junk" from the previous examples on this worksheet
would be above it.)
s My Excel Tutorial.xlsx, and work with the copy.
r cell. It is
_offset
l positive
ns a
To find
e), and
6. It is a
oing 2
e last two
M(Sales) in
mn M,
he
total of all
h label are
matically
M(Sales) in
mn M,
ales
OFFSET
ales
d watch
ere were
function.
ument in
ould refer
nt to use
or rows.
t to sum
at updates
Then use
aced this
orksheet
May Jun Jul Aug
4500 2750
4200 2900 4500 2750
Jan-05
Feb-05
Mar-05
Apr-05
May-05
Jun-05
Jul-05
Smith Jones Wilson Donalds
$6,700 $7,400 $5,800 $9,000 Answer: Open the name manager and look at
the definition of the Sales1 range name.
$5,800 $8,900 $5,500 $7,900
$5,000 $7,900 $5,900 $8,300
$6,700 $5,800 $6,000 $9,700
$9,400 $7,800 $6,700 $8,400
$6,200 $5,800 $9,400 $8,500
$8,700 $5,300 $6,900 $7,500
he name manager and look at
the Sales1 range name.
Return to table of contents Save this file under another name, such as My Excel Tutorial.xlsx, and w
If you want even more power in Excel, you can automate just about any task with a macro.
Macros are written in the programming language for Excel and the rest of Office, Visual Basic
for Applications (VBA). VBA is a relatively easy programming language to learn, but it does
take some study and a lot of practice. (If you are interested, check out my VBA for Modelers
book at http://www.kelley.iu.edu/albrightbooks.)
Even if you know nothing about programming, you can still record macros to perform some
simple tasks. You can then create buttons to run these macros and place them on the QAT so
that they are always available to you. There are several things you should know before you
start working with macros:
1. There is a Developer tab and ribbon you should make visible (see to the right). This has
various buttons for working with macros. To make it visible, click on the Office button and
then Excel Options. Under the Popular group, check the third option: Show Developer tab in
the Ribbon. Once you check this option, the Developer tab will always be visible.
2. Files in Excel 2007 that contain macros must have the .xlsm extension ("m" for macro). If
you try to save such a file as a regular .xlsx file, you won't be allowed to do so.
3. There is a special file, Personal.xlsb, that you will probably want to record your macros to.
This file opens automatically as a hidden file whenever you open Excel. Therefore, all of its
macros are always available, regardless of what other Excel files are open.
4. If you want to write your own macros, or if you want to look at recorded macros, you
should go to the VB Editor. You can do this from the Visual Basic button on the Developer tab,
or more easily, with the Alt-F11 keyboard shortcut. Try it now. Press Alt-F11. This opens a new
window. When you are finished looking around, you can close this window. Excel will still be
open.
Now let's record a macro and then try it out. This will be a very simple macro that formats the
selected cell(s) as integers, that is, as Number with zero decimals.
1. Make the Developer ribbon visible (see above), if necessary. Highlight any range such as
the numbers to the right in column L, and click on the Record Macro button on the Developer
ribbon. This turns the recorder on. It will record everything you do until you turn the recorder
off.
2. When you click on the Record Macro button, you will see the dialog box to the right. Fill it
out as shown and click on OK. You can give it a meaningful name (no spaces), and you can
specify where it should be stored. I have specified the Personal Macro Workbook, which is the
same as the Personal.xlsb file mentioned above. This will make the macro available at all
times.
3. Now perform the task you want to record. In this case, format the selected range as
Number with zero decimals.
5. Although this is not necessary, if you want to see the recorded mcaro, press Alt-F11 and
look at the module(s) under Personal on the left side of the VB Editor. (Modules are where
macros are stored.) Even if you know nothing about programming or VBA, the recorded code
probably makes sense. With some experience, you can modify this code to suit your exact
needs. For now, though, you can leave it as is; it works fine.
6. Now you have a nice macro, but you need a button to run it. To create such a button, click
on the dropdown arrow next to the QAT, and then on More Commands to bring up the
4. From the Developer ribbon, click on the Stop Recording button.
5. Although this is not necessary, if you want to see the recorded mcaro, press Alt-F11 and
look at the module(s) under Personal on the left side of the VB Editor. (Modules are where
macros are stored.) Even if you know nothing about programming or VBA, the recorded code
probably makes sense. With some experience, you can modify this code to suit your exact
needs. For now, though, you can leave it as is; it works fine.
6. Now you have a nice macro, but you need a button to run it. To create such a button, click
on the dropdown arrow next to the QAT, and then on More Commands to bring up the
Customize dialog box. Under the "Choose commands from" dropdown, choose Macros. Select
your IntegerFormat macro, and click on the Add>> button to create a button for it on the QAT.
The button will have a generic icon, but if you click on the Modify button, you can choose a
more meaningful icon.
7. Now that you have a nice button on your QAT, try it out. Select the above two numeric cells
in column N and click on your button. They should be reformatted.
Note that I asked you to select a range before recording the macro. The reason is that the
macro will then apply to whatever range is selected. If you began recording and then selected
a range such as L30:L32, your macro would apply only to this specific range.
s My Excel Tutorial.xlsx, and work with the copy.
macro.
ual Basic
does
odelers
m some
e QAT so
re you
s has
n and
er tab in
cro). If
acros to.
l of its
you
oper tab,
ens a new
l still be
ht. Fill it
u can
hich is the
at all
as
1 and
where
ded code
exact
on, click
he
1 and
where
ded code
exact
on, click
he
os. Select
n the QAT.
oose a
meric cells
at the
n selected