You are on page 1of 521

S.

Christian Albright, 2011-2017, All Rights Reserved

Introduction to the Excel Tutorial

The purpose with this Excel tutorial is to illustrate some Excel tips that will dramatically improve your
efficiency. No attempt has been made to be as encyclopedic as some of the 800-page Excel books
available. The focus here is on common tasks, not every last thing you can do in Excel. Also, this tutorial
presumes that you have some Excel knowledge. For example, you should know about rows and columns,
values, labels, and formulas, and other basic Excel elements. If you know virtually nothing about Excel,
you should probably work through an Excel for Dummies book and then work through this tutorial.

The style of this tutorial is easy to follow. The List of Topics sheet contains hyperlinks to the various
worksheets where you can learn and practice various skills. Each of these worksheets has a hyperlink in
cell A2 back to the List of Topics sheet.

It is a good idea to save this file as Excel Tutorial Copy.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 retrieve the original file, Excel
Tutorial for Windows.xlsx.

ExcelNow!, a commercial version

The version of this tutorial you are now viewing is available for free to users of the Albright/Winston
Cengage textbooks and certain other Cengage spreadsheet-oriented textbooks. However, there is a
commercial version, called ExcelNow! available at http://excelnowtutorial.com. The commercial version
is available at a significant discount (use coupon code ExcelNow20) for purchasers of the textbook. Its
main enhancements include:

1. A better user interface. Instead of buttons on a List of Topics worksheet, you can choose topics from
an ExcelNow! ribbon.

2. More topics. There are quite a few new topics, such as Office clipboard, array formulas, data
consolidation, scenarios, subtotals, and themes. Also, besides the "main" topics, there are over 100
"quick tips" on little-known (but often useful) Excel features.

3. Videos. There are videos, including closed captions, for all of the topics. From the menus, you can
either choose to read about a topic, as you can do in this version, or you can watch a video about the
topic.
Whether you continue to use this version or upgrade to ExcelNow!, have fun improving your Excel skills!
dramatically improve your
800-page Excel books
do in Excel. Also, this tutorial
now about rows and columns,
rtually nothing about Excel,
work through this tutorial.

yperlinks to the various


worksheets has a hyperlink in

ame, and work with the copy.


etrieve the original file, Excel

s of the Albright/Winston
oks. However, there is a
com. The commercial version
chasers of the textbook. Its

you can choose topics from

array formulas, data


opics, there are over 100

From the menus, you can


n watch a video about the

n improving your Excel skills!


S. Christian Albright, 2011-2017, All Rights Reserved

Excel User Interface


The list to the left contains the topics, by category, in this
Changes in Excel tutorial. There is a hyperlink for each topic to its worksheet
Tabs and Ribbons in this workbook. (Also, each topic worksheet has a
Customizing Ribbons hyperlink back to this sheet.)
File Menu The list to the left is in outline form, so you can use the
Quick Access Toolbar buttons or numbers in the left margin to collapse or expand
the categories.
Excel Options
File Extensions
Moving and Selecting
Going Home to Cell A1
Splitting the Screen
Selecting a Range with Keys
Selecting a Range by Pointing
Selecting Multiple Ranges
Copying, Cutting, Pasting
Copying and Pasting
Cutting and Pasting
Paste Special Options
Transposing a Range
Other Basic Tools
Undoing Actions
Right-Clicking
Shortcut Keys
Cell Borders
Shapes and Pictures
Manipulating Rows, Columns
Manipulating Worksheets
Sorting
Printing
Working with Formulas
Relative, Absolute Addresses
Calculation Options
AutoSum Button
Range Names
Auditing Formulas
Working with Charts
Intro to Charts
Creating a Chart
Chart Types
Modifying a Chart
Locating a Chart
Working with Excel Functions
Intro to Functions
Function Help
Basic Summarizing Functions
SUM, AVERAGE, PRODUCT
COUNT, COUNTA, COUNTBLANK
COUNTIF, SUMIF, AVERAGEIF
COUNTIFS, SUMIFS, AVERAGEIFS
SUMPRODUCT
Two Essential Functions
IF
VLOOKUP
Math Functions
INT, ROUND
ABS, SQRT, SUMSQ
LN, EXP
RAND, RANDBETWEEN
Text Functions
Concatenating
Parsing with Text to Columns
Parsing with Text Functions
Flash Fill
Date, Time Functions
Dates and Times in Excel
TODAY, NOW
YEAR, MONTH, DAY, WEEKDAY
DATE, DATEVALUE
Statistical Functions
MIN, MAX
MEDIAN, QUARTILE, PERCENTILE
STDEV, VAR
CORREL, COVAR
New Statistical Functions
Financial Functions
PMT
NPV, XNPV
IRR
Reference Functions
INDEX
MATCH
OFFSET
INDIRECT
Data Analysis Tools
Quick Analysis
Tables
Pivot Tables
Data Tables
Goal Seek
Solver
Power BI
Intro to Power BI
Data Model
Power Pivot
Power View
Power Map
Power Query
Importing External Data
Intro to Importing Data
Importing Data from a Text File
Importing Data from a Database
Importing Data from the Web
Good Spreadsheet Practices
Documenting Your Work
Conditional Formatting
Professional Touches
Data Validation
Protecting Worksheet, Workbooks
Developer Ribbon
Using Form Controls
Recording a Macro
y, in this
worksheet
sa

se the
or expand
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Changes in Excel
If Excel 2007 or a later version 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 and relearning to do. Several big changes were made in Excel
2007, along with many smaller changes. The changes made in Excel 2010 and
later versions were much less dramatic, so moving from Excel 2007 to 2010 or
a later version is quite easy. The text boxes below indicate the primary
changes in each of the post-2003 versions of Excel.

Changes in Excel 2007 Changes in Excel 2010


1. Excel 2007 introduced a completely new user interface, with tabs and 1. The Office button w
ribbons replacing the old menus and toolbars. backstage view, and th
2. Worksheets are much larger than before. You used to have about 65,000 2. You can now custo
rows and 256 columns. Now you have over a million rows and over 16,000 restrictions on what y
columns.
3. A number of new fu
3. An Office button was added at the top left of the Excel window. This Actually, a lot of these
takes you to a "backstage" view for file operations and information about
files. This is also where you access the old Excel Options dialog box. 4. Two new buttons w
to "regular" or COM a
3. A customizable Quick Access Toolbar (QAT) was added to the top of the
Excel window. This can be used to store your favorite buttons. 5. Sparklines were add
4. Excel files are now stored in a different format, as reflected in the new 6. Slicers were added
.xlsx and .xlsm file extensions, replacing the old .xls extension.
7. The Solver add-in w

Changes in Excel 2013 Changes in Excel 201


1. The style of the user interface changed. For example, the tabs are now 1. The style of the us
all in uppercase, and the ribbon icons are more abstract. Also, the layout of long all in uppercase,
the backstage view (from the File menu) changed once again. changed to dark gray
General tab of Excel O
2. There is now a single document interface, where each open Excel file (from the File menu)
gets its own window.
2. The Insert ribbon h
3. A new Flash Fill tool was added. This lets you copy patterns, such as chart types include h
name patterns, very easily, without the need for complex text functions. sunburst charts, wate
4. Timeline slicers were added to the regular slicers. These allow you to 3. The Data ribbon co
filter on dates. time series automati
5. A number of tools for data analysis were added. These include Quick 4. The Data ribbon co
Analysis, where you can get charts, tables, pivot tools, and more with a external data sources
couple mouse clicks. They also include several extremely powerful tools for Microsoft's querying
advanced data analysis: the Data Model, PowerPivot, and Power View.
2. The Insert ribbon h
3. A new Flash Fill tool was added. This lets you copy patterns, such as chart types include h
name patterns, very easily, without the need for complex text functions. sunburst charts, wate
4. Timeline slicers were added to the regular slicers. These allow you to 3. The Data ribbon co
filter on dates. time series automati
5. A number of tools for data analysis were added. These include Quick 4. The Data ribbon co
Analysis, where you can get charts, tables, pivot tools, and more with a external data sources
couple mouse clicks. They also include several extremely powerful tools for Microsoft's querying
advanced data analysis: the Data Model, PowerPivot, and Power View. suite of tools.

5. The other Power B


are all part of Excel 2
interfaces than befor
Excel. If you plan to u
you purchase Office (
Changes in Excel 2010

1. The Office button was replaced by the File menu for accessing the
backstage view, and the layout of this backstage view changed slightly.

2. You can now customize ribbons, although there are quite a few
restrictions on what you are allowed to change.

3. A number of new functions, mostly statistical functions, were added.


Actually, a lot of these are just renamed versions of older functions.

4. Two new buttons were added to the Developer ribbon for quick access
to "regular" or COM add-ins.

5. Sparklines were added to provide quick "mini" charts.


6. Slicers were added for pivot tables, These show filters more visually.

7. The Solver add-in was improved.

Changes in Excel 2016

1. The style of the user interface changed yet again. Now the tabs are no
long all in uppercase, and the bar at the top is all green. (This can be
changed to dark gray or white from the Office Theme options in the
General tab of Excel Options.) Also, the layout of the backstage view
(from the File menu) changed once again.

2. The Insert ribbon has several new items in the Charts group. The new
chart types include histograms, box and whisker plots, tree maps,
sunburst charts, waterfall charts, and combo charts.

3. The Data ribbon contains a new Forecast Sheet item for forecasting
time series automatically, using exponential smoothing.

4. The Data ribbon contains a new Get & Transform group for querying
external data sources. These actually implement Power Query,
Microsoft's querying add-in, part of its Power BI (Business Intelligence)
2. The Insert ribbon has several new items in the Charts group. The new
chart types include histograms, box and whisker plots, tree maps,
sunburst charts, waterfall charts, and combo charts.

3. The Data ribbon contains a new Forecast Sheet item for forecasting
time series automatically, using exponential smoothing.

4. The Data ribbon contains a new Get & Transform group for querying
external data sources. These actually implement Power Query,
Microsoft's querying add-in, part of its Power BI (Business Intelligence)
suite of tools.

5. The other Power BI add-ins, Power Pivot, Power View, and Power Map
are all part of Excel 2016, available as COM add-ins, with slightly different
interfaces than before. However, these are not available in all versions of
Excel. If you plan to use these tools, you should check carefully before
you purchase Office (or Office 365).
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Tabs and Ribbons

Starting in Excel 2007, Microsoft completely reorganized the user interface of the
Office products. Instead of the old menus and toolbars, there are now tabs and
ribbons. Each tab (Home, Insert, Page Layout, etc.) has an associated ribbon that is
similar to the old toolbars. (See to the right for the ribbons in Excel 2016. Those in
Excel 2007, 2010, and 2013 are similar.) For example, if you click the Formulas 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. Eventually, you will appreciate that
the ribbons are more logically organized than the old menus.

If you are using Excel 2007, you cant customize the new ribbons; they are built in
and fixed. (Well, that isn't quite true. You can use the RibbonX technology, not
covered here, to customize them.) However, you can customize the ribbons fairly
easily in post-2007 versions. This is explained in another topic of this tutorial.

With the old menus gone, what about the keyboard shortcuts many of you like to
use? Most of them still work. For example, you can still press Ctrl+s to save a file or
Ctrl+p to print.

If you are a mouse person, hover the mouse above any tab and move the scroll
wheel. This will cycle through all of the tabs. 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 the button. To
make these shortcut keys disappear, press the Alt key again.

Try it! Use the Alt method to open the Name Manager on the Formulas ribbon.

A few of the new tabs are not visible until you select an appropriate object. For
example, when you select a chart, two Chart Tools tabs (Design, Format) become
visible. (There were three Chart Tools tabs in previous versions.) Or when you select
an Excel table, a Table Tools Design tab becomes visible.

If you need more space, you can right-click any ribbon and select Collapse the
Ribbon. You can then restore it in the same way. Also, note that depending on the
width of the Excel window, some ribbons might not show fully, but everything is still
available.

In general, Excel 2007 and later versions are more intelligent about context. In the
context of what you are doing, if something is relevant, it is likely to appear.
Otherwise, it remains hidden.
List of Topics sheet

Home Ribbon

Insert Ribbon

Page Layout Ribbon

Formulas Ribbon

Data Ribbon

Review Ribbon

View Ribbon
Developer Ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Customize Ribbon dialog b


Customizing Ribbons

Starting in Excel 2010, Microsoft made a welcome change that allows you
to customize the built-in ribbons. You might recall that in Excel 2003 and
earlier versions, you could change the menu structure to your liking fairly
easily. Then came the new ribbons in Excel 2007, which were pretty
much fixed (unless you were willing to use the rather obscure RibbonX
technology with XML code). Evidently, Microsoft received enough
complaints about the fixed ribbons that it returned to customizable
ribbons in Excel 2010. Fortunately, customizing is quite easy.

To do so, right-click any ribbon and select Customize the Ribbon. This
opens the dialog box to the right. (This dialog box is also available from
the Excel Options group.) From here, the options are straightforward. You
can create a new tab, create a new group under a given tab, and rename
either of these. Then you can move buttons from the left pane to the
right. As an example, the screenshot to the right illustrates how you
could create a new Tables group under the Data tab and then populate it
with PivotTable and Table buttons. This would allow you to get pivot
tables or tables from either the Insert ribbon or the Data ribbon.

Note that the Reset button lets you restore all of the ribbons or a
particular ribbon to its original state.

You shouldn't go overboard with ribbon customization. Microsoft


performed usability studies with thousands of Excel users to find the
ribbon organization that seems to work best, so a lot of thought went
into it. Still, you might prefer a few tweaks of your own.

Note: The changes described above are the easy "point and click"
changes. If you are more ambitious, you can use RibbonX technology to
make more extensive changes by writing XML code. Do a Web search for
RibbonX if you're interested.
Customize Ribbon dialog box
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

File Menu

Just as users were getting used to the Office button in Office 2007 for getting into
"backstage view," Microsoft replaced it with the File menu in Office 2010, and this
has remained in later versions. The File menu in Excel 2016 leads to slightly different
options than in earlier versions, as shown to the right. In each of these versions of
Excel, the File menu (or Office button) takes you to the backstage view where you
can perform file operations, and it is where you can open the Excel Options dialog
box. There are too many options to explain here, so it is best to experiment. You
shouldn't have any trouble finding what you want. For example, to see exactly which
version of Excel you have, click the Account option.

To leave backstage view, simply click the back arrow at the top left.
of Topics sheet

Backstage view in Excel 2016


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

QAT
Quick Access Toolbar (QAT)

Starting in Excel 2007, there is a Quick Acess Toolbar (QAT) at the top left of QAT Customize list
the Excel window. 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. The one shown to the right contains several
favorite buttons in addition to the default buttons.

To modify your QAT:

Click the dropdown arrow to the right of your QAT. You will see the list to the
right of the most commonly used buttons, which you can then check to add
them to your QAT. You can also click the More Commands item in this list to
see the dialog box to the far right. If contains a huge number of other buttons
you can add to your QAT. In fact, if you create your own macros to perform
common tasks, you can place buttons to run them on your QAT.

In Excel 2010 or later, you can get to the Customize dialog box by clicking the
File button, then Options, and then Quick Access Toolbar. Or in any of these
versions, you can simply right-click any QAT button and select the Customize
Quick Access Toolbar option.

You can also right-click any button on the visible ribbon and select Add to
Quick Access Toolbar to add this button to your QAT. Similarly, a quick way to
delete a button from your QAT is to right-click any of its buttons and select
Remove from Quick Access Toolbar.

Try it! Add some of your favorite buttons to the QAT. Fortunately, you will have
to do this only once on any given PC.
QAT Customize list QAT Customize dialog box
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Excel Options

Excel has many options for changing the software's behavior. To get to it,
click the File button in the upper left corner of the screen and then
Options. As shown to the right, you will see that the options are grouped
in categories: General, Formulas, and others. You might have to hunt a
while, but you will eventually find what you are looking for among the
large number of options available.

Try it! Under the General group, change the default number of worksheets
in a new file from 3 to 1. (Why have 3 when you usually need only 1? If
you need more, you can always add them. Note that Microsoft seems to
have changed the default to 1 in Excel 2016.)

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, you can change it through the
AutoCorrect Options button in the Proofing group. Similarly, add an
abbreviation for your name or company through AutoCorrect Options so
that whenever you type the abbreviation, the full name appears.

Note that most of the options are for Excel as a whole, not for any
particular workbooks or worksheets you might have open. However, there
are a few that are workbook-specific or worksheet-specific. For example,
in the Advanced group, there are two sets of options, "Display options for
this workbook" and "Display options for this worksheet" that can be varied
from one workbook or worksheet to another.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

File types (under Save As


File Extensions

One important change starting in Excel 2007 is to 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 or later
versions. To save them and keep new features, you should save them as
.xlsx files. The new "x" at the end of the extension, which also appears in
Word and PowerPoint files, stands for XML (extensible markup language),
the format in which these files are now stored. You don't really need to
understand how .xlsx files are saved as XML, but it is important for you to
realize that this format is a complete break from the old .xls (binary)
format. In a nutshell, if you open an .xls file in a text editor, it will appear
as gibberish, but if you open an .xlsx file in an XML text editor in just the
right way, it will actually make some sense.

Note that if you save your file as an .xlsx file, users with Excel 2003 wont
be able to open it unless they download and install a free file format
converter from Microsoft. (Search the Web for Microsoft Office
Compatibility Pack to find this free download.) In the other direction, if
you save a file created in Excel 2007 or a later version 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 able to take advantage of changes in post-2003
versions. In fact, some new elements such as sparklines won't appear at
all.

Keep these points in mind because there will probably continue to be


many Excel users who will not convert to post-2003 versions for years. You
and they can share files, but you need to be aware of the rules and
limitations.

There are a few other new file extensions you might see, including the
following:

.xlsm: If your Excel file has associated VBA macros, and you want to save
it in the post-2003 XML format, 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. In pre-2007 versions, add-ins had an .xla extension.

.xltx: This is a template file ("t" for template). Templates are discussed in
the Templates topic of this tutorial.

.xlsb: This is a binary file ("b" for binary). The only file you will probably
see with this extension is the Personal.xlsb file, used for storing your
favorite macros. See the Recording Macros topic in this tutorial for more
about this special file, your "Personal Macro Workbook."

Try it! Open a new workbook in Excel 2007 or a later version and do a
Save As. You will see the list of file types to the right. Because you are in
Excel 2007 or later, the default type is the top one, .xlsx. But if you wanted
to give this to a colleague with Excel 2003, you could save it as an Excel
97-2003 .xls workbook. (You could even save it as an Excel 5.0/95 .xls
workbook, but let's hope those days are over!) Alternatively, if your file
contained macros, you could store it in the new format as an .xlsm file, or
you could store it in the old 97-2003 .xls format.
97-2003 .xls workbook. (You could even save it as an Excel 5.0/95 .xls
workbook, but let's hope those days are over!) Alternatively, if your file
contained macros, you could store it in the new format as an .xlsm file, or
you could store it in the old 97-2003 .xls format.
File types (under Save As)
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Going Home to Cell A1

When you are working on a large worksheet, you often want to reorient yourself
by going back to cell A1, the "home" cell. This is easy. Just press Ctrl+Home from
anywhere in a worksheet, and you will go to cell A1.

Try it! Scroll way down and way across to the right. Then press Ctrl+Home.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

61
Splitting the Screen 95
33
It is often useful to split the screen so that you can see more data.
49
To split the screen: 10
Select the cell where you want the split to occur and then click the Split button on the 14
View ribbon. This provides four panes that operate independently. Once you have 21
these panes, practice scrolling around in any of them, and see how the others react. 8
Try it! Split the screen so that you can see the top left cell and the bottom right cell in 94
the data set to the right. Then remove the splits by clicking the Split button again. 84
Actually, if you want to remove only one of the splits, horizontal or vertical, you can 62
drag the split line to the right or down to the edge of the window.
16
Note: Prior to Excel 2013, you could drag buttons next to the scrollbars to split either 93
vertically or horizontally. Perhaps these buttons were too difficult to locate, so they 6
were eliminated in Excel 2013.
28
66
56
3
33
34
80
53
77
64
39
75
58
56
5
80
6
52
83
8
55
51
39
50
42
48
54
15
28
28
99
24
19
21
30
93
32
35
82
23
59
17
4
67
17
71
48
29
58
64
14
67
90
83
21
14
38
64
10
53
79
90
60
67
22
80
86
41
8
58
9
21
64
59
18
17
22
72
56
10
72
72
94
44
4
44
80
41
21
35
44
38
45
47
64
79
25
47
2
73
97
62
22
48
63
59
23
73
87
25
87
1
25
3
21
46
41
74
8
64
60
24
66
5
51
80
69
44
36
90
29
87
80
67
78
59
50
91
36
93
31
32
36
10
51
54
18
20
84
2
80
6
55
6
6
48
49
89
82
29
11
43
17
100
65
26
85
27
74
90
81
87
85
63
8
14
70
35
24
66
75
47
75
62
90
9
58
87
5
71
40
77
62
75
68
68
60
38
13
65
11
100
93
99
47
62
36
50
71
33
68
80
82
70
95
24
1
91
100
58
45
21
53
5
35
53
51
35
22
4
8
75
5
13
31
98
6
97
67
16
49
6
81
55
79
7
97
68
26
91 84 8 3 62 11 33 83 70 84
8 14 68 33 23 13 12 3 100 42
93 80 5 60 30 13 34 23 57 56
47 37 41 56 38 46 50 100 40 59
65 46 42 52 90 37 31 56 29 78
69 15 73 11 75 77 36 66 32 97
80 46 93 35 95 35 95 27 25 39
74 24 77 9 92 46 28 100 22 31
33 56 88 51 73 22 39 93 77 39
17 60 87 32 46 100 61 83 71 93
79 43 80 11 9 24 52 22 58 80
29 76 6 90 32 40 62 94 34 34
54 2 11 82 33 18 31 42 58 13
39 52 66 33 2 23 49 87 46 75
91 57 78 29 82 24 88 45 3 30
28 57 51 87 44 99 18 32 34 71
100 36 48 46 60 71 33 30 26 38
34 87 45 45 76 85 86 28 100 70
13 50 83 53 20 83 13 7 27 92
55 3 9 67 99 25 33 93 18 92
45 89 83 23 31 12 14 27 75 89
96 54 41 100 1 28 21 29 68 76
57 38 52 44 94 46 72 50 83 56
86 26 30 35 69 52 28 48 27 67
28 43 41 27 86 76 44 12 47 79
97 99 71 66 63 42 63 15 91 40
14 66 95 35 18 41 32 29 35 46
58 57 81 48 63 27 54 97 81 34
99 11 59 7 8 84 56 76 54 23
67 47 99 77 50 42 90 92 86 59
22 30 3 40 19 67 32 57 49 8
100 67 91 27 59 11 72 12 79 9
32 19 90 44 22 100 11 18 68 91
51 93 30 28 55 97 60 46 59 77
21 30 49 5 26 1 16 86 85 86
88 93 61 96 88 59 68 44 95 13
97 37 14 25 17 44 69 92 16 86
80 41 96 76 49 43 27 73 88 11
73 4 25 21 30 74 44 68 36 69
60 26 34 87 79 62 96 39 45 13
12 31 66 87 68 48 34 46 29 50
63 54 42 15 32 73 11 91 96 14
41 18 72 18 36 54 96 3 50 58
15 100 28 4 9 94 43 56 98 80
3 52 27 39 60 4 18 63 56 22
32 55 62 100 30 82 17 79 11 41
28 46 73 83 78 96 39 32 42 45
31 14 78 87 14 49 85 75 84 43
76 53 91 46 94 2 64 34 41 41
98 84 86 97 9 98 94 44 61 47
54 80 51 59 62 6 8 29 4 30
32 25 34 37 83 51 54 45 52 57
86 46 28 54 56 26 57 3 67 91
94 71 95 56 37 97 84 7 68 8
62 88 21 2 57 19 66 65 32 89
19 95 63 4 99 93 50 100 2 28
62 36 55 37 49 11 62 7 70 31
58 54 91 39 76 25 22 55 23 23
41 21 18 24 6 65 10 83 45 42
8 45 90 1 34 11 60 21 93 63
41 36 7 69 54 5 9 46 46 60
97 30 76 59 85 39 96 30 40 26
15 37 56 25 71 3 78 83 65 98
66 57 26 39 63 17 46 76 99 14
48 78 6 72 26 1 84 26 48 29
56 76 7 97 89 44 99 19 73 67
97 41 63 79 20 90 95 87 92 71
17 24 75 31 11 98 72 91 5 65
32 27 46 59 22 82 12 65 48 24
27 3 62 48 39 43 8 81 19 36
87 57 5 39 100 56 61 5 62 84
15 57 23 94 63 96 6 54 27 1
24 39 52 80 100 28 88 21 15 62
10 66 31 7 99 48 21 85 20 63
70 94 39 66 37 7 78 57 92 31
19 84 3 4 48 34 91 41 11 41
59 36 83 90 42 45 17 64 83 9
9 71 3 84 2 95 44 67 18 14
53 52 45 50 20 39 23 68 48 12
17 94 59 82 93 50 47 67 46 19
16 44 67 60 14 38 99 57 37 53
46 51 42 50 52 38 16 49 60 66
66 13 63 76 23 58 1 70 47 15
52 88 11 35 21 57 6 14 82 3
10 80 57 97 49 89 1 5 83 24
23 18 11 83 7 50 96 3 33 46
79 96 60 21 49 80 80 80 52 4
93 64 38 26 71 1 66 39 49 58
54 3 25 10 80 46 49 26 52 92
49 70 22 71 98 81 44 23 94 46
24 96 90 79 26 13 63 60 59 38
62 35 54 98 13 94 56 28 85 44
81 96 90 42 44 88 33 37 61 67
95 47 39 40 74 48 72 44 83 30
77 68 43 75 89 23 27 53 55 59
46 33 91 76 68 54 82 74 73 26
62 70 62 1 71 46 49 90 97 12
16 63 96 93 42 98 36 32 31 92
78 4 57 89 63 14 63 11 40 87
53 42 63 53 73 15 21 38 47 62
8 23 12 57 71 55 48 77 6 80
77 13 57 84 1 92 13 19 73 93
28 20 14 34 77 12 47 30 32 43
79 17 53 48 31 52 29 16 42 32
19 27 44 81 54 47 8 24 67 7
82 78 93 9 49 1 20 76 63 63
91 77 37 45 46 5 71 47 15 18
24 39 50 25 65 52 71 14 24 94
36 57 8 7 85 97 6 16 11 84
62 44 21 75 43 58 44 84 64 99
11 56 79 80 68 68 25 21 63 85
1 96 34 33 30 92 70 17 3 22
65 45 17 6 16 19 61 9 23 37
21 96 87 87 33 95 99 19 92 88
29 26 8 25 35 27 30 69 28 63
31 48 1 100 11 71 77 87 38 88
42 23 87 55 73 89 22 73 27 67
12 99 78 21 25 58 88 4 39 15
62 60 7 95 7 9 20 37 63 33
83 41 52 33 77 59 28 78 49 16
53 55 94 79 73 53 45 93 69 6
85 62 26 65 82 48 55 5 82 50
76 44 15 5 76 8 73 54 18 3
36 61 5 95 95 55 44 81 51 39
49 6 24 96 32 90 43 43 36 37
65 3 98 88 93 52 26 76 97 51
7 5 62 60 41 36 43 94 66 60
15 36 21 81 37 48 67 87 79 56
88 92 53 26 82 74 30 71 37 57
8 27 24 80 66 74 33 76 70 91
32 70 57 7 68 37 55 84 29 57
5 50 73 14 35 70 87 65 56 85
52 77 79 18 82 17 29 56 56 56
28 1 99 41 63 89 69 97 26 50
75 59 23 50 98 8 91 84 25 59
32 42 22 45 40 78 92 9 76 58
100 97 47 89 46 89 73 33 29 43
21 61 56 43 59 39 19 41 82 2
11 13 49 60 16 15 94 67 91 32
38 15 55 84 4 68 40 85 2 68
59 95 21 59 78 9 59 36 68 21
43 36 99 84 57 72 11 93 84 75
96 63 2 69 5 56 70 66 65 75
35 33 45 100 95 30 23 92 15 64
11 97 85 100 17 81 87 5 71 57
99 83 90 96 54 33 56 59 32 34
41 1 99 56 87 85 74 85 29 6
86 89 90 17 97 64 6 43 23 3
98 73 2 43 55 81 46 6 58 18
7 61 27 45 25 32 47 66 95 22
65 6 73 62 5 96 69 65 21 72
58 44 11 100 82 50 28 26 93 81
92 28 37 38 4 30 99 17 88 37
31 27 55 85 54 65 94 90 56 4
42 27 37 83 42 5 43 24 68 57
76 74 40 8 61 46 73 31 92 79
13 30 44 71 60 83 68 76 20 8
72 34 68 46 1 35 84 32 34 98
41 64 66 64 25 66 21 38 45 31
51 44 70 39 66 38 21 74 64 99
22 68 19 62 49 31 98 76 84 89
36 76 29 14 36 22 14 68 87 89
81 83 45 67 76 65 53 76 100 39
32 35 35 77 100 51 81 67 46 93
80 49 44 55 44 25 53 58 86 24
73 48 54 20 12 73 27 82 47 50
88 39 92 91 88 70 97 86 53 95
14 68 28 42 87 68 86 16 68 5
85 2 88 9 46 3 68 30 79 3
82 90 87 29 56 68 54 49 100 34
16 70 33 38 89 89 38 22 56 2
65 76 38 66 65 90 52 67 74 77
96 81 70 57 16 56 37 50 6 73
39 13 40 71 72 68 55 21 65 45
49 96 18 36 30 71 10 51 32 27
21 73 40 37 28 24 4 14 56 65
77 29 50 77 10 53 30 55 77 79
87 58 88 19 44 54 82 62 18 84
56 63 89 78 60 49 39 34 92 15
50 7 90 32 25 80 80 9 77 47
4 11 95 8 72 16 30 36 6 38
34 52 95 58 72 88 48 92 13 86
50 36 79 4 91 62 30 79 44 2
4 53 74 9 37 100 77 22 19 16
67 18 3 36 41 24 51 89 8 90
10 62 20 81 35 2 71 26 27 50
30 97 86 13 26 91 11 80 60 98
71 10 68 99 9 92 4 75 99 24
18 40 81 20 19 21 59 12 4 72
23 86 50 65 69 52 75 28 71 32
68 65 22 38 67 79 97 13 88 93
20 39 36 60 83 62 69 11 42 51
42 69 77 10 87 33 4 55 91 52
34 71 48 48 54 45 82 35 14 54
35 7 53 28 9 82 61 82 66 43
61 39 77 63 54 89 92 56 91 73
83 38 56 55 5 96 90 75 65 80
32 49 76 59 48 40 29 33 60 20
2 31 1 86 96 41 11 89 62 22
4 60 71 6 49 33 19 31 56 25
47 83 28 10 39 15 71 84 84 65
29 30 76 72 11 91 2 71 60 9
37 65 32 8 44 42 90 84 68 76
55 13 82 26 58 53 81 39 6 99
27 2 33 73 3 87 10 58 82 100
90 32 82 40 62 49 32 60 4 72
31 22 48 69 66 28 54 3 58 56
7 75 57 36 24 65 72 21 69 79
54 34 43 18 89 25 1 94 64 86
17 81 73 51 24 99 49 99 95 22
53 39 63 39 49 52 66 37 69 88
44 18 1 14 6 88 7 8 87 51
2 66 24 33 64 9 73 50 100 33
78 33 93 61 75 81 47 24 10 8
74 100 95 33 87 58 14 10 41 85
79 1 30 38 38 2 52 10 76 34
77 58 4 76 71 79 10 7 40 73
39 52 60 13 65 16 90 12 57 57
15 65 34 2 49 3 68 46 42 32
100 64 94 41 79 3 11 9 23 40
37 100 34 96 54 46 34 58 61 7
30 8 81 33 75 76 68 2 39 38
63 57 70 12 93 83 29 96 51 85
54 72 49 3 68 38 97 81 6 37
32 91 5 34 66 31 25 69 89 35
89 86 36 50 78 81 78 8 4 51
22 53 19 14 39 86 50 13 62 91
43 74 72 45 41 13 42 87 34 42
33 7 76 39 88 55 64 16 37 35
70 27 78 78 36 85 79 50 15 27
42 24 11 41 78 58 7 51 27 59
26 84 65 71 15 32 95 79 31 75
79 78 99 41 89 12 77 90 48 41
12 65 57 60 52 37 25 71 26 11
98 2 43 82 3 26 52 86 28 100
50 29 23 18 59 79 48 63 97 17
25 43 25 98 79 6 30 89 48 13
51 1 1 36 34 51 17 93 73 53
83 10 62 46 46 82 47 97 46 92
25 29 1 97 7 45 16 62 83 26
24 71 78 75 40 97 97 69 39 89
4 69 90 27 70 16 15 56 96 48
80 64 22 36 66 3 14 81 69 35
54 13 100 97 23 71 46 63 52 11
88 74 93 53 84 2 55 10 2 22
28 66 58 48 87 30 12 83 27 91
35 40 86 85 56 79 20 7 86 34
5 86 97 42 43 21 71 86 70 58
64 50 32 28 86 46 98 2 36 54
67 43 64 41 72 95 83 92 44 61
64 79 7 7 94 92 40 25 88 51
55 34 5 19 89 58 38 82 66 35
43 50 69 37 11 16 79 92 17 18
79 76 21 85 12 67 18 32 68 90
82 70 80 13 44 70 57 27 70 26
83 5 79 15 91 92 29 50 79 67
84 67 96 65 88 82 98 12 30 63
13 37 12 100 57 68 80 27 71 32
51 75 17 89 44 22 34 62 95 25
60 8 51 74 41 84 1 38 82 80
29 35 1 37 65 88 99 45 100 96
29 86 53 36 26 23 83 19 63 68
43 93 34 93 35 17 6 99 55 7
94 30 49 86 7 18 39 54 4
23 85 57 84 89 53 25 57 97
82 3 62 89 17 6 28 99 26
34 22 37 39 24 64 31 5 86
88 67 62 23 32 72 65 32 98
51 41 90 79 49 16 49 75 78
33 93 81 44 4 88 50 19 1
97 78 79 17 62 1 69 26 74
51 75 63 6 63 31 7 55 24
74 34 52 4 26 55 60 27 51
41 93 77 33 8 38 89 95 20
91 57 9 49 93 62 45 7 62
20 20 58 23 16 69 51 15 70
58 95 64 9 8 100 60 65 68
36 90 61 40 12 19 89 39 34
54 65 39 72 94 59 47 24 86
78 44 4 59 90 43 100 9 70
72 45 7 49 10 21 27 54 43
43 19 59 8 91 55 42 23 11
16 9 95 61 27 11 5 36 4
99 9 46 3 51 38 24 33 63
44 97 68 7 19 6 5 58 66
12 29 60 65 93 60 21 8 47
62 52 39 46 20 82 66 58 1
46 32 58 36 71 83 52 40 39
1 68 95 2 61 97 54 39 61
96 80 77 31 34 12 49 70 96
12 85 9 66 69 72 40 83 90
33 77 7 2 2 19 80 23 27
59 94 24 17 90 11 46 62 32
63 64 10 34 41 80 87 45 58
27 31 20 25 54 5 13 91 100
99 41 92 91 19 30 18 86 8
45 7 12 6 57 47 28 83 98
100 90 83 1 63 61 64 84 67
18 81 23 31 28 35 80 70 59
68 83 22 89 64 80 60 12 26
79 6 16 40 73 91 36 4 86
98 35 16 18 54 88 24 57 41
91 85 3 47 50 2 16 61 94
88 14 43 47 47 90 15 46 73
29 64 78 57 91 27 89 65 24
89 69 40 42 5 10 90 97 7
86 71 40 15 90 70 18 61 100
66 36 51 18 29 14 33 53 55
86 87 71 67 93 38 54 44 71
66 2 7 87 67 4 45 69 90
63 48 88 61 71 20 71 58 32
26 17 44 46 100 63 29 24 7
37 24 28 75 84 24 96 11 4
63 63 77 3 11 68 60 60 52
4 41 22 37 31 48 24 53 36
83 73 74 6 54 46 32 19 80
51 24 19 55 32 8 2 67 19
11 58 49 47 38 28 49 39 31
34 92 64 34 58 32 14 27 14
11 67 64 54 37 90 40 81 97
66 74 49 57 66 3 23 17 76
84 57 73 25 58 52 26 91 48
88 93 15 18 40 35 16 98 26
90 18 3 10 84 79 47 67 41
36 82 50 80 68 96 82 17 97
46 78 59 25 9 28 74 1 62
37 30 96 5 76 49 65 52 50
43 21 16 65 24 16 82 99 56
47 34 84 85 42 95 78 91 97
50 68 16 50 17 53 37 33 94
100 75 83 59 92 40 73 19 70
83 93 88 84 64 85 41 63 49
76 57 69 70 52 39 10 16 39
84 11 3 80 49 5 24 37 67
58 23 46 28 58 84 17 80 4
70 91 48 36 56 15 88 39 93
37 20 86 24 81 78 89 69 6
47 61 93 13 91 62 70 41 3
40 59 2 100 33 74 81 81 44
66 92 37 83 58 31 4 66 40
12 31 77 11 53 7 56 47 7
5 79 51 73 41 45 37 15 44
28 23 33 4 62 29 27 44 15
48 92 63 14 15 52 50 92 43
4 10 61 75 62 89 19 47 48
11 25 50 14 88 49 16 14 94
30 59 11 72 82 26 50 63 41
65 32 94 90 63 6 76 15 56
95 22 99 54 46 36 63 38 7
6 2 96 16 42 51 15 38 59
11 42 23 50 40 57 84 62 14
36 2 14 22 82 9 61 72 77
84 7 72 88 46 64 51 68 71
35 22 25 50 83 60 85 94 24
97 88 39 57 66 70 97 30 77
11 88 12 51 21 40 12 10 37
93 97 12 78 55 78 89 6 20
36 73 89 67 83 56 62 87 85
66 95 46 21 56 46 19 80 14
61 50 100 58 92 31 3 37 63
30 61 73 2 83 83 55 41 20
10 30 39 51 55 34 74 72 58
23 62 19 5 96 95 80 4 56
63 34 38 75 73 65 62 50 41
13 72 10 45 43 66 64 68 9
59 89 24 56 64 44 26 47 31
29 99 56 63 14 30 28 94 59
84 28 77 28 76 27 96 84 6
77 16 95 82 15 8 4 41 50
46 36 8 63 8 15 28 32 30
59 63 65 31 93 16 71 88 3
28 95 38 72 50 5 84 15 2
80 70 84 97 90 3 93 96 47
79 37 69 82 95 100 71 26 58
59 5 36 3 39 52 1 45 7
48 20 20 40 75 65 42 17 70
4 57 79 9 84 2 41 9 13
84 25 27 3 4 44 79 55 61
82 92 100 100 32 59 7 1 72
74 73 32 35 100 22 60 37 62
5 10 51 64 23 93 67 3 84
60 25 59 91 15 76 44 28 70
17 13 92 8 77 38 83 41 91
55 98 4 99 58 5 92 23 45
68 83 6 32 7 84 77 76 56
40 51 87 91 87 50 92 62 81
13 30 54 49 1 31 100 16 40
56 47 79 51 14 2 55 93 38
42 54 3 84 69 53 19 95 95
24 100 23 72 92 42 63 99 96
50 52 6 49 61 93 86 70 67
38 79 52 81 29 93 50 46 53
60 83 26 92 63 37 72 38 66
5 82 48 26 40 20 7 84 34
51 54 75 88 27 35 13 20 28
43 30 82 39 9 11 36 50 33
30 9 44 38 9 19 25 64 74
21 50 94 4 32 36 13 71 60
32 44 50 57 98 55 18 18 88
46 41 83 59 75 66 65 88 32
73 84 3 11 36 69 53 10 33
65 21 89 53 90 23 79 75 37
46 3 49 96 43 66 16 68 85
98 28 28 43 75 15 15 46 97
56 15 80 83 32 36 100 78 96
10 97 100 60 1 52 42 8 90
41 25 55 7 30 61 71 5 68
87 40 30 39 55 79 98 85 23
56 17 12 94 57 99 20 35 92
73 40 42 65 73 22 7 7 99
74 60 9 26 83 36 58 66 35
96 91 86 93 2 100 15 54 54
31 61 93 26 3 67 9 3 38
10 27 58 29 28 35 27 68 2
15 33 49 62 75 50 5 45 20
90 1 77 59 61 73 66 32 39
3 84 8 56 20 9 91 72 19
97 67 13 41 20 38 39 11 46
87 18 8 70 43 40 74 98 73
48 25 58 33 53 72 18 12 41
27 52 51 8 16 61 6 68 43
34 17 4 83 1 60 22 74 33
18 98 18 51 87 36 70 19 46
100 96 9 25 81 17 67 34 71
5 42 37 65 87 48 98 10 82
47 28 59 9 22 39 98 65 19
8 83 32 57 16 16 71 27 37
87 48 65 79 38 7 90 6 23
73 76 6 98 65 19 51 78 92
13 61 27 56 89 25 88 73 49
12 97 43 44 78 72 71 82 28
77 14 12 10 13 29 6 30 35
93 31 39 85 87 70 67 32 69
22 71 10 74 95 96 34 99 53
95 88 25 10 67 89 69 42 2
11 82 8 78 66 30 97 83 68
30 73 36 83 50 28 39 57 91
8 26 2 45 59 81 53 1 75
78 7 74 71 47 1 30 27 76
48 25 70 87 64 15 15 72 32
10 61 51 76 97 63 47 53 29
100 19 90 16 86 11 76 81 39
84 5 91 13 8 39 81 4 61
31 51 87 63 27 45 49 50 65
93 91 28 46 23 88 85 35 40
18 39 47 58 8 15 90 15 32
51 66 27 68 38 35 85 43 24
100 27 59 4 52 3 43 57 17
100 5 12 62 10 44 48 71 75
27 76 20 63 11 98 3 100 16
10 49 30 29 55 16 28 9 72
22 93 40 35 2 82 85 97 87
60 39 88 93 51 32 82 69 51
51 51 17 89 70 63 68 73 42
34 36 50 48 7 7 34 32 16
15 62 12 7 66 38 41 87 41
11 40 58 23 97 30 5 84 59
90 67 21 39 41 13 30 75 20
69 83 17 19 16 84 43 31 27
18 42 64 31 92 65 83 1 33
82 56 87 70 7 74 16 95 60
57 67 77 13 42 76 76 89 48
22 19 1 2 64 87 74 46 91
78 72 3 68 36 88 8 32 71
16 94 72 12 82 42 65 93 9
14 79 7 33 35 21 24 85 16
49 77 14 10 50 64 21 88 100
91 83 14 45 6 43 87 6 7
55 97 83 7 32 75 92 65 48
21 100 94 12 94 24 6 14 83
23 10 34 14 47 66 30 97 91
86 25 92 19 34 22 52 51 8
32 5 74 4 19 3 26 66 68
3 86 44 78 43 88 5 38 94
54 35 92 35 1 72 78 79 69
9 90 16 28 65 6 91 29 41
54 21 94 85 70 86 71 1 55
63 5 14 72 9 39 98 56 94
28 82 89 37 68 86 9 97 62
26 6 95 19 27 41 83 90 16
35 80 19 43 13 70 22 74 9
76 41 47 40 73 65 63 98 15
63 60 39 27 18 16 6 19 28
51 55 90 20 49 94 56 53 17
25 64 36 1 18 78 31 90 51
77 22 5 57 15 39 90 19 14
35 11 65 31 14 52 19 42 12
56 39 15 59 88 100 9 38 72
20 88 51 91 14 81 34 27 21
8 63 47 72 79 86 48 37 83
99 84 81 23 29 16 2 96 28
31 4 32 63 94 50 10 95 74
71 66 93 74 40 99 13 81 49
88 8 78 17 63 6 20 69 68
46 39 87 34 73 95 48 44 54
19 5 95 71 17 1 90 40 22
31 70 14 88 34 26 41 73 23
2 10 75 78 3 73 5 25 37
61 39 85 83 56 27 95 58 16
79 80 1 15 35 94 85 44 59
95 53 51 21 88 93 34 27 24
22 63 28 60 26 91 1 48 62
37 36 79 93 56 75 94 87 58
5 79 8 35 38 75 6 94 63
1 24 33 27 52 25 19 13 79
5 9 64 2 45 80 64 47 74
60 47 59 76 77 10 81 3 22
35 39 48 4 93 9 84 74 63
53 26 36 10 46 67 80 84 42
2 63 86 81 17 8 33 79 31
29 73 6 5 10 92 65 39 20
95 100 81 98 51 36 17 77 22
62 3 12 77 12 62 23 90 83
22 59 50 50 36 14 35 52 34
48 59 87 55 93 88 7 82 96
56 13 51 45 14 71 53 31 89
19 28 49 60 12 52 46 48 54
14 67 63 24 34 94 30 31 1
74 10 13 15 92 27 19 19 43
87 90 22 41 37 46 25 88 44
38 95 69 58 74 11 81 99 50
66 66 59 30 19 86 51 6 44
95 64 35 84 26 90 96 8 6
58 5 46 37 11 18 32 63 71
88 10 83 19 26 36 84 78 48
42 29 55 37 95 65 59 47 95
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Selecting a Range with Key Combinations

If you favor keystrokes to mouse clicks, you can try the methods on this worksheet
for selecting large ranges or for moving around in them. Four types of keystroke
combinations are illustrated here: (1) Ctrl+Arrow combinations, (2) End, Arrow
combinations, (3) Ctrl+End, and (4) Ctrl+a. The first two are basically for moving to
corners of a data range, usually one that doesn't fit on a screen. Just be aware that
if you use either of the first two, the active cell moves from corner to corner, but
nothing in between is selected. To select, you need to hold the Shift key.

Ctrl+Arrow Combinations

It is often useful to zoom to the bottom, top, right, or left corner of a data range.
You can do this easily with the Ctrl+Arrow combinations.

To go to the bottom, top, bottom, right, or left corner of a range:

Select some cell in the data range, usually the upper left cell. Then press the Ctrl
key and the appropriate Arrow key simultaneously. For example, press Ctrl+Right
Arrow to go to the right corner of a range.

Try it! Starting at the gray cell to the right, move around to the other corners of
the large data range. You should end back in the gray cell.

Try it again! This time hold the Shift key. Then the Ctrl+Down Arrow combination
followed by the Ctrl+Right Arrow combination selects the entire range.

Try it again! Starting in the blue cell in the small data set above, use the
Ctrl+Arrow combinations to see how they are affected by blank cells.

End, Arrow Combinations

The End, Arrow combinations are equivalent alternatives to the Ctrl+Arrow


combinations. However, with an End, Arrow Key combination, you let go of the End
key before pressing an Arrow key. Again, you can hold the Shift key while you use
the End, Arrow combinations to select a range.

Try it! Do the same exercises as above but now with End, Arrow combinations.
Try it! Do the same exercises as above but now with End, Arrow combinations.

Ctrl+End combination

Another possibility is to use the Ctrl+End combination. Starting from any cell, this
selects the bottom right nonempty cell in the worksheet. If you hold the Shift key,
this selects the range from the active cell to the bottom right nonempty cell in the
worksheet.

Try it! Select the large data range to the right with the Shift+Ctrl+End combination.
You should start with the upper left cell in the data range.

This key combination often comes in handy when files much larger than you think
they should be. For example, you might see that the size of your "small" file is
1MB or more. It could be that junk is somewhere way down in a worksheet. If you
press Ctrl+End and it takes you way down or across, well beyond your data, this is
a sure sign of junk that you can then delete.

Ctrl+a combination

A last quick way to select a data range, even one with some blanks as in the small
data set above, is to select any of the cells in the range and press Ctrl+a . (No Shift
key is necessary.) You can think of "a" as an abbreviation for "all".

Try it! Use Ctrl+a to select either the small data set or large data set to the right.
You will note that every cell "surrounding" the selected cell is selected, even the
labels above the data sets. This is why labels such as these are often separated by
blank rows from the real data ranges.

This is another combination that you can use to locate junk, as described in the
previous text box.
f Topics sheet

Small data set with missing cells


8 1 1
5 5 7
10 5 3 10
10 10 9
4 3 4
7 4 5 1
2 9 10

Large data set with no missing cells


241 799 854 70 269 189 362 657 640 507
880 463 535 239 380 476 845 146 839 693
353 897 67 869 370 816 712 272 220 191
747 385 52 323 442 595 130 645 745 169
377 241 121 143 412 704 648 289 59 598
872 627 974 784 146 104 765 587 67 461
737 945 148 170 93 455 829 772 671 521
398 731 614 530 421 407 289 484 874 739
483 629 601 517 719 753 261 252 341 354
53 441 517 290 322 313 588 498 541 248
817 848 436 192 299 440 549 446 901 823
147 294 885 689 506 887 570 746 648 296
805 917 276 125 206 913 76 51 639 815
915 702 959 492 781 363 785 153 787 886
892 706 288 271 805 932 868 242 915 297
58 158 91 198 899 370 361 952 518 921
238 107 285 537 346 395 991 415 693 764
220 247 681 739 255 102 950 813 345 546
881 704 444 1000 69 700 720 953 815 684
332 215 667 889 862 82 524 65 568 393
656 108 476 57 67 996 911 189 350 977
130 598 931 139 738 584 371 671 895 948
824 258 919 416 887 414 783 73 713 549
610 742 66 705 170 634 765 170 874 458
494 825 506 499 694 371 591 964 817 557
930 977 201 174 182 289 608 666 348 74
905 546 631 159 146 329 553 764 108 418
272 743 206 927 470 106 866 823 769 125
94 418 979 365 167 704 791 50 139 630
553 799 982 639 563 770 749 613 370 474
866 590 331 256 820 767 143 469 789 64
788 606 453 785 993 417 93 134 637 504
831 226 855 878 540 328 790 548 256 906
192 673 660 515 56 688 781 483 646 491
839 470 172 282 946 91 924 797 963 782
557 646 169 125 925 669 882 572 697 484
510 421 196 692 887 402 648 699 474 267
649 803 642 918 125 633 115 756 370 607
275 60 194 265 135 873 133 630 301 499
423 220 620 226 544 82 845 583 375 526
884 524 264 501 53 887 537 648 713 284
465 559 404 571 697 504 710 113 613 945
459 379 758 93 316 935 442 527 195 73
884 757 197 201 960 165 845 497 400 427
378 115 303 894 469 981 628 805 628 526
821 647 92 850 550 390 413 848 616 703
362 390 855 257 887 478 866 199 175 855
779 610 281 679 660 627 610 298 978 809
311 825 566 772 750 726 777 281 760 650
731 91 53 203 428 411 630 196 766 587
136 96 278 611 548 472 750 315 377 874
298 747 770 616 189 108 925 709 296 927
743 354 213 435 993 465 502 586 581 691
457 946 369 631 578 504 994 438 143 390
138 121 707 741 732 305 258 167 941 522
928 836 943 273 625 632 81 656 336 603
491 608 495 557 928 390 214 902 727 720
186 410 809 594 588 821 470 796 688 270
952 740 651 413 806 870 566 124 567 710
347 974 348 159 808 72 687 612 513 210
517 239 238 840 387 463 703 632 577 139
944 942 856 339 462 745 909 275 100 85
64 245 380 923 732 532 473 352 424 659
955 482 459 996 686 607 976 928 332 771
795 205 77 994 491 849 207 59 698 145
134 937 715 807 692 835 817 451 882 257
321 242 184 558 977 472 724 984 240 509
205 902 54 255 500 220 205 232 131 646
983 997 507 925 428 536 753 75 229 93
801 968 445 799 291 409 664 193 578 408
291 213 588 464 657 718 169 352 701 411
478 655 522 375 427 978 942 348 824 921
709 103 527 257 470 464 128 330 778 322
799 911 162 238 308 854 299 160 360 873
751 468 679 336 453 998 649 834 957 584
165 107 576 923 855 639 729 850 527 520
895 486 315 632 460 976 593 765 606 670
919 492 98 273 201 120 968 242 343 277
631 331 320 346 924 560 931 562 245 746
794 729 323 894 984 699 393 416 101 188
159 339 81 79 202 470 775 749 678 168
369 210 571 917 179 428 588 434 296 975
901 230 341 365 650 882 802 809 934 241
335 513 895 985 168 372 614 740 202 640
392 491 548 914 742 612 760 317 244 390
854 288 584 916 976 148 649 901 479 83
784 791 502 667 933 103 689 809 352 495
627 334 292 635 903 162 212 621 178 416
78 726 645 579 201 283 744 503 884 282
70 177 732 371 745 224 520 434 613 199
125 796 731 386 716 729 122 931 760 873
909 393 499 409 972 161 339 536 244 826
336 318 170 52 508 730 770 557 314 973
177 901 739 163 668 905 404 926 816 124
797 582 258 96 812 150 637 96 515 568
111 820 628 463 634 123 264 836 848 802
264 895 428 555 76 925 466 944 615 428
294 351 765 518 115 982 330 420 346 970
231 139 514 356 458 907 447 389 166 139
537 823 251 142 84 285 341 862 696 879
889 968 283 409 277 426 543 651 452 684
126 479 575 850 412 509 405 759 748 535
454 506 315 80 466 178 508 800 914 211
796 843 192 316 483 475 456 268 50 79
211 480 319 791 502 325 320 359 609 238
57 175 375 658 127 622 779 676 681 527
678 758 338 140 574 720 332 633 139 231
984 151 376 202 97 864 64 686 124 142
195 580 993 888 73 991 652 595 914 446
267 232 839 312 626 768 351 663 945 585
838 849 854 445 247 525 180 466 100 977
220 289 936 453 316 669 987 271 505 247
199 651 987 454 688 859 443 710 260 433
332 312 852 761 156 518 333 871 612 970
689 874 473 876 870 345 72 276 65 672
463 513 869 628 321 197 967 815 69 858
99 282 196 840 112 92 646 900 537 920
863 625 140 123 579 236 670 97 301 56
465 503 922 208 266 643 608 775 690 534
536 295 719 96 187 748 630 842 388 914
373 291 320 673 398 695 322 674 125 493
356 887 661 722 99 255 869 302 184 587
132 75 423 504 528 654 919 484 467 598
843 151 217 214 593 898 957 847 125 715
533 119 54 636 349 272 393 96 794 777
319 244 74 399 264 529 694 264 418 164
486 558 653 713 342 290 777 881 427 501
619 365 288 309 167 500 214 975 294 646
734 242 421 491 628 868 310 882 713 673
421 967 297 924 815 204 362 465 125 736
562 840 785 386 528 226 888 950 435 214
134 599 103 57 625 481 529 844 291 724
915 539 565 607 787 364 471 106 775 71
343 832 75 387 934 308 851 156 778 782
637 63 239 630 797 937 835 221 233 973
796 634 240 532 420 540 144 646 845 634
662 585 868 309 210 189 292 551 605 892
605 892 797 924 209 62 397 922 983 209
920 540 93 139 512 225 576 670 476 665
762 685 252 855 427 51 738 350 345 68
166 336 668 432 415 574 208 889 275 345
599 367 534 585 496 352 172 220 388 710
710 771 215 386 871 209 830 537 672 480
71 978 418 746 692 981 353 956 600 593
458 678 150 345 317 557 787 445 167 847
958 170 390 918 258 501 747 122 680 120
716 457 914 104 186 72 412 247 681 392
702 110 637 219 293 585 949 90 835 753
165 704 379 777 220 826 666 584 136 307
180 990 508 153 463 527 480 659 109 467
588 328 342 661 305 955 388 308 817 251
100 333 955 522 593 311 295 185 286 70
361 881 850 251 525 595 507 679 65 814
88 112 926 210 550 614 861 964 645 93
353 771 686 653 721 543 199 211 322 829
787 821 223 816 539 760 260 321 703 336
645 737 231 52 272 528 791 738 856 303
192 374 844 893 95 457 919 707 373 886
461 425 926 557 69 732 677 421 282 623
531 586 484 448 892 89 972 975 994 435
381 183 254 709 958 155 735 758 480 554
313 1000 544 97 866 467 478 186 658 71
159 871 572 113 562 264 839 531 800 835
54 991 783 294 493 525 201 882 190 613
251 211 480 214 972 651 123 412 445 786
159 370 103 808 134 945 701 600 896 749
630 969 678 892 582 781 741 123 254 484
133 436 88 884 132 826 306 447 647 659
962 982 725 551 623 845 846 662 889 645
186 52 309 89 447 514 306 397 647 118
878 92 642 276 444 812 467 590 963 687
695 823 655 992 152 712 687 399 284 141
199 849 980 868 135 447 484 670 81 630
396 473 486 964 978 383 758 400 633 619
599 880 312 384 426 733 575 541 585 623
368 999 800 425 892 682 679 434 959 692
980 755 942 828 782 838 329 451 254 854
629 206 364 373 313 126 329 324 535 703
340 999 697 247 981 421 854 949 65 544
907 669 734 650 663 558 365 453 771 675
189 757 859 268 144 446 134 879 784 871
891 451 285 328 898 496 329 619 899 156
64 641 788 230 54 270 343 164 152 995
368 416 111 469 558 900 716 239 838 692
988 576 167 91 312 63 416 107 283 452
254 155 785 233 815 743 368 865 83 971
74 348 943 816 620 410 320 964 806 300
207 570 69 905 195 378 995 247 185 537
982 743 292 411 201 222 941 575 432 126
435 792 644 894 491 962 139 891 66 309
733 614 229 691 173 903 898 291 535 776
650 188 151 77 56 205 305 94 610 281
930 181 875 590 650 187 513 704 97 803
709 620 494 879 532 740 609 787 463 241
485 103 373 465 786 752 769 730 684 98
509 128 137 777 791 395 682 687 304 112
140 324 968 172 998 78 787 870 696 782
238 660 522 182 403 550 77 446 651 52
465 291 679 467 889 239 439 115 684 561
831 137 908 340 255 620 332 894 173 798
623 298 294 91 562 677 596 409 753 571
867 291 554 401 233 102 445 233 750 516
826 235 706 328 854 195 153 170 667 600
416 521 166 779 618 296 1000 240 147 73
748 313 915 770 508 846 286 713 689 758
730 263 561 651 570 581 228 879 377 782
103 214 521 444 276 325 51 310 869 265
681 410 865 338 511 758 881 566 825 898
612 411 232 817 300 472 743 121 121 86
614 948 318 580 928 197 755 816 634 231
747 675 159 66 642 155 960 157 633 941
177 918 356 531 66 634 321 201 678 879
432 327 480 151 221 618 593 730 475 421
359 208 447 792 371 715 576 913 391 796
447 675 913 85 345 598 922 375 895 470
358 918 580 354 718 137 747 634 967 582
322 450 56 479 78 810 557 608 137 322
580 429 178 463 670 550 208 489 245 88
655 682 163 855 872 90 287 955 277 213
621 455 341 555 484 415 937 237 254 868
555 245 72 162 510 777 153 799 690 862
675 476 586 181 103 847 535 857 211 437
270 129 154 640 475 711 293 65 591 602
592 432 120 609 374 276 886 703 650 77
578 541 329 846 581 896 343 626 940 238
350 843 370 68 411 590 527 247 228 599
204 762 686 244 150 993 123 914 324 451
348 807 945 91 368 389 951 89 245 810
934 585 623 619 820 657 83 204 881 400
363 624 295 718 456 117 454 296 432 568
763 774 299 918 466 268 934 113 809 347
704 353 204 577 883 141 384 395 498 479
380 661 942 675 535 864 562 219 872 154
317 711 454 810 349 561 846 974 698 770
368 104 711 115 203 90 346 267 377 910
214 400 954 181 92 902 760 894 136 360
128 465 704 101 135 750 892 344 622 143
781 856 876 474 776 180 892 995 999 354
825 557 991 762 403 680 963 746 831 454
609 727 648 910 150 257 362 618 598 376
214 323 838 635 995 365 725 615 537 204
835 466 525 669 464 984 187 413 694 655
788 792 898 466 964 446 529 894 249 136
888 728 533 350 74 547 193 247 466 727
583 750 215 172 852 396 926 875 408 92
772 436 781 823 558 857 241 1000 962 773
304 268 399 158 533 113 757 861 60 126
652 776 63 762 621 825 422 278 857 496
834 631 612 272 76 821 771 379 592 581
824 255 396 360 665 901 388 77 72 626
195 172 527 206 330 431 860 380 741 345
564 171 353 468 352 571 442 935 881 642
924 218 495 984 329 616 339 651 453 422
414 571 573 155 171 256 717 335 515 478
642 129 394 976 193 619 940 669 720 66
598 93 514 319 322 65 518 250 710 312
607 276 685 998 666 97 774 673 418 823
845 229 438 144 549 64 66 647 565 758
257 778 191 386 454 419 664 704 462 743
265 700 597 418 139 788 114 165 407 247
51 449 235 282 714 720 60 564 850 292
490 811 76 876 857 467 908 814 840 494
834 658 85 70 450 960 960 335 141 485
295 164 670 242 142 244 204 586 807 636
870 759 449 368 534 788 841 293 393 752
251 897 227 208 224 633 861 120 195 897
741 821 227 629 474 908 495 600 498 923
160 268 685 776 132 320 172 227 796 391
898 162 324 971 962 872 643 578 315 950
143 786 386 85 257 939 817 222 815 600
826 800 320 786 384 223 77 635 700 388
841 813 700 697 377 611 667 333 231 214
810 999 836 81 157 829 934 417 390 800
852 307 267 586 356 231 519 442 845 321
948 319 760 55 635 673 653 837 806 807
248 549 924 800 580 433 799 282 208 302
624 878 111 833 899 576 268 624 128 163
285 970 633 816 202 308 548 601 445 167
484 602 932 654 342 773 214 374 481 631
903 232 562 270 254 335 627 998 870 178
517 942 536 530 324 867 908 853 148 865
892 358 444 71 885 747 110 831 147 342
835 486 886 126 878 242 838 700 533 877
828 987 923 113 141 348 252 367 375 945
544 880 566 51 872 991 908 420 867 178
705 612 967 893 522 821 595 318 601 592
823 300 760 285 215 456 973 645 621 980
603 944 628 520 256 234 458 832 425 802
382 552 998 950 201 577 64 699 539 677
470 799 142 733 928 923 829 834 233 767
705 519 495 532 210 355 818 946 373 445
255 105 607 126 54 591 766 895 174 744
714 418 354 351 423 129 640 518 877 986
411 528 78 782 877 277 361 114 490 538
69 649 158 446 164 502 327 808 183 855
579 412 970 132 646 115 88 468 417 781
313 847 940 217 377 864 527 532 987 101
521 445 592 586 422 204 574 706 657 343
479 88 176 555 636 256 140 587 218 321
429 956 436 849 482 769 464 682 293 508
787 605 671 172 517 785 450 914 480 610
788 960 202 748 51 948 377 342 525 150
153 312 107 910 137 961 885 453 693 381
891 556 808 268 262 107 110 513 779 202
497 656 519 737 566 859 53 684 257 988
619 138 149 84 398 630 487 425 116 177
450 217 474 652 302 202 425 160 572 885
930 395 809 632 656 186 77 262 874 893
431 311 324 60 676 629 894 667 472 120
724 790 752 234 633 90 147 712 157 405
674 802 880 884 683 523 996 232 238 833
213 180 915 986 958 650 280 533 575 994
412 517 610 730 800 301 542 413 696 895
137 529 465 574 890 479 998 465 894 315
125 574 831 338 519 840 312 578 760 245
819 950 187 908 275 598 332 431 791 617
484 616 601 476 764 389 572 595 577 850
250 670 994 234 894 642 371 369 657 123
119 882 744 600 661 320 327 890 108 376
211 978 797 420 209 618 489 53 187 926
697 621 674 910 920 189 73 592 797 937
663 807 484 926 566 594 134 895 332 251
756 502 755 992 234 543 326 382 774 451
249 700 314 636 374 290 213 613 426 658
818 931 516 151 943 604 968 375 342 999
440 959 746 938 941 231 117 945 675 607
587 118 177 442 754 120 523 958 813 687
859 374 827 337 642 861 373 374 734 219
766 247 310 855 894 893 391 813 842 282
290 86 142 701 672 84 646 940 479 232
725 851 259 384 663 602 335 871 988 758
500 276 743 982 665 990 653 958 800 153
166 959 663 149 251 449 739 646 487 447
823 320 726 238 685 875 554 648 331 635
326 343 783 986 889 510 543 826 409 318
604 203 383 587 999 992 757 86 429 371
570 300 350 525 505 841 818 135 796 832
54 477 989 991 168 635 558 187 226 359
54 66 952 850 291 523 294 107 932 145
792 336 701 494 212 656 916 105 563 954
854 461 758 761 463 325 282 843 751 394
742 535 661 393 871 561 681 87 333 70
566 444 416 712 65 296 673 102 652 302
94 199 193 627 333 524 531 830 986 971
900 200 56 648 850 682 393 922 655 161
965 727 842 888 908 103 287 118 183 319
700 855 909 452 109 533 777 481 194 871
386 350 207 821 775 53 753 442 109 912
220 356 106 454 606 413 305 193 85 658
691 544 493 696 69 519 824 798 363 851
87 232 378 365 592 351 81 155 104 641
597 143 821 419 105 639 137 539 161 355
377 415 469 580 258 388 659 491 997 305
257 396 539 278 822 693 695 134 762 596
76 716 423 691 851 940 791 529 320 902
793 630 832 500 403 298 197 532 480 249
856 147 637 211 779 577 992 354 517 797
182 712 778 153 401 248 234 295 739 90
650 925 346 841 248 952 564 780 952 365
622 239 284 457 678 806 524 271 904 802
503 345 627 780 817 428 851 281 757 807
889 113 425 977 929 147 164 867 407 457
927 462 312 277 496 201 271 59 786 83
565 400 388 413 230 271 676 73 460 279
188 488 598 170 638 491 455 794 340 724
954 201 999 277 60 893 958 360 564 448
752 590 989 414 128 577 961 217 787 651
143 295 226 947 893 383 641 482 177 123
54 718 377 492 385 59 144 606 126 651
148
620
347
942
80
391
344
534
740
677
714
182
791
249
864
659
177
134
693
777
198
927
101
690
928
358
633
804
425
362
257
889
646
928
720
869
905
741
867
190
940
206
656
780
799
146
361
771
82
403
919
353
669
333
695
448
101
419
886
306
421
937
476
320
854
795
76
490
341
349
951
404
158
567
187
671
908
735
291
156
115
473
977
650
733
706
231
323
932
743
276
570
604
459
384
741
219
525
753
907
435
371
407
412
599
411
885
985
475
616
717
993
545
189
436
118
818
480
106
170
387
694
152
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Selecting a Range by Pointing to Top Left, Bottom Right Cells

In Excel, you usually 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.

First, it is important to realize that a rectangular range is defined by its upper left
cell and its bottom right cell. For example, the range address A1:D10 indicates that
the upper left cell is A1 and the bottom right cell is D10. So an easy way to select a
range is to click its upper left cell, hold the Shift key, and click its bottom right cell.

Selecting a Range That Fits on the Screen

To select a range that fits on a screen:

Click the upper left cell of the range and drag to the bottom right cell.

Or:

Click the upper left cell, hold the Shift key, and click the bottom right cell.

Try it! Select the small data range to the right by each of these methods. They are
both easy because the range is so small.

Selecting a Range That Doesn't Fit on the Screen

Selecting a range with the top-left/bottom-right method is trickier if you cant see
the whole range on the screen. Dragging, the method most users seem to use,
can be frustrating because things scroll by too quickly. You scroll too far, then not
far enough, then too far again, and so on. To avoid this endless scrolling , use the
following method instead.

Split the screen horizontally and vertically. To do this, select any cell in the data
range and click the Split button on the View ribbon. Then in the bottom right
pane, press Ctrl+Down Arrow and then Ctrl+Right Arrow to zoom to the bottom
right cell of the data range. Now that you can see the upper left and bottom right
cells of the range, click the upper left cell, hold the Shift key, and click the bottom
right cell. Then you can remove the split.

Try it! Select the entire data range with the method just described. With a little
practice, you should be able to do it in a few seconds.
Try it! Select the entire data range with the method just described. With a little
practice, you should be able to do it in a few seconds.
Topics sheet

Small range that fits on the screen


9 2 10
1 3 8
8 1 10
7 5 4
5 1 1
5 10 7

Large range that doesn't fit on the screen


63 61 4 36 45 85 91 23 17 76
52 95 40 75 28 67 79 75 49 76
18 98 47 28 65 17 86 23 63 73
25 21 7 68 16 12 80 87 59 29
26 76 55 60 55 19 82 61 42 44
42 52 72 79 16 14 85 49 81 7
14 29 75 36 52 75 17 33 66 50
87 41 48 22 25 77 3 57 32 3
100 71 10 11 90 15 62 24 83 66
59 51 90 35 94 83 77 26 79 61
43 72 53 21 60 22 33 67 29 71
19 73 49 38 33 42 49 84 8 49
86 58 55 59 41 63 75 19 34 37
7 62 41 62 26 17 95 97 79 98
52 78 37 18 45 98 35 40 73 72
18 32 62 79 86 31 58 3 14 26
1 89 92 86 88 94 12 49 38 52
71 71 58 14 37 27 73 31 83 28
75 18 70 77 52 6 45 8 57 78
2 5 21 95 16 8 66 82 72 87
64 89 38 32 8 51 63 86 1 91
64 67 81 11 34 16 30 16 39 65
6 30 42 3 68 27 12 86 77 24
87 78 33 53 48 86 17 4 61 4
64 64 15 28 44 65 29 10 57 92
58 33 81 90 48 26 55 49 34 23
76 54 84 66 65 78 3 88 17 97
15 79 47 71 19 74 58 63 57 4
73 85 20 100 6 46 17 24 86 49
43 40 26 30 59 98 46 85 23 75
83 54 38 91 59 27 82 98 39 91
41 85 63 28 29 59 47 76 81 24
55 72 42 24 59 41 78 1 53 7
23 22 17 76 50 67 17 6 97 74
54 74 23 86 88 85 98 79 83 51
81 54 24 61 41 43 13 44 91 18
16 86 24 58 99 49 50 93 65 88
31 38 91 46 44 15 23 12 32 70
47 67 39 26 54 85 65 52 4 57
69 4 10 56 89 66 13 99 22 10
82 28 25 20 88 92 28 97 42 65
66 69 81 19 78 100 57 27 52 80
19 85 32 47 1 69 68 16 19 28
58 30 88 16 44 90 9 91 68 87
8 98 6 1 74 2 53 35 85 80
4 22 18 11 61 5 100 43 49 34
22 89 29 84 88 18 67 12 26 34
5 81 48 65 9 67 13 78 55 36
33 95 12 21 18 73 31 17 85 97
57 32 94 59 15 22 18 77 4 84
67 55 5 66 36 26 34 82 59 8
4 10 12 86 91 11 73 14 28 67
52 69 35 8 38 63 20 68 16 64
46 25 70 45 99 56 34 4 98 77
79 71 61 38 37 66 24 97 91 44
28 51 23 75 42 89 79 42 22 58
95 41 44 60 83 57 61 59 39 9
40 76 54 4 46 23 28 66 29 76
96 61 55 1 59 67 37 96 52 95
3 7 17 28 87 5 98 31 62 72
96 37 82 70 8 56 25 41 16 72
39 33 1 82 35 51 71 55 66 43
46 15 81 86 74 69 22 85 64 69
23 24 3 40 30 27 73 16 85 2
6 64 5 95 11 15 90 36 44 97
72 36 24 58 23 89 45 83 68 65
8 34 69 26 14 77 15 8 21 71
48 91 81 13 94 87 18 48 63 29
70 29 30 5 18 75 97 27 62 76
57 78 44 99 59 65 31 91 38 13
98 92 39 60 45 75 30 34 53 95
45 23 30 91 89 36 9 64 11 54
69 70 86 55 70 5 78 71 51 70
50 56 42 18 47 2 85 49 53 17
17 20 19 68 2 10 2 12 79 67
55 56 25 28 1 71 64 8 7 23
64 68 99 77 20 38 29 96 6 92
87 77 77 13 85 62 4 66 11 95
96 72 80 61 73 72 86 49 79 89
49 49 44 70 31 67 78 20 98 47
61 77 11 51 34 31 56 61 83 33
21 16 58 34 98 16 16 3 76 5
27 56 14 91 25 91 6 63 35 98
69 9 80 23 78 100 6 96 47 41
25 30 92 61 71 26 85 93 71 55
33 13 51 65 39 29 26 41 17 65
57 3 79 32 66 4 18 40 62 45
47 88 15 53 21 64 70 1 78 81
84 100 79 8 5 42 12 28 95 25
56 28 72 4 48 24 95 93 61 92
97 11 80 93 63 95 86 51 19 2
84 29 81 94 78 9 7 89 73 42
6 20 53 54 18 4 82 59 48 62
63 10 72 6 36 30 88 50 5 57
15 87 60 88 86 45 36 76 98 59
54 16 18 26 17 24 26 34 94 59
3 11 85 63 41 71 15 42 87 85
24 41 43 29 67 82 62 63 14 59
85 64 24 24 49 30 78 73 44 70
68 20 2 43 85 42 58 20 43 73
51 49 14 73 98 20 67 33 84 7
87 38 25 46 61 68 17 26 43 20
59 86 33 25 95 28 55 17 6 92
91 96 93 29 54 7 56 2 38 88
15 74 17 57 89 12 64 28 100 76
53 7 40 45 83 35 76 57 8 24
83 8 31 50 96 96 33 80 20 14
11 52 3 58 61 34 51 43 90 73
83 37 53 99 90 65 91 21 95 48
77 31 75 6 72 36 39 51 25 72
49 12 36 47 54 76 39 22 5 30
65 34 60 47 82 72 33 20 74 52
84 32 10 84 74 22 10 26 39 64
6 88 15 60 13 17 92 71 45 45
59 20 62 17 80 12 17 78 96 55
8 30 73 2 52 71 29 21 41 59
22 27 1 50 3 15 13 41 71 13
1 79 98 30 14 12 63 11 54 41
18 90 45 74 53 80 71 3 35 74
45 72 47 25 73 82 45 29 39 100
9 78 17 35 52 54 93 74 77 66
71 63 73 18 49 41 19 11 42 49
24 38 39 66 100 74 73 12 87 42
71 49 91 9 29 46 57 47 10 98
10 76 40 93 79 81 33 7 97 43
18 86 17 49 63 39 11 36 23 63
53 17 97 64 53 44 53 28 85 29
86 25 77 59 36 86 43 73 23 68
63 99 36 53 34 59 36 36 61 84
48 60 41 33 53 1 99 83 15 65
95 47 63 73 89 94 98 4 33 90
58 75 86 75 87 12 86 60 9 93
70 92 42 91 29 47 1 6 61 53
29 57 83 93 81 40 15 68 41 45
99 92 40 22 35 2 22 16 75 16
7 62 71 50 62 16 12 49 28 73
37 22 59 66 40 58 66 14 77 3
10 74 12 13 94 72 74 86 71 33
52 32 71 18 55 72 48 65 84 87
94 49 11 94 84 79 37 61 48 32
20 5 77 86 5 19 71 53 94 65
17 99 90 76 84 14 2 41 63 23
20 44 68 34 47 77 75 8 15 98
99 41 50 82 67 13 72 40 99 95
48 77 13 71 63 5 32 53 14 40
64 93 34 51 48 55 4 36 28 63
16 6 60 50 91 58 50 74 27 69
3 18 66 54 58 74 33 95 84 63
35 9 85 46 78 100 79 62 86 36
70 8 93 88 42 64 8 96 51 12
8 68 10 100 42 10 42 28 52 74
48 77 78 55 91 47 41 83 94 91
51 67 58 70 51 87 24 24 86 36
93 73 40 50 46 24 40 58 83 53
15 42 28 56 33 99 10 30 73 51
60 90 85 83 53 39 66 37 79 6
99 57 13 74 28 33 70 22 90 29
52 100 9 74 100 64 46 37 32 98
88
24
25
67
50
67
93
4
16
63
70
50
37
76
27
65
13
55
91
99
71
71
49
45
87
42
76
56
25
61
97
98
1
41
25
79
69
78
43
24
75
50
3
30
82
44
37
8
25
37
56
51
6
31
67
8
5
54
36
26
35
73
37
5
25
69
100
5
60
45
13
95
46
54
94
16
95
78
10
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Selecting Multiple (Discontiguous) Ranges

Suppose you want to format more than one range in a certain way. The quickest
way is to select all ranges at once and then format them all at once.

To select multiple ranges:

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 top two ranges to the right, select cell K3, hold the
Shift key and select cell L5 (so now the first range is selected), hold the Ctrl key
and select cell N3, and release the Ctrl key. Finally, hold the Shift key and select
cell O7.

Try it! Select all three numeric ranges to the right.

Note that in Excel 2007, the highlighting is sometimes hard to see. The shading
isnt as dark as in previous versions of Excel, so you might be fooled into thinking
you havent really selected multiple ranges. But the above method definitely
works, exactly as it always has. (This shading problem was fixed in Excel 2010, so
that the selection is now much more apparent.)
Topics sheet

10 13 7 9
1 9 12 7
5 4 1 1
6 12
15 2

13 4 10
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

General Copying and Pasting Comments

Copying and pasting (often formulas) is one of the most frequently performed tasks in
Excel, and it can be a real time-waster if it is done inefficiently. For example, many people
scroll through a long range to select it, then click the Copy button or a Copy menu item,
then scroll again to select a paste range, and finally click the Paste button or a Paste menu
item. If this sounds familiar, you can definitely benefit from the tips here. As usual in
Microsoft products, there are multiple ways to perform the same task. You can use any or
all of the methods described here.

Copying and Pasting with the Ctrl+c and Ctrl+v Shortcut Keys

To copy and paste using keyboard shortcuts:

Select the copy range (using one of the efficient selection methods described in the
"Selecting" topics of this tutorial), press Ctrl+c (for copy), select the paste range
(again, efficiently), and press Ctrl+v (for paste). If you practice pressing Ctrl+c or
Ctrl+v with the little finger and index finger of your left hand, it will quickly become
automatic.

Of course, you can also click 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 after pressing Ctrl+v, the copy range still has the "marching ants" dotted
lines around it, meaning that it could be pasted again. Press Esc key to get rid of the
marching ants.

Try it! Copy the formula in the top gray cell to the right to the entire gray range by
using Ctrl+c and Ctrl+v.

Copying with the Ctrl+Enter Shortcut

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. One way is to use the
Ctrl+Enter keyboard shortcut.

Starting with the top or left cell, select the range where the results will go. (Use the
efficient selection methods described earlier, especially if this range is a large one.)
Type the typical formula and press Ctrl+Enter (both keys at once) instead of Enter.

Try it! Fill the entire gray range to the right 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.
Starting with the top or left cell, select the range where the results will go. (Use the
efficient selection methods described earlier, especially if this range is a large one.)
Type the typical formula and press Ctrl+Enter (both keys at once) instead of Enter.

Try it! Fill the entire gray range to the right 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 the entire blue range to the right with 10 by using Ctrl+Enter.

Note: The Ctrl+Enter shortcut has one other use. If you enter a value or a formula
in a cell and press Enter, an adjacent cell becomes the next active cell. (The
direction depends on the first option in the Advanced group under Excel Options.)
However, there are often times when you want the current cell to remain selected.
To do this, enter the value and press Ctrl+Enter.

Try it! Enter the value 1500 in the red cell to the right and press Enter. Which cell is
now active? This depends on the first option in the Advanced group of Excel
Options on your PC. Whatever cell is active, enter 2000 in it, but this time press
Ctrl+Enter. Which cell is now active?

Copying by Dragging the AutoFill Handle

If you place the cursor at the bottom right of a cell, the cursor becomes a plus sign. This
is called the AutoFill handle. To copy a formula down, you can use the AutoFill handle in
two different ways. Here is the first.
To copy with the AutoFill handle by dragging:

Enter the formula in the top or left cell of the intended range. Place the cursor on the
AutoFill handle at the lower right of this cell, so that the cursor becomes a plus sign, and
drag this handle down or across to copy.

Try it! Copy the formula in the top gray cell to the right to the entire gray range by
dragging the AutoFill handle.

Copying by Double-Clicking the AutoFill Handle

The second way to copy down is to double-click the AutoFill handle.

This method uses Excels built-in intelligence, but it works only in certain situations.
Lets 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 very common task, Excel does it
for you if you double-click the AutoFill handle in cell C3. 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 the AutoFill
handle wouldnt work. Also, if there is a missing value (a blank) in, say, cell B56, the
AutoFill method might not work the way you want.
The second way to copy down is to double-click the AutoFill handle.

This method uses Excels built-in intelligence, but it works only in certain situations.
Lets 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 very common task, Excel does it
for you if you double-click the AutoFill handle in cell C3. 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 the AutoFill
handle wouldnt work. Also, if there is a missing value (a blank) in, say, cell B56, the
AutoFill method might not work the way you want.

Try it! In the data range to the right, copy the formula in the top gray cell to the
entire gray range by double-clicking the AutoFill handle.

Notes: For some odd reason, double-clicking the AutoFill handle works only if you
are copying down a column. It doesn't work if you are copying across a row (although
you can drag the AutoFill handle across a row). It would be nice if this functionality
were eventually changed in Excel. We'll see. However, it does work if you are
entering the formulas in a column to the left of the data, that is, if the gray range
were in column J instead of column M.

Copying by Ctrl+Dragging an Entire Range

One final way to copy a range is to select it, hold down the Ctrl key, place the cursor on
any edge of the range so that it becomes a four-way arrow, and drag to where you want
to paste it. Because you're holding the Ctrl key, you should see a small plus sign as you
drag. This means that you are making a copy.

Try it! The gray range to the right has numbers in columns K and L, and formulas in
column M. Use the method in this text box to copy the entire gray range, using the red
cell as the top left cell of the paste range.
Topics sheet

3 3 9
4 1
2 3
2 1
5 1
4 2
3 5

6 2
9 1
4 9
7 6
2 3
8 5
3 9

10 7 70
6 9
4 9
5 1
2 8
8 10
10 7
7 8 56
2 1
10 2
4 1
4 5
3 8
7 8

7 8 56
2 1 2
10 2 20
4 1 4
4 5 20
3 8 24
7 8 56
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Cutting and Pasting

Often you would like to move data (or shapes, such as text boxes) from one location
to another.

To move (cut and paste):

Select the range (or shape) 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 good for pressing Ctrl+x or Ctrl+v.)

As with copying and pasting, ribbon buttons can be used instead of key
combinations, but the key combinations are quicker. 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 gray range one row down. (You might want to do this so that you
can add labels above the numbers.) Watch how relative addresses affect the
eventual formulas in column M.

There is an even quicker way to move a range. Select the range you want to move,
put the cursor on an edge of the range so that it becomes a 4-way arrow, and drag
the range to where you want it.

Try it! Use the 4-way arrow method to move the range back to where it was
originally, with cell K3 as its top left cell.
Topics sheet

2 3 6
7 4 28
3 6 18
3 9 27
6 7 42
6 6 36
1 4 4
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Paste Special Options

When you do a "regular" paste with Ctrl+v or one of the equivalent methods
discussed in the Copying and Pasting topic of this tutorial, several things are
pasted to the paste range: (1) if a copied cell has a value or text, it is pasted;
(2) if a copied cell has a formula, the formula is pasted, adjusted for relative
and absolute addresses; (3) the number formatting of any copied cell is
pasted; (4) other formats of the copied cell, including font, background color,
and border, are pasted. This is what you expect, and this is why you usually
use Ctrl+v or an equivalent method to paste.

However, Excel contains many paste variations in its Paste Special options.
One of the most common is to copy formulas and paste them as values, but
there are quite a few other options.

The Paste Special user interface has evolved over recent versions of Excel, but
the options remained about the same. Is it more user-friendly now than in the
past? You can be the judge of that. However, one really nice feature
introduced in Excel 2010 is that if you copy a range, select a paste range, and
then hover your mouse over any of the Paste Special icons, you immediately
see what the pasted version will look like, without committing to the paste.

Before continuing, be aware that one other way to get to Paste Special
options is to copy and then right-click. This option was available in pre-2007
versions of Excel, and it continues to be available. In addition, starting in Excel
2007, you can go directly to the Paste Special dialog box with the Ctrl+Alt+v
shortcut.

The rest of this worksheet explains and illustrates some of the Paste Special
options, using both the Paste Special dialog box and the gallery of icons under
the Paste dropdown. Note that one Paste Special option, transposing, is
discussed in the Transposing a Range topic of the tutorial.

Paste Special Icons

A lot of users are not too happy with the Excel 2013 (or 2010) gallery of Paste
Special icons. Although you get tool tips when you hover the mouse over any
of them, they are fairly small icons, and they can certainly be confusing.
Therefore, many users jump right to the Paste Special dialog box where
everything is spelled out in words. You might want to do this as well, but you
might also want to learn what these new icons do. They are explained briefly,
row by row, to the right. For more details on any of them, see the cell
comments in column N.

Many of these icons have the same functionality as the corresponding items in
the Paste Special dialog box. However, the dialog box has some items with no
corresponding icons and vice versa. In any case, there is no need to memorize
of them, they are fairly small icons, and they can certainly be confusing.
Therefore, many users jump right to the Paste Special dialog box where
everything is spelled out in words. You might want to do this as well, but you
might also want to learn what these new icons do. They are explained briefly,
row by row, to the right. For more details on any of them, see the cell
comments in column N.

Many of these icons have the same functionality as the corresponding items in
the Paste Special dialog box. However, the dialog box has some items with no
corresponding icons and vice versa. In any case, there is no need to memorize
all of the options. The ones illustrated below are the ones you will probably
use most often, and you can always return to this worksheet or online help for
others you might occasionally use.

By the way, the options you see depend on what is currently copied. For
example, if nothing is copied, the entire Paste button is disabled. If a range of
cells (or a single cell) is copied, all of the icons are shown. If a chart or a shape
(a text box, a rectangle, a picture, etc.) is copied, only three of the icons are
shown.

Pasting Special as Values

You often have a range of cells that contain formulas, and you would like to
replace the formulas with the values they produce. Usually, you paste these
values over the copy range, that is, you overwrite the formulas with values.
However, it is also possible to select another range for the paste range. This is
totally up to you.

To copy formulas and paste as values:

Copy the range with formulas with Ctrl+c, and select the range where you
want to paste the values, often the same as the copy range. Then select the
Paste dropdown on the Home ribbon, and select one of the "Paste Values"
options in the third row of icons. Alternatively, press Ctrl+Alt+v to open the
Paste Special dialog box and select one of the "Values" options.

Try it! Copy the top gray range to the right and paste it over itself as values.
Then check that the paste range contains values, not formulas.

Try it again! Copy the bottom gray range to the right and select a cell in
column O for pasting. Then hover the mouse over the three "Paste Values"
options in the third row of Paste Special icons. You should see clearly how
they differ. Eventually, click the one you prefer.

Here is something interesting about the examples you just tried. In the first
example, it doesn't matter which of the three icons in the third row you
choose. The gray background and dollar formatting are retained because they
start this way, and pasting special doesn't change them. However, in the
second example, when you paste the bottom gray range to a range that starts
with plain formatting, it does matter which "Paste Values" option you choose.

Shortcut tip: If you paste values over formulas frequenty, as many users do,
there is a quick keyboard shortcut you might want to memorize. It is actually
based on the menu system from Excel 2003, but it still works fine. First, press
Ctrl+c to copy. Then press Alt+e and then s to open the Paste Special dialog
box. Finally, press the Down Arrow key twice and then Enter to choose
Values option. Here is the entire keystroke sequence. With some practice,
you'll be able to do it in your sleep!

Ctrl+c Alt+e s Down arrow Down arrow Enter


Shortcut tip: If you paste values over formulas frequenty, as many users do,
there is a quick keyboard shortcut you might want to memorize. It is actually
based on the menu system from Excel 2003, but it still works fine. First, press
Ctrl+c to copy. Then press Alt+e and then s to open the Paste Special dialog
box. Finally, press the Down Arrow key twice and then Enter to choose
Values option. Here is the entire keystroke sequence. With some practice,
you'll be able to do it in your sleep!

Ctrl+c Alt+e s Down arrow Down arrow Enter

Pasting Special: Formulas Only, Not Formats

Sometimes you want to paste formulas to a range, but you don't want to change
the formatting of the paste range. You can do this in Excel 2010 or 2013 with the fx
icon in the first row of Paste Special icons, or you can do it in the Paste Special
dialog box with the Formulas option.

Try it! The gray range to the right contains formulas and various formatting. Paste
these formulas to column O, but don't paste the formats. Again, it is instructive to
copy the formulas, select a cell in column O for pasting, and hover the mouse over
the options in the first row of the Paste Special icons to see their differences.

Pasting Special: Formats Only

You frequently want to copy only the formatting of a range.

One rather long way to do this is to select the range, press Ctrl+c, select the
paste range, and select either the first icon from the fourth row of the Paste
Special icons or the Formats option from Paste Special dialog box.

However, a quicker alternative to this method, and one that you should
definitely use, is to use the Format Painter button next to the Paste dropdown,
shown to the right. Select a cell with the format you want to copy, click the paint
brush, and click a cell (or drag a range) that you want to format. Note that if you
double-click the paint brush, you can copy the format multiple times. Press the
Esc key when you are finished.

Try it! Copy the formats (numbers formats, font, background, and border) in
column K to column M. Don't copy the values, just the formats. Then enter some
values in column M to check that the formatting is correct.
Paste Special: Multiplying (or Adding, Subtracting, Dividing) by a Constant

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 value by 1000 so that they are expressed in dollars.
Fortunately, you do this without any formulas!

To multiply a range by a constant:

Enter the constant in a blank cell, and copy this cell. Then select the range of
values to multiply and select Multiply from the Paste Special dialog box.

This same method can also be used to add, subtract, or divide by a constant.
However, note that you do need to do this from the Paste Special dialog box.
These options aren't available on the Paste icon gallery.

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. Notice that no formulas
are involved; the numbers simply change. So once you are finished, you can
delete the multiplier from the cell where you entered it.
List of Topics sheet

Paste dropdown

Paste Special dialog box

First row, left to right:


Paste
Paste formulas only, not formats
Paste formulas and formats
Keep source formatting

Second row, left to right:


Paste everything except borders
Paste everything and keep same column widths
Paste as transpose

Third row, left to right:


Paste as values, no formulas
Paste as values with number formatting
Paste as values, keep source formatting

Fourth row, left to right


Paste formatting only
Paste links to copied cells
Paste as picture
Paste as linked picture

$132 $192 $324


$282 $128 $410
$285 $266 $551
$230 $129 $359
$111 $296 $407
$211 $191 $402
$190 $251 $441

$132 $192 $324


$282 $128 $410
$285 $266 $551
$230 $129 $359
$111 $296 $407
$211 $191 $402
$190 $251 $441
$132 $192 $324
$282 $128 $410
$285 $266 $551
$230 $129 $359
$111 $296 $407
$211 $191 $402
$190 $251 $441

Format painter

$47.65
$44.20
$37.68
$31.34
$89.36
$68.15
$28.57
147
173
217
178
120
203
137
217
153
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Transposing a Range with Paste Special

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 Excels Paste
Special options.

To transpose a range:

Copy a range that you want to transpose with Ctrl+c. Then select the upper
left cell of the range where you want the transposed version, click the Paste
dropdown, and select the Transpose option circled to the right. Alternatively,
you can click Paste Special to open the Paste Special dialog box, and then
select its Transpose option.

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 K19:O23 to a range with upper left cell K25. Note
that the gray cells contain formulas. Do the corresponding pasted cells still
have formulas? Are they still correct? Does the number formatting get pasted?
What about other formatting?

Transposing a Range with the TRANSPOSE Function

A more advanced way of transposing a range is with Excel's TRANSPOSE


function. This a special kind of function that is used only in an array formula.
An array formula operates on a whole range at once. More information about
array formulas is provided in the Array Formulas topic in this tutorial.

To use the TRANSPOSE function:

1. Select the entire range where you want the result to go. For example, if you
are transposing a range with 3 rows and 5 columns, select a blank range with
5 rows and 3 columns for the result.

2. Enter the formula in the syntax =TRANSPOSE(copy_range), where


copy_range is the address of the range to be copied. (A range name would
also work.)

3. Press Ctrl+Shift+Enter (all three keys at once), not just Enter. You always use
this key combination to enter an array formula.

Try it! Use the TRANSPOSE function, starting in cell K40, to transpose the
range to the right. After you press Ctrl+Shift+Enter, look at the formula bar.
You will see that there are curly brackets around the formula. You do not
actually type these curly brackets. They simply indicate that this is an array
formula.
also work.)

3. Press Ctrl+Shift+Enter (all three keys at once), not just Enter. You always use
this key combination to enter an array formula.

Try it! Use the TRANSPOSE function, starting in cell K40, to transpose the
range to the right. After you press Ctrl+Shift+Enter, look at the formula bar.
You will see that there are curly brackets around the formula. You do not
actually type these curly brackets. They simply indicate that this is an array
formula.

At least for this example, the TRANSPOSE function method has a couple of
disadvantages. First, the formatting is lost. Second, you will see a 0 in the
upper left cell of the transpose range. This is because the upper left cell of the
copied range is blank. Unfortunately, you can't delete this 0 (although you
could paint it white). The result of TRANSPOSE comes as a "package," and you
can't delete or move any part of the package; you can only delete or move the
whole thing.

However, there is one place where the TRANSPOSE function is really useful,
namely, when you perform matrix multiplication (which is discussed in the
Array Formulas topic of this tutorial). Then you often need to use TRANSPOSE
so that the matrix multiplication is well-defined. For example, you aren't
allowed to multiply a 3x1 column by a 3x3 matrix. But you can multiply a 1x3
row (the column's transpose) by a 3x3 matrix.
List of Topics sheet

Transpose icon Paste Special dialog box

Jan Feb Mar Totals


North 2300 3200 4500 $10,000
West 4300 3500 4200 $12,000
East 5500 6500 6000 $18,000
Totals $12,100 $13,200 $14,700 $40,000

Jan Feb Mar Totals


North 2300 3200 4500 $10,000
West 4300 3500 4200 $12,000
East 5500 6500 6000 $18,000
Totals $12,100 $13,200 $14,700 $40,000
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Undo and Redo buttons


Undoing Actions

We all make mistakes, often careless mistakes. For example, it is easy to


mistakenly press the Delete key when a chart is selected. At this point,
you will be hoping that you can undo the mistake. This is usually 38
possible, but not always. Excel stores most of your actions so that you 7
can undo them. 43
There are two ways to undo actions. The first is the simplest, but the 38
second gives you more control. 9
To undo your previous action: 16
3
Press Ctrl+z. You can do this easily with the small finger and index finger 30
of your left hand. This should become one of your favorite keyboard
shortcuts! 43
14
Alternatively, you can: 8
Click the Undo button (the left button in the above screenshot). 36
9
This Undo button isn't on any of the ribbons, but you can put it on your
Quick Access Toolbar (QAT) at the top of the screen. In fact, it is typically
placed there by default.

There is also a Redo button, just to the right of the Undo button, for
undoing an undo. Its shortcut key is Ctrl+y.

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. If you click this dropdown arrow, you will see that Excel
remembers a lot of your most recent actions. Just be aware that if you
select , say, the third most recent action, you will undo this action and
the other two most recent actions, that is, it is cumulative. The same
comments apply to the dropdown arrow next to the Redo button.

Not all actions can be undone. For example, you can't undo adding a
worksheet or deleting a worksheet. (This is a good reason, one of many,
for saving often!) Although it is hard to remember which actions can be
undone and which can't, you can always press Ctrl+z and hope for the
best.

Try it! Enter formulas in the gray range above to sum the two numbers to
their left. Then get rid of these formulas with Ctrl+z or the Undo button.
Then bring them back with Ctrl+y or the Redo button.
Undo and Redo buttons

48
10
17
18
48
16
41
20
25
28
19
8
34
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Sales data
Right-Clicking for Context-Sensitive Menus
Month
Right-clicking various items is certainly not new to Excel 2013, but there Jan-13
are now more options than ever. If you want instant context-sensitive
menus, you should always try right-clicking. This almost always leads to a Feb-13
useful menu of options. Mar-13
Apr-13
Try it! Select the sales figures to the right and right-click. Among other
things, this allows you to format the cells. Format these cells as currency May-13
with zero decimals. Jun-13
Try it! Right-click some part of the chart to the right. You will get a menu, Jul-13
but the menu items will depend on what you selected on the chart. Try Aug-13
right-clicking different parts of the chart to see how the menus change.

Try it! Right-click this text box that you are currently reading. Among
other things, you will get a Format Shape menu item lets you modify the
text box in many ways.

Try it! Right-click the screenshot to the right (which was inserted as a
Picture). Again, you will get a Format Picture menu item lets you modify
the picture in many ways.

Try it! Right-click this worksheet's tab. You will get still another menu. Are
you starting to appreciate how useful right-clicking can be?

Did you notice that when you right-clicked the sales values, you not only
got a menu, but you also got a mini-toolbar above or below the menu?
Try it again and look carefully. There is also a mini-toolbar when you
right-click a chart. Watch for these mini-toolbars when you right-click
something. They don't always appear, but when they do, they provide
still one more quick way to accomplish common tasks.
Sales data

Sales Sales
3108 4500
3993 4000
1644
3500
3078
3000
1830
2500
3279
3413 2000
1197 1500
1000
500
0
Jan-13 Feb-13 Mar-13 Apr-13 May-13 Jun-13 Jul -13 Aug-13
ul -13 Aug-13
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

http://www.shortcutwor
Shortcut Keys http://www.shortcutwor
http://www.veodin.com/
It is probably fair to say that the world of Excel users is composed of two
groups: mousers and keyboarders. The developer of this tutorial falls into
the mouse group, and this explains why the tutorial might be somewhat
lacking in shortcut key tips. However, there are plenty of you in the
keyboarders group, and you would probably like some more help on
shortcut keys.

The question is where to start. Probably everyone knows the following


shortcut keys:

Ctrl+s: save a file


Ctrl+o: open a file
Ctrl+n: open a new file
Ctrl+p: print

But how many other shortcuts do you know? And how many can you
possibly remember? If you do a Web search for "shortcut keys in Excel",
you will get plenty of hits. For example, the three sites shown in the
hyperlinks to the right list more shortcuts than anyone could ever
remember. Of course, most of these shortcuts are the same for 2007 and
later versions, and many are relevant for pre-2007 versions of Excel. But to
say the least, these lists can be overwhelming. Therefore, only a very
subjective list has been included here, and you will find a few of these,
plus a few others, in other topics in this tutorial.
Conventions: The plus sign, as in Ctrl+a, means to press both keys at the
same time. Also, an uppercase F followed by a number, such as F12, refers
to one of the "function" keys near the top of the keyboard.

By the way, if you remember the old menu shortcut keys from pre-2007
versions of Excel, such as Alt+e and then d for deleting selected rows or
columns, you can probably continue to use them. Old habits die hard, so
Microsoft kept most of these for backward compatibility. However, they
are not listed here.

Selecting and Moving

Ctrl+Home: go to cell A1

Ctrl+End: go to the bottom right nonempty cell

Ctrl+Arrow Key: move in the direction of the arrow to the last nonblank
cell (if the next cell is nonblank) or to the next nonblank cell (if the next
cell is blank)

Page Down or Page Up: move one screen down or one screen up
Ctrl+Home: go to cell A1

Ctrl+End: go to the bottom right nonempty cell

Ctrl+Arrow Key: move in the direction of the arrow to the last nonblank
cell (if the next cell is nonblank) or to the next nonblank cell (if the next
cell is blank)

Page Down or Page Up: move one screen down or one screen up

Alt+Page Down or Alt+Page Up: move one screen to the right or one
screen to the left

End: turns "end" mode on, and then arrow keys work just like with
Ctrl+Arrow Keys listed above

Shift+Spacebar: select the entire row

Ctrl+Spacebar: select the entire column

Ctrl+a: select the range of data surrounding the active cell, or press twice
to select the entire worksheet

Shift+Arrow Key: extend the selection by one cell in the direction of the
arrow

Ctrl+Shift+Arrow Key: extend the selection to the last cell nonblank cell in
the direction of the arrow

Ctrl+Shift+Home: extend the selection to the beginning (cell A1) of the


worksheet
Ctrl+Shift+End: extend the selection to include all used cells below and to
the right of the active cell

Ctrl+Tab or Ctrl+Shift+Tab: move to the next (or previous) open workbook

Clipboard and Undo

Ctrl+c: copy

Ctrl+x: cut

Ctrl+v: paste

Ctrl+Alt+v: open the Paste Special dialog box (if clipboard is nonempty)

Ctrl+z: undo last action

Ctrl+y: redo last action


Ctrl+z: undo last action

Ctrl+y: redo last action

Formatting

Ctrl+b: boldface (or remove boldface)

Ctrl+i: italicize (or remove italics)

Ctrl+u: underline (or remove underline)

Ctrl+Shift+& (ampersand): apply an outline border

Ctrl+Shift+_ (underscore): remove an outline border

Ctrl+Shift+$: apply a currency format with two decimals

Ctrl+Shift+%: apply a percentage format with zero decimals

Ctrl+Shift+#: apply a date format with day, month, and year

Ctrl+Shift+! (exclamation): apply a number format with two decimals,


comma separator, and minus sign for negative numbers

Formulas and Range Names

F4: enter dollar signs for an absolute address (or keep pressing to cycle
through relative/absolute possibilities)

Alt+= (equals sign): insert an AutoSum formula

Ctrl+a: display the Function Window after starting a formula and typing a
function name

Shift+F3: display the Insert Function dialog box (same as clicking the f x
button)

Ctrl+F3: open the Name Manager dialog box


Ctrl+shift+F3: create range names from row/column labels

F3: paste a range name into a formula

Ctrl+Shift+Enter: enter a formula as an array formula (e.g., when using


MMULT for matrix multiplication)
Ctrl+Shift+Enter: enter a formula as an array formula (e.g., when using
MMULT for matrix multiplication)

Miscellaneous

F12: display the Save As dialog box

F1: display the Excel Help window

F2: display the formula in a selected cell (instead of looking the Formula
bar)

F5: display the GoTo dialog box

F7: open the Spelling dialog box

Alt+F11: display the Visual Basic Editor (to write macros)

Ctrl+Enter: press after entering something in a cell to stay in the same cell
(This shortcut combination can also be used to copy; see the Copying and
Pasting worksheet.)

Alt+Enter: press while entering text in a cell to force a new line (for long
labels)

Alt+' (apostrophe): open the Style dialog box

Ctrl+; (semicolon): insert current date (but not as a formula)

Ctrl+shift+: (colon): insert current time (but not as a formula)


http://www.shortcutworld.com/en/win/Excel_2007.html
http://www.shortcutworld.com/en/win/Excel_2010.html
http://www.veodin.com/excel-2013-shortcuts/
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Add a Border Around a Cell or a Range of Cells

Cell borders often add a nice formatting touch to a worksheet, but they are
trickier to implement than you might expect. An easy way to add a border is
to select a cell or range of cells and click the Borders dropdown in the Font
group on the Home ribbon. (It's right above the word Font.) The icons in this
group indicate the type of border you will get.

Alternatively, you can select a cell or range of cells, right-click, select Format
Cells, and select the Borders tab to get the dialog box shown to the right.
Then the trick is to select the options in the right order, and it is easy to do it
wrong. Here is how I got the borders for the three ranges to the right.

For Range 1, I clicked the Outline preset to get the basic border. Then I
clicked a line style, a color, and finally the "bottom" border icon to get the
bottom blue border. This last part wouldn't have worked if I had clicked the
"bottom" border icon first and then the line style and color, and this can be a
source of frustration.

For Range 2, I didn't use a preset. I first chose a line style and a color, and
then I clicked the "left," "top," and "right" border icons. With the dialog still
open, I chose another line style and another color, and I then clicked the
"bottom" border icon. As before, I had to select a line style and color first,
before clicking the border icons.

For Range 3, I used both the Outline and Inside presets. Then I chose a line
style and a color, and finally clicked the two "middle" border icons.

An easy way to get rid of any of these borders is to select the range, get into
the Border dialog, and click the None preset. Alternatively, you can do it from
the Borders dropdown on the Home ribbon. You can either select No Border,
or you can select Erase Border. In the latter case, the cursor becomes an Range 1
eraser, and you can erase the borders you don't want. Then press Esc to get
out of erase mode.

Try it! Select ranges below the ranges to the right, and format them the same
as those above them. Then get rid of the borders you just created.
Range 2 Range 3
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Illustration Group on Inser


Shapes and Pictures

The Illustrations group on the Insert ribbon includes several types of items
you can add to a worksheet. These include a wide variety of shapes, such
as rectangles and arrows. These shapes are quite easy to use. You just click
any of them and then drag it to the location you want.

When a shape is selected, a Drawing Tools Format ribbon appears (see to


the far right). This allows you to change the shape in a wide variety of
ways. Many of these same options appear if you right-click a shape. The
best way to learn the possibilities is to experiment.

Try it! Insert a rectangle and modify it so that it looks like the rectangle to
the right, including the text inside. Then modify the shape of your
rectangle so that it has rounded corners.

One nice feature of shapes is that if you want to use arrows to connect
rectangles, for example, there are "hot spots" on the sides of the
rectangles for connecting. If you start and end the arrows on these hot
spots, the arrows will move with the rectangles when you move the
rectangles.

Try it! Draw two or more rectangles and connect them with arrows,
connecting to the hot spots. Then move the rectangles and watch how the
arrows move with them.

The other items in the Illustrations group act similarly, and you can
experiment with them. For example, you can insert an image from a
picture file and then manipulate it with the Picture Tools Format ribbon
that appears when you select the image.

Try it! Each of the screenshots to the right is the image of a picture file.
Select any of them and check the possibilities on the resulting Picture
Tools Format ribbon.
Illustration Group on Insert Ribbon Drawing Tools Format Ribbon for modifying a shape

Drawing Tools Format Ribbon for modifying a picture

A cool shape!
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Inserting Rows or Columns

Often you want to insert rows or columns somewhere in the middle of


your worksheet.

To insert one or more blank rows:

Click a row number and drag down as many rows as you want to insert.
Then right-click and select Insert. Alternatively, you can click the Insert
dropdown on the Home ribbon and select Insert Sheet Rows.
(Interestingly, this Insert dropdown is on the Home ribbon, not on the
Insert ribbon.)

If you prefer a keyboard shortcut (a leftover from pre-2007 menu items),


press Alt+i and then r (i for insert, r for row).

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.

You can insert columns in exactly the same way. The keyboard shortcut is
Alt+i and then c.

Month Price Units sold Revenue


Jan $3.00 100 $300.00
Mar $3.25 50 $162.50
Jun $3.50 200 $700.00

Deleting Rows or Columns


First, note that deleting a row or column is not the same as clearing the
contents of a row or columnmaking all of its cells blank. Deleting a row
or column means wiping it out completely.

To delete one or more rows:

Click a row number and drag down as many rows as you want to delete.
Then right-click and select Delete. Alternatively, you can click the Delete
dropdown on the Cells group of the Home ribbon and select Delete Sheet
Rows.

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.

You can delete columns in exactly the same way. In fact, the keyboard
shortcut is still Alt+e and then d.
Then right-click and select Delete. Alternatively, you can click the Delete
dropdown on the Cells group of the Home ribbon and select Delete Sheet
Rows.

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.

You can delete columns in exactly the same way. In fact, the keyboard
shortcut is still Alt+e and then d.

Hide and Unhide items fro


Hiding or Unhiding Rows or Columns

You can also hide or unhide rows or columns. The following explains how
to hide or unhide rows. The same directions work for columns.
To hide a group of adjacent rows, click the top row number you want to
hide, hold down the Shift key, and click the bottom row number you
want to hide. This selects the rows you want to hide. (Alternatively, you
can drag the row numbers.) Then right-click and select Hide.
Alternatively, you can click the Hide and Unhide arrow from the Format
dropdown in the Cells group of the Home ribbon, as shown to the right.
From there, click on Hide Rows.

To unhide rows, select the adjacent nonhidden rows. For example, if you
hid rows 69-75, you would select rows 68 and 76. Then right-click and
select Unhide, or use the dialog box to the right.

Again, there are leftover menu item shortcuts for hiding and unhiding:

Alt+o, then r, then h to hide rows


Alt+o, then r, then u to unhide rows
Alt+o, then c, then h to hide columns
Alt+o, then c, then u to unhide columns

Try it! Hide any subset of the rows in the data set below. Then unhide
them.

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
Hide and Unhide items from Home ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

General Comments About Worksheets

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 mainly about
worksheets, not chart sheets. The actions discussed below are things you will
do every day, so you need to know how to do them efficiently.

Renaming a Worksheet

The name of a worksheet appears in its tab at the bottom of the screen.

To rename a worksheet:

Double-click its tab and type a new name.

Try it! Rename this worksheet as Worksheet Tasks. Then change its name
back to Topic.

New Sheet button


Adding a New Worksheet

You often need to add new worksheets. This is very easy.

To add a new worksheet:

Click the button to the right of your rightmost worksheet tab, the one
shown to the right. (It was a different icon in Excel 2007 and 2010.) This
creates a new worksheet to the right of the rightmost sheet with a generic
name such as Sheet3, which you can then rename.

In some situations, you might not want the new sheet to be way out to the
right. There is another option. You can right-click a worksheet tab, select
Insert, and select a blank worksheet as the item to add. The new
worksheet will be placed to the left of the tab you right-clicked.

Try it! Create a new worksheet to the left of this one and rename it
Practice1.
Selecting One or More Worksheets

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 labels, formulas, and formatting.

To select multiple adjacent worksheets:

Click the tab of the leftmost of these, hold down the Shift key, and click
the tab of the rightmost of these.

To select multiple nonadjacent worksheets:

Click the tab of any of them, hold down the Ctrl key, and click the other
tabs you want to select.
When multiple worksheets are selected, one will be active, but the tabs
of the others will also be highlighted, indicating that they are selected.
(In Excel 2013, the active sheet's tab is green; the others are black.) They
will remain selected until you click the tab of some other worksheet.
There is one exception to this. If all of the worksheets are selected, you
can click any other 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 viewing the other Practice
worksheets, you should see that they all have this label in cell A1. Finally,
activate the worksheet you are reading now (Topic). This deselects the
Practice worksheets.

Deleting One or More 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.

To delete one or more worksheets:

Select the ones you want to delete, as explained in the previous text box.
Then right-click any of the selected tabs. This brings up a context-sensitive
menu, which has a few options you might want to try. For now, select
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!
menu, which has a few options you might want to try. For now, select
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!

Moving or Copying a Worksheet

You can also move or copy a worksheet. You can do this in one of two
ways: by dragging tabs or through the Move or Copy menu item. The first
way is easier; the second gives you more options.

To move or copy a worksheet by dragging its tab:

Drag the worksheet's 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 some other position, 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 Topic (2), which you can
then rename if you want. For now, delete the copy.

To move or copy a worksheet with the Move or Copy menu item:

Right-click the worksheet's tab and select Move or Copy, as shown to the
right. This brings up the Move or Copy dialog that lets you select the Move or Copy menu item
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. If
you select a different workbook and don't check the latter option, the
worksheet will be removed from the current file; it will move to the other
workbook. So be careful.

Try it! If necessary, 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 without saving to delete it.

Hiding or Unhiding a Worksheet

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 receive 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!

To hide a worksheet:

Right-click the worksheet's tab and select Hide.


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 receive 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!

To hide a worksheet:

Right-click the worksheet's tab and select Hide.

To unhide a worksheet:

Right-click any worksheet's tab. If the Unhide option is disabled, you


know there are no hidden worksheets. (Well, this isn't quite true. See the
note below.) Otherwise, select Unhide. You will see a list of the hidden
worksheets, and you can choose the one you want to unhide.
Unfortunately, if there are several hidden worksheets, you have to
unhide them one at a time; you can't unhide them all at once.

Try it! Hide this worksheet. Then unhide it.

Note: It is possible that there is at least one hidden worksheet even if the
Unhide option is disabled. By using a macro, it is possible to set the
status of a worksheet to "very hidden." Such worksheets can be
unhidden only through another macro. Software companies sometimes
create very hidden worksheets because they know these worksheets
would only confuse users, or because they don't really want users to see
their contents.

Going to the First or Last Worksheet, starting in Excel 2013

In pre-2013 versions of Excel, there are two buttons at the lower left corner
of the Excel window for going to the left through the worksheets. The second
takes you to the previous worksheet, and the first takes you the whole way
back to the first (leftmost) worksheet. Similarly, there are two buttons for
going to the right. Starting in Excel 2013, there are only two buttons, one for
going to the previous worksheet and one for going to the next worksheet.

Fortunately, if you press the Ctrl key and one of these newer buttons, it takes
you to the first or last worksheet. This can save plenty of scrolling if you have
dozens of worksheets, so it is definitely a tip worth remembering!
New Sheet button
Move or Copy menu item Move or Copy dialog box
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

A-Z and Z-A buttons on Da


Simple Sorting with A-Z or Z-A

Sorting, which usually means putting in alphabetical order or increasing


or decreasing numerical order, is a common and simple operation.
However, there are some nonobvious things you should know.

The usual situation is that you have a data set such as the one to the
right. If you want to perform a simple sort on any of its columns, select Person
any single data cell in this column and click the A-Z or the Z-A button. You 1
can find these buttons under the Sort & Filter dropdown on the Home 2
ribbon, and they are also on the Data ribbon. But because they are used
so often, you probably ought to add them to your Quick Access Toolbar 3
so that they are always available. 4
5
Try it! Sort on any of the columns to the right, either in A-Z or Z-A order.
Note that when you sort on any column such as Salary, the other columns 6
change accordingly. That is, each row remains intact. Of course, this is the 7
behavior you would expect and want. 8
You can undo a sort, but just in case, it is often nice to have an "ID" 9
column with consecutive integers, 1, 2, 3, etc. This is the role of the 10
Person column in this data set. No matter how many sorts you do, you
can return to the original sort order by sorting (A-Z) on Person. 11
12
13
14
15
16
17
18
19
Sorting the Correct Range
20
The above instructions said to select a single cell before you click A-Z or Z-A. If 21
you select a range, such as the entire State column, and then click A-Z or Z-A, 22
you will be asked if you want to expand the selection (meaning to the full data
set) or continue with the current selection. You almost always want to expand
the selection. If you continue with the current selection, only the Salary values
will be sorted, and the sorted salaries will not correspond to the right people.

Custom Sort button on Da


Custom Sorts

Excel gives you many more sort possibilities with its Custom Sort item
under the Sort & Filter items (on both the Home and Data ribbons). When
you click either of these, you seel the Custom Sort dialog box to the right
where, among other things, you can add levels. The data set above
illustrates why you might want to do this. Suppose you want to sort so
that all of the females 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. The correct settings for this sort are
shown to the right.
under the Sort & Filter items (on both the Home and Data ribbons). When
you click either of these, you seel the Custom Sort dialog box to the right
where, among other things, you can add levels. The data set above
illustrates why you might want to do this. Suppose you want to sort so
that all of the females 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. The correct settings for this sort are
shown to the right.
Try it! Sort the above data set as explained in the previous paragraph.
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.

Grade
Sorting Text A+
A
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 A-
to the right. Is this what you expected? Probably not. (See the next text B+
box for a fix.) B
What about the Name column to the right, where some names are upper B-
case and some are lower case? By default, the sort order is case-insentive, C+
that is, case doesn't matter. Try sorting on Name with the A-Z button. They C
are indeed sorted in alphabetical order, except that the Name label got
sorted too. (Press Ctrl+z to undo this sort.) To prevent the label getting C-
sorted, bring up the Custom Sort dialog box and check the "My data has D+
headers" option.
D
While you are in Custom Sort dialog box, note the Options button at the D-
top. One option is to check or uncheck the "Case sensitive" box. It is F
probably unchecked by default. However, check it and then sort on the
Name column to the right. It is still sorted in alphabetical order, ignoring
case. This appears to be a bug in Excel, or at least it's unexpected.

Order
Creating a Custom List for Sorting 1
2
Sometimes you want to sort in a "natural" order, such as months in a year 3
(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, 4
click the Order dropdown, and select Custom List. (You can also get to the 5
Custom Lists dialog box from the Advanced group in Excel Options.) As
shown to the right, you will see several custom lists built into Excel: the 6
months of the year and the days of the week, either three-letter
abbreviations or written out. You can also click NEW LIST and enter your
own custom list. This new custom list is remembered on your PC for later
uses.
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 the Order dropdown, and select Custom List. (You can also get to the
Custom Lists dialog box from the Advanced group in Excel Options.) As
shown to the right, you will see several custom lists built into Excel: the
months of the year and the days of the week, either three-letter 7
abbreviations or written out. You can also click NEW LIST and enter your 8
own custom list. This new custom list is remembered on your PC for later
uses. 9
10
You will probably create custom lists for sorting only for lists you use 11
frequently. For example, if you are an instructor and typically have a list
of possible grades as in the Grade range above, you might want to create 12
a custom list with the grades in the "natural" order. But if this is a list you 13
need only once, it is easier to enter the grades manually in the order you 14
want them.
15
Try it! Sort on Day, using the built-in custom list. Then create a new 16
custom list with items Morning, Afternoon, Evening, in this order, and
sort on Time using this custom list. 17
18
19
20
21
22
23
24
25
A-Z and Z-A buttons on Data ribbon

Age Gender State Children Salary


35 Male Ohio 1 $65,400
61 Female Illinois 2 $62,000
35 Male Illinois 0 $63,200
37 Male Indiana 2 $52,000
32 Female Ohio 3 $81,400
33 Female Illinois 3 $46,300
65 Female Illinois 2 $49,600
45 Male Ohio 1 $45,900
40 Male Illinois 3 $47,700
32 Female Ohio 1 $59,900
57 Male Illinois 1 $48,100
38 Female Indiana 0 $58,100
37 Female Indiana 2 $56,000
42 Female Ohio 2 $53,400
38 Female Ohio 2 $39,000
48 Male Ohio 1 $61,500
40 Male Indiana 0 $37,700
57 Female Indiana 2 $36,700
44 Male Illinois 2 $45,200
40 Male Ohio 0 $59,000
21 Female Indiana 2 $54,300
49 Male Ohio 1 $62,100

Custom Sort button on Data ribbon Custom Sort dialog box


Name
BOB
charlie
CHRIS
doug
FRED
jenny
MARY
sam
TOM

Time Day Custom Lists dialog box


Morning Saturday
Evening Wednesday
Evening Saturday
Afternoon Friday
Evening Tuesday
Morning Tuesday
Afternoon Monday
Afternoon Saturday
Afternoon Monday
Morning Tuesday
Evening Sunday
Morning Monday
Afternoon Wednesday
Morning Friday
Afternoon Saturday
Morning Tuesday
Afternoon Thursday
Afternoon Friday
Afternoon Friday
Evening Thursday
Morning Sunday
Morning Monday
Morning Sunday
Morning Sunday
Morning Saturday
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Print dialog box


Print Options
Printing Excel worksheets is easy. Well, sort of. If you want to print a
worksheet, activate it and press Ctrl+p. Alternatively, you can click the
File button and then Print. Either method brings up the dialog box to the
right, showing the printer and a number of print settings. You can simply
click Print 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.
Starting in Excel 2010, this Print dialog box shows all print options in a
single convenient location. You ought to spend some time getting used to
it. However, you can continue to use the older Page Setup dialog box if
you prefer. You can get to this from the link in red to the right. The Page
Setup dialog box has four tabs, two of which are shown below.

You can experiment with the print options. You do have a lot of control
over what is printed and how it looks on the paper. For example, you can
select the bottom dropdown in the dialog box to the right and select Fit
Sheet on One Page to get everything on a single piece of paper.
Note: You might sometimes find that certain objects like text boxes,
buttons, and arrows do not get printed. To remedy this, right-click any
such object, select Size and Properties, and click the Properties tab. This
contains a "Print object" option that you can check or uncheck.

Page tab on Page Setup dialog box Sheet tab on Page Setup dialog box
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Reasons for Relative/Absolute Addressing

Absolute and references are indicated in formulas by dollar signs


(absolute) or the lack of dollar signs (relative), and they indicate what
happens when you copy or move a formula. You typically want some
parts of the formula to stay fixed (absolute) and others to change relative
to the cell position.

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.

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 itself. For example,
the formulas =5*B3 and =5*$B$3 in some cell produce exactly the same
result. Their difference is relevant only if you want to copy the formula to
some range.

2. There is never any need to type the dollar signs. You can do it with the
F4 key. This is explained in more detail below.

Creating Relative/Absolute Addresses

To make a cell reference absolute or mixed absolute/relative using the F4


key:

Enter a cell reference such as =B3 in a formula. Then press 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 L35 and copy across to O35.
(Scroll to the right to see the answer.)

Try it again! Enter one formula with appropriate absolute/relative


addressing in cell M41 that can be copied to M41:P45. (Scroll to the right
to see the answer.)
Try it again! Enter one formula with appropriate absolute/relative
addressing in cell M41 that can be copied to M41:P45. (Scroll to the right
to see the answer.)
List of Topics sheet

Fixed cost $50


Variable cost $2

Month Jan Feb Mar Apr


Units produced 224 194 228 258
Total cost

Table of revenues for various unit prices and units sold

Units sold
50 100 150 200
Unit price $3.25
$3.50
$3.75
$4.00
$4.25
Fixed cost
Variable cost

Month
Units produced
Total cost

Unit price
$50
$2

Jan Feb Mar Apr


224 194 228 258
$498 $438 $506 $566

Units sold
50 100 150 200
$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
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Calculation options on For


Calculation Options

You might not even think about it, but Excel is an amazing calculation
engine. Not only does it calculate a formula as soon as you enter it, but it
recalculates everything that is affected by any changes you make in any
cell or range of any worksheet. This behavior is called Automatic
recalculation, and it is the behavior you are accustomed to in Excel.

However, there are two other calculation options in Excel: Automatic


Except for Data Tables and Manual.

To change the calculation option:

Click the Calculation Options dropdown from the Formulas ribbon and
select any of the three options shown to the right.
With the Automatic Except for Data Tables setting, data tables will not
recalculate until you force it to. This is useful because data tables can
sometimes take a long time to recalculate. (Data tables are discussed in
another topic of this tutorial.)

With the Manual setting, nothing recalculates until you force a


recalculation. This might be useful when your workbook has many
complex formulas and you don't want them to recalculate until you force
them to. However, if you turn this setting on by accident, the resulting
Excel behavior will not be what you are used to!

Forcing a Recalculation

The easiest and most common way to force a recalculation is to press the F9
key. This is often called the "recalc" key. You can also click the Calculate Now
button or the Calculate Sheet button, both on the Formulas ribbon (see the
above screenshot). Calculate Now recalculates all formulas in the workbook.
Calculate Sheet recalculates only the formulas in the active worksheet.

Inheritance

The Calculation setting is inherited from file to file in an unintuitive way.


Essentially, if you change the setting from its default Automatic to, say,
Manual, all other files you open in that Excel session will inherit this
setting, even if they were originally saved with the Automatic setting. To
convince yourself of this, try the following.

1. Launch Excel and, if necessary, open a new blank workbook. Change


the Calculation setting to Manual, save this file as CalcTest1.xlsx, and
Inheritance

The Calculation setting is inherited from file to file in an unintuitive way.


Essentially, if you change the setting from its default Automatic to, say,
Manual, all other files you open in that Excel session will inherit this
setting, even if they were originally saved with the Automatic setting. To
convince yourself of this, try the following.

1. Launch Excel and, if necessary, open a new blank workbook. Change


the Calculation setting to Manual, save this file as CalcTest1.xlsx, and
close the file (but keep Excel open).

2. Open a new blank workbook. Its Calculation setting will be Manual,


inherited from CalcTest1. Change the setting to Automatic, save this file
as CalcTest2.xlsx, close the file, and close Excel.

3. Launch Excel again, and open CalcTest1. Its Calculation setting will still
be Manual. Then open CalcTest2. Even though this file was saved with
the Automatic setting, its setting now will be Manual. Save CalcTest2,
and then close both files and Excel.

4. Launch Excel once more, and open CalcTest2. Its Calculation setting
will now be Manual.

The upshot of all of this is that if you change the Calculation setting to a
non-Automatic setting for one file, later files you open in this session will
inherit the non-Automatic setting, which can produce unexpected
results. (You'll be asking, Why won't anything recalculate??) Worse yet, if
you save any of these later files, their non-Automatic setting will be
saved, which will likely cause unexpected results down the road.

Why did Microsoft do it like this? Who knows!


Calculation options on Formulas ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

AutoSum button on Home


Using AutoSum to Create Row and/or Column Sums

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. This button
is on the Home ribbon and the Formulas ribbon, as shown to the right.

To illustrate its use, suppose you have a table of numbers in some AutoSum button on Formu
rectangular range. You want row sums to appear to the right of the range,
and you want column sums to appear below the range. This is easy.

To produce row and column sums with the AutoSum button:

Select the range(s) where you want the sums to appear and click the
AutoSum button.

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 are shown the sum formula for your approval,
and you have to press Enter to actually enter it.

Try it! Use the AutoSum button to fill in the row and column sums in the 51
gray cells to the right, including the darker gray cell which should show 37
the sum of all the data.
13
73
38

Other "AutoSum" options


Other Uses of the AutoSum Dropdown
Note that there is a dropdown arrow next to the AutoSum button. If you want
a sum, you can click the S button directly. However, you can click the
dropdown arrow for other options, including Average, Count Numbers, Max,
and Min, as shown to the right.
AutoSum button on Home ribbon

AutoSum button on Formulas ribbon

94 15 7
6 2 41
83 29 88
64 46 32
11 3 80

Other "AutoSum" options


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Defined Names group in F


Basics of Named Ranges

Range names are used for one basic purpose: to make your formulas
more readable. After all, which formula do you prefer: =B20-B21 or
=Revenue-Cost? Efficient use of range names takes some experience, but
this worksheet provides a few useful tips.

A range name can be applied to a single cell or to any range of cells. There
are a few rules for the names you can use. The most important are that
(1) the names cannot include a few "illegal" characters, the most common
being spaces, and (2) they can't look like cell addresses. For example,
DAN37 is illegal because DAN37 is a cell address.

You can definitely go overboard in the use of named ranges, and you can
err in the other direction by refusing to use them. You should use some
discretion (and possibly company policy) when deciding how extensively
to use range names.

Range names have been available for many years, but they are more
prominent in Excel 2007 and later versions. Their functionality is in the
Defined Names group, right in the middle of the Formula ribbon, as
shown to the right.

Name box to left of Formu


Naming a Range in the Name Box

The easiest and best-known way to name a range is to use the Name box,
just to the left of the Formula bar. This is shown to the right, where the
Name box originally contains a cell address.

To create a range name with the Name box:

Select a range you want to name, which can be a single cell, click in the
Name box, type a range name, and press Enter. Don't forget to press Enter
after typing the range name or the name you type won't "stick." 71
15
Try it! Name the gray range to the right Data. 14
The Name box is also useful for finding named ranges. To do so, click the 40
dropdown arrow in the Name box to see a list of all range names, and click 28
one of them. This will select the corresponding range. 41
28

Using the Name Manager

You get much more control of named ranges by clicking the Name Manager
on the Formulas ribbon. This displays the dialog box to the right. It shows a
Name Manager dialog box
Using the Name Manager

You get much more control of named ranges by clicking the Name Manager
on the Formulas ribbon. This displays the dialog box to the right. It shows a
list of all range names in your workbook, the values in these ranges, and the
corresponding range addresses. You can select any range name and then Edit
or Delete it. (Delete doesn't delete the contents of the range; it only deletes
the range name.) You can also click the New button to create a new named
range. In this case, you need to supply a name and an address.

Try it! Rename the above gray range of numbers MyData. Then delete the
MyData range name. Then use the Name Manager to create the Data range
name again.

Using the Create from Selection Shortcut

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 very Create Names from Selecti
quick way to do this.

To create range names from adjacent labels:

Select the range consisting of the labels and the cells to be named. Then
click 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 OK. Excel tries,
usually successfully, to guess where the labels are that you want to use as
range names. You can always override its guess.

Try it! Name each of the colored ranges to the right (but not the totals)
with the labels above them. You will notice that Excel guesses Top row and
Left column. You can uncheck Left column unless you want the rows to be
named by the month names.

Apply Names option


Applying New Range Names to Existing Formulas

If you create range names and then create formulas that reference these
ranges, Excel uses the range names automatically. Sometimes, however,
you do it in the opposite order. That is, you enter a formula using cell
addresses, such as =B20-B21, and 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.

To apply range names to an existing formula:

Select Apply Names from the Define Name dropdown in the Defined
Names group, as shown to the right. Then select all range names that you
want to apply to any cell formulas. For example, if you select all range
you do it in the opposite order. That is, you enter a formula using cell
addresses, such as =B20-B21, and 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.

To apply range names to an existing formula:

Select Apply Names from the Define Name dropdown in the Defined
Names group, as shown to the right. Then select all range names that you
want to apply to any cell formulas. For example, if you select all range
names in the list, all formulas that reference any of these named ranges
will change to show the corresponding range names.

Try it! You should now have the range names UnitsSold and Revenue for
the red and orange ranges to the above right. Apply these to all formulas
that reference them, that is, to the SUM formulas in darker red and
orange cells.

Paste Names option


Pasting a List of Range Names for Documentation

If you have many range names, it is often useful to show a list of them and
the range addresses they apply to. This is easy.

To paste a list of all range names on a worksheet:

Select a cell with plenty of blank space below it, select the Use in Formula
dropdown in the Defined Names group, and click the Paste Names option, as
shown to the right.

Try it! Paste a list of all range names, starting in the gray cell to the right.
Defined Names group in Formulas ribbon

Name box to left of Formula bar

31 9 69 5
74 46 84 27
49 25 38 83
43 20 75 83
72 30 92 75
56 90 89 73
81 43 81 61
Name Manager dialog box

Create Names from Selection dialog box


Month UnitsSold UnitPrice Revenue
Jan 100 $1.25 $125.00
Feb 150 $1.25 $187.50
Mar 200 $1.40 $280.00
Apr 230 $1.40 $322.00
May 200 $1.50 $300.00
Jun 300 $1.50 $450.00
Totals 1180 $1,664.50

Apply Names option


Paste Names option Range names used in this workbook:
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Using the Formula Auditing Buttons to Trace Precedents and


Dependents

There are times when 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 doesn'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, shown to the right,
has buttons for tracing precedents and dependents. If you select a cell
and click Trace Precedents, you will see arrows from all of the cell's
precedents to it. If you click Trace Dependents, you will see arrows from
the cell to all of its dependents. You can then click 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 Trace Dependents again, you will see all of the
dependents' dependents.

Try it! In the example to the right, a company sends catalogs to


customers, and this 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 that 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.
Keyboard Shortcuts for Tracing Precedents and Dependents

If you like keyboard shortcuts, these are a few you will really appreciate.
Instead of using arrows to indicate precedents and dependents, these
shortcuts select cells that are precedents and dependents.

Ctrl+[ : select all direct precedents of the selected cell

Ctrl+] : select all direct dependents of the selected cell

Ctrl+Shift+[ : select all precedents, direct and indirect, of the selected cell

Ctrl+Shift+] : select all dependents, direct and indirect, of the selected cell

Try it! Use these keyboard shortcuts in the above model to better
understand the relationships.

Adding a Watch

The Formula Auditing group also contains a Watch Window button. You can
click it to add a watch on any cell (or cells). The screenshot to the right
shows how a watch was added to the profit cell on this worksheet. This is
particularly useful for large models (unlike the small model here) where you
can't see your inputs and outputs all at once on the same screen. Once this
watch is added, you keep the window open and enter values for various
inputs to see how profit changes. If it doesn't change at all, or if it doesn't
change in the way you expect, you can examine your formulas for errors.

Try it! Add watches on total revenue, total cost, and profit. Then watch how
they change in the Watch Window as you change inputs such as average
revenue per order or the response rate.

Showing Formulas

A common wish is to see all of the formulas, not their values. This is easy. Just
click the Show Formulas button in the Formula Auditing group. This button is
actually a toggle between values and formulas. Equivalently, you can use
keyboard shortcut Ctrl+~.

Try it! Click the Show Formulas button to see all formulas in the model. Then
click this button again to show the values. Note that the columns expand
when you show formulas, but fortunately, they revert back to their original
widths when you show values.
keyboard shortcut Ctrl+~.

Try it! Click the Show Formulas button to see all formulas in the model. Then
click this button again to show the values. Note that the columns expand
when you show formulas, but fortunately, they revert back to their original
widths when you show values.
List of Topics sheet

Formula Auditing group on Formulas ribbon

Profit model
Unit printing cost $0.10
Unit mailing cost $0.15
Variable cost of printing and mailing $0.25
Number mailed 100000

Average revenue per order $60


Order fulfillment cost (% of revenue) 60%
Variable cost per order fulfillment $36.00

Response rate 3%
Number of responses 3000

Total Revenue $180,000


Fixed cost of printing $20,000
Total variable cost of printing and mailing $25,000
Total variable cost of order fulfillment $108,000
Total cost $153,000
Profit $27,000
Watch Window button in Formula Auditing group

Watch window

Show Formulas button in Formula Auditing group


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Charts group on Insert rib


Introduction to Charts

Nothing tells a story better than a well-designed chart, and Excel


provides a huge number of charting possibilities. In fact, whole books
have been devoted to Excel charts. It is impossible to cover all of the
possibilities here, but the files in this group illustrate how to create and
modify basic charts quickly and easily. Chart Tools Design ribbon
You create a chart by selecting one of many options from the Charts
group on the Insert ribbon. (Several of these chart types, such as
histogram and waterfall, are new to Excel 2016.) Then once you have a
chart and select it, two Chart Tools ribbons, Design and Format, become
available. Also, three handy buttons appear to the right of the chart for
making modifications.

Rather than read long chapters on charts, it is best to experiment. But


here are a few basics. Chart Tools Format ribbon

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 (see to
the right). Each button has a dropdown list for the various subtypes.
Starting in Excel 2013, there is even has a Recommended Charts button
for guessing the most appropriate type of chart for your specific data.

2. Once you have a chart and then select it you get two Chart Tools tabs,
Design and Format, shown to the right. 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. It 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 various parts of a chart to see many possibilities.
Charts group on Insert ribbon in Excel 2016

Chart Tools Design ribbon in Excel 2016

Chart Tools Format ribbon in Excel 2016


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Creating a Chart the Easy Way

Probably the easiest way to create a chart, based on a given data set, is to
select 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 probably want to modify the resulting chart, but this usually
provides a good start.

The data set to the right is typical. The goal is to create a column chart of
monthly sales, so the entire gray range to the right was selected, including
the labels in the top row, and a column chart of the first subtype was chosen
from the Insert ribbon. The only change that was then made to the chart was
to delete the legend. (Even this is not necessary in Excel 2013. It doesn't add
a legend for a single series.) Excel guessed correctly that it should chart one
series, Sales, and that it should use the dates in column K as labels for the
horizontal axis.

Creating a Chart with Multiple Series

Here is another example. The data set to the right includes monthly sales of two
products, and the goal is to create a line chart that contains both series. In this
case, the entire gray range was selected, and a line chart with markers was
chosen from the Insert ribbon. This time, a legend is appropriate. However,
there was no title above the chart by default, so the one shown was entered (by
selecting the title and then typing a new title in the formula bar).

The Important Role of Series in a Chart

The most important concept for 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 above, there are two series, Sales1 and Sales2. Typically, each
series is a column of data, with a label at the top. However, series are
sometimes in rows, as in the example to the right. Again, you can select the
entire gray range and insert a line chart. Excel guesses correctly that the data
series are in rows, not columns. But what if it makes the wrong guess? See the
next example.
sometimes in rows, as in the example to the right. Again, you can select the
entire gray range and insert a line chart. Excel guesses correctly that the data
series are in rows, not columns. But what if it makes the wrong guess? See the
next example.

Switching the Roles of Rows and Columns and Changing the Chart Type

The data set to the right contains sales data for four products in six
regions. You can select the entire gray range and insert a line chart. But
what are the series? By default, Excel creates a line for each product, with
the region labels on the horizontal axis. That is, it guesses 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.

To switch the roles of rows and columns:

Select the chart and click the Switch Row/Column button on the Chart
Tools Design ribbon.

Try it! Create a column chart of the first subtype for the monthly data in
the gray range to the right, where each series corresponds to a time series
for a particular product.

Sometimes you change your mind and want to have another chart type.

To change the chart type:

Select the chart and click 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.

Using a Secondary Axis for a Second Series

Sometimes you have two series of very different magnitudes that you want
to plot on a single chart. If you use the same vertical axis for both series,
the one with the smaller magnitudes will be swamped by the other series;
it will barely show up. However, you can plot either series with a secondary
axis, which appears to the right of the chart.

It is actually very easy. The chart to the right plots both sales series on a
single vertical axis, so the much smaller Sales1 series hugs the horizontal
Using a Secondary Axis for a Second Series

Sometimes you have two series of very different magnitudes that you want
to plot on a single chart. If you use the same vertical axis for both series,
the one with the smaller magnitudes will be swamped by the other series;
it will barely show up. However, you can plot either series with a secondary
axis, which appears to the right of the chart.

It is actually very easy. The chart to the right plots both sales series on a
single vertical axis, so the much smaller Sales1 series hugs the horizontal
axis. To create a secondary axis, right-click the series you want on the
secondary axis, select Format Data Series, and select the Secondary Axis
option.

Try it! Using the chart to the right, put the Sales1 series on a secondary axis.

Note: You can do this with multiple series, but it is most common when
plotting only two series. If there are more than two series and you assign at
least one of them to a secondary axus, it is difficult to tell which series goes
with which axis.

Modifying the Data Series

By selecting 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.

To modify the data series in an existing chart:

Select the chart and click the Select Data button on the Chart Tools Design
ribbon. This brings up the Select Data Source dialog box shown to the right,
with the series charted on the left and the data used for the horizontal axis
labels on the right. You can then edit any of these.

Try it! The line chart to right was created by selecting the gray range to the
right, without the labels in the left column or the top row. There are three
problems: (1) the months should be labels on the horizontal axis; (2) the
two "junk" series shouldn't be part of the chart; and (3) the two sales series
should be named by the Sales1 and Sales2 labels in the top row. Open the
Data Series dialog box and fix these problems.

Scatter Charts

One chart type that works a bit differently from the others is the scatter
chart. This type of chart is useful for detecting relationships between two
variables, such as height and weight in the data set to the right.

To create the scatter chart, you can select the gray range to the right and
insert a scatter chart of the first subtype. You can then change the title and
add horizontal and vertical axis titles, as shown. (Excel 2013 doesn't add
Scatter Charts

One chart type that works a bit differently from the others is the scatter
chart. This type of chart is useful for detecting relationships between two
variables, such as height and weight in the data set to the right.

To create the scatter chart, you can select the gray range to the right and
insert a scatter chart of the first subtype. You can then change the title and
add horizontal and vertical axis titles, as shown. (Excel 2013 doesn't add
the legend that was added automatically in previous versions of Excel.) If
you then open the Data Series dialog box by clicking the Select Data
button, you will see that there is one series, Weight. However, if you click
the Edit button 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-axis series, and the other is
the X-axis series. If you want them reversed, you have to go through the
Edit 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. (If you created axis
titles, you will have to change them manually.)
st of Topics sheet

Month Sales
Jan-13 $8,627 Sales
Feb-13 $5,343 $10,000
Mar-13 $6,244 $9,000
Apr-13 $9,451 $8,000
May-13 $6,698 $7,000
Jun-13 $6,752 $6,000
Jul-13 $5,985 $5,000
Aug-13 $5,586 $4,000
Sep-13 $8,476 $3,000
Oct-13 $9,191
$2,000
Nov-13 $7,242
$1,000
Dec-13 $8,277
$0
Jan-13 Ma r-13 May-13 Jul -13 Sep-13 Nov-13

Month Sales1 Sales2


Jan-13 $8,627 $8,452 Monthly Sales of Two Products
Feb-13 $5,343 $6,801 $12,000
Mar-13 $6,244 $5,497
$10,000
Apr-13 $9,451 $10,329
May-13 $6,698 $5,995 $8,000
Jun-13 $6,752 $8,103
$6,000
Jul-13 $5,985 $6,386
Aug-13 $5,586 $5,047 $4,000
Sep-13 $8,476 $8,641
$2,000
Oct-13 $9,191 $10,696
Nov-13 $7,242 $6,914 $0
Dec-13 $8,277 $9,004 Jan-13 Ma r-13 May-13 Jul -13 Sep-13 Nov-13
Sal es1 Sal es 2

Month Jan-13 Feb-13 Mar-13 Apr-13 May-13 Jun-13 Jul-13 Aug-13


Sales1 $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586
Sales2 $8,452 $6,801 $5,497 $10,329 $5,995 $8,103 $6,386 $5,047

Monthly Sales of Two Products


$12,000

$10,000

$8,000

$6,000

$4,000
$12,000

$10,000

$8,000

$6,000

$4,000

$2,000

$0
Jan-13 Ma r-13 May-13 Jul -13 Sep-13 Nov-13
Sa l es 1 Sal es 2

Product1 Product2 Product3 Product4 $5,000


Region1 $4,749 $1,637 $1,002 $4,212 $4,500
Region2 $1,187 $2,259 $4,236 $2,711 $4,000
Region3 $2,973 $3,779 $4,419 $1,881 $3,500
Region4 $4,570 $3,677 $3,682 $3,020 $3,000
Region5 $3,494 $1,040 $4,637 $1,808 $2,500
Region6 $2,158 $4,644 $1,296 $3,920 $2,000
$1,500
$1,000
$500
$0
Regi on1 Regi on2 Regi on3 Regi on4 Regi
Product1 Product2 Product3

Jan-13 Feb-13 Mar-13 Apr-13 May-13 Jun-13


Product1 $1,191 $2,116 $1,328 $2,136 $2,352 $4,156
Product2 $3,147 $3,751 $3,954 $4,314 $4,194 $2,442
Product3 $2,959 $3,628 $3,628 $4,529 $2,548 $4,415
Product4 $1,740 $2,733 $4,310 $2,228 $1,313 $2,675
Product5 $4,730 $1,058 $4,800 $2,156 $2,518 $2,917
Product6 $4,970 $4,947 $2,707 $1,134 $1,787 $1,927

Month Sales1 Sales2


Jan-13 $8,627 $845,200 Monthly Sales of Two Products
Feb-13 $5,343 $680,100 $1,200,000
Mar-13 $6,244 $549,700
$1,000,000
Apr-13 $9,451 $1,032,900
$800,000

$600,000

$400,000
Monthly Sales of Two Products
$1,200,000

$1,000,000

May-13 $6,698 $599,500 $800,000


Jun-13 $6,752 $810,300
$600,000
Jul-13 $5,985 $638,600
Aug-13 $5,586 $504,700 $400,000
Sep-13 $8,476 $864,100
$200,000
Oct-13 $9,191 $1,069,600
Nov-13 $7,242 $691,400 $0
Dec-13 $8,277 $900,400 Jan-13 Mar-13 May-13 Jul -13 Sep-13 Nov-13
Sal es1 Sal es 2

Month Junk1 Junk2 Sales1 Sales2 Select Data Source dialog box
Jan-13 29 27 $2,625 $4,139
Feb-13 74 23 $1,776 $4,955
Mar-13 78 59 $2,537 $2,379
Apr-13 6 12 $4,360 $4,631
May-13 69 2 $3,636 $2,413
Jun-13 62 3 $2,135 $4,187

6000

5000

4000

3000

2000

1000

0
1 2 3 4 5 6
Col umn L Col umn M Col umn N Col umn O

Person Height Weight


1 60 155 Weight
2 61 162 300
3 62 162
250

200

150
Weight
300

4 63 162 250
5 63 164
200
6 65 168
7 70 175
150
8 72 199
9 72 215 100
10 76 241
50

0
58 60 62 64 66 68 70 72 74 76
Sep-13 Nov-13

Two Products

Jul -13 Sep-13 Nov-13


Sal es 2

Sep-13 Oct-13 Nov-13 Dec-13


$8,476 $9,191 $7,242 $8,277
$8,641 $10,696 $6,914 $9,004
n2 Regi on3 Regi on4 Regi on5 Regi on6
Product2 Product3 Product4

Two Products
Two Products

Jul -13 Sep-13 Nov-13


Sal es 2

ght
ght

8 70 72 74 76 78
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Chart Types

When you create a chart in Excel, you have to choose the chart type, and
there are plenty to choose from. The most common types, the ones you
have probably used, are column charts, line charts, pie charts, and scatter
charts. There are also several new types of charts introduced in Excel
2016 that you should be aware of. Of course, the appropriate chart type
depends on the type of data you have. For example, line charts are
especially useful for time series data, and scatter charts are useful for
exploring relationships between two columns of data.

This topic briefly explores the various chart types. Based on the
information provided here, you can then experiment with your own data.
Just be aware that it is easy to change the chart type once you have
created a chart. Just select the chart, click the Change Chart Type button
on the Chart Tools Design ribbon, and choose a chart type.Also, you can
modify an existing chart of a given type in an endless number of ways.

Before proceeding, note that when you select your data, you can always
click the Recommended Charts button on the Insert ribbon. This suggests
chart types that might be appropriate for your data, and you can select
any of these.

Column (or Bar) Charts

Column charts (vertical bars) or bar charts (horizontal bars) are useful for
breaking down numeric variables by categories. The example to the right is
typical, where each bar shows the sales for some region. If you have two or
more series, such as Q1 Sales, Q2 Sales, and so on, you can try any of the 2-D
types. However, we don't recommend the 3-D types. Granted, the latter are
fancier, but they often obscure the data. In general, we recommend keeping it
simple (and this goes for the other chart types discussed below as well).
Line Charts

Line charts are especially useful for time series data. The example to the right
shows how monthly sales have changed during a given year. We particularly
like the line chart with markers (the fourth option in the top row), although
you can experiment with the many different options.

Pie Charts

Pie charts are ubiquitous, appearing in magazines, newspapers, and all over
the Web. They play the same roll as column or bar charts for breaking down
data by categories. However, we prefer column or bar charts to any of these
"circular" charts. It is sometimes hard to accurately gauge the relationships
between the various pieces of the pie. For example, is one piece twice as
large as another; three times as large; or what? These comparisons are more
obvious in a column or bar chart.

Scatter Charts and Bubble Charts

Scatter charts are used to examine the relationship (if any) between two
columns of data. The example to the right lists the amount spent on culture
and the amount spent on sports for a sample of families. The scatter chart
indicates a negative relationship between these two variables.

A special type of scatter chart, a bubble chart, allows you to add a third
dimension. The bubble chart to the right sizes each bubble in proportion to
the family's salary. To create it, you can start with a regular scatter chart,
then change it to a bubble chart, click the Select Data from the Chart Tools
Design ribbon, and enter the range for the bubble sizes.
Histograms and Box-Whisker Charts (introduced in Excel 2016)
A histogram is a special type of column chart for showing the distribution
of data. The data are first "binned," that is, separated into categories,
and then the histogram shows the count (or percentage) of values in
each bin. The Excel histograms use automatic bins, depending on the
number of data values, but you can right-click the horizontal axis values,
select Format Axis, and modify the bins in a number of ways. For the
salary data to the right, four bins were chosen automatically, with the
limits shown on the horizontal axis. Regardless of the exact bins chosen,
however, the histogram shows that salaries are skewed to the right.

Box and Whisker charts are useful for comparing the distributions of
some variable across two or more groups. The example to the right
compares salaries of males and females. The height of each box extends
from the first to the third quartiles (the middle half of the data), the line
inside the box is the median, the x inside the box is the mean, and the
lines from the box indicate the lows and highs of the data. (More precise
definitions can be found in statistics books.) This particular chart clearly
indicates that male salaries tend to be higher and more spread out than
female salaries.

A special type of histogram is the Pareto chart (the second button in the
top row of options). It is useful for showing the number, and cumulative
number, of "events" from different causes. The example below and to
the right shows the number of failures from various causes. The bars in a
Pareto chart always decrease from left to the right, so that the most
likely causes are to the left.
Hierarchy Charts (introduced in Excel 2016)

The two chart types in this category, Treemap charts and Sunburst charts, are
used to break down a numeric variable by categorical variables. The example
to the right breaks down average salary by gender and state. You can use
these "fancy" charts if you like, but we prefer simpler charts such as column
charts to show the comparisons.

Waterfall Charts (introduced in Excel 2016)

A waterfall chart is useful for showing changes, usually over time, from some
initial value. The example to the right shows how a company's monthly cash
balances have changed over the year, starting with a balance of $50,000.

This group also includes stock charts, which are useful for showing the
Waterfall Charts (introduced in Excel 2016)

A waterfall chart is useful for showing changes, usually over time, from some
initial value. The example to the right shows how a company's monthly cash
balances have changed over the year, starting with a balance of $50,000.

This group also includes stock charts, which are useful for showing the
movement of stock prices over time.

Combo Charts
A combo chart lets you graph two or more series with different chart types.
The example to the right, using the default options for the first combo chart
type, uses a column chart for 2015 sales and a line chart for 2016 sales. Of
course, you can then change either of these chart types.

Surface and Radar Charts

You can try these chart types if you like, but we don't recommend them. If
your goal is to explain the data in the clearest possible way -- and this should
be your goal! -- then some other chart type is almost surely a better option.
Region Sales
North $50,000 Sales
South $90,000 $100,000
$90,000
East $30,000 $80,000
West $80,000 $70,000
$60,000
$50,000
$40,000
$30,000
$20,000
$10,000
$0
North South East We

Sales
West

East

South

North

$0 0 0 0 0 0 0
00 00 00 00 00 00 0
10, 20, 30, 40, 50, 60, 0,
$ $ $ $ $ $ $7
South

North

$0 00
0
00
0
00
0
00
0
00
0
00
0
0
10, 20, 30, 40, 50, 60, 0,
$ $ $ $ $ $ $7

Month Sales
Jan $80,000 Sales
Feb $70,000 $200,000
Mar $90,000 $180,000
$160,000
Apr $120,000
$140,000
May $140,000 $120,000
Jun $160,000 $100,000
Jul $180,000 $80,000
Aug $190,000 $60,000
$40,000
Sep $130,000
$20,000
Oct $110,000 $0
Nov $70,000 Ja n Feb Mar Apr May Jun Jul Aug
Dec $60,000

Region Sales
North $50,000 Sales
South $90,000
East $30,000
West $80,000

North South Ea st We st

Culture Sports
$1,020 $990 Expenses on Sports Vs Expenses on Cu
$1,100 $460 $2,000
$900 $780 $1,800
$1,000 $860 $1,600
$900 $1,390 $1,400
$820 $1,880 $1,200
$1,000
$1,340 $710
$800
$1,250 $680
$600
$1,190 $1,220
$400
$640 $1,480
$200
$900 $820 $0
$710 $1,080 $600 $700 $800 $900 $1,000 $1,100 $1,200 $1,30

Salary Culture Sports


Expenses on Sports Vs Expenses on Culture (Bubble size
$2,000
$1,800
$1,600
$54,600 $1,020 $990
Expenses on Sports Vs Expenses on Culture (Bubble size
$57,500 $1,100 $460 $2,000

$53,300 $900 $780 $1,800


$1,600
$43,500 $1,000 $860
$1,400
$127,200 $900 $1,390
$1,200
$163,400 $820 $1,880
$1,000
$58,500 $1,340 $710
$800
$45,600 $1,250 $680
$600
$261,300 $1,190 $1,220
$400
$61,100 $640 $1,480 $200
$77,200 $900 $820 $0
$108,800 $710 $1,080 $0 $200 $400 $600 $800 $1,000 $1,200 $1,400

Gender Salary This chart isn't available in your version of Excel.


Male $137,500
Male $100,900 Editing this shape or saving this workbook into a diffe
permanently break the chart.
Male $122,600
Female $83,700
Male $85,000
Male $91,100
Male $114,000
Female $85,800
Female $77,200
Male $113,800
Female $83,600
Female $78,800
Female $93,500
Male $109,800 This chart isn't available in your version of Excel.
Female $57,100
Female $78,700 Editing this shape or saving this workbook into a diffe
permanently break the chart.
Female $61,500
Female $78,400
Male $125,900
Male $83,900
Female $75,100
Male $61,400
Female $80,700
Female $70,300
Female $82,200
Male $100,200
Male $135,900
Female $68,500
Female $76,600
Male $114,600
Male $84,300
Cause # Failures This chart isn't available in your version of Excel.
Address is Illegi 25
Address is Inval 24 Editing this shape or saving this workbook into a diffe
permanently break the chart.
Contains Illegal 2
Insufficient Pos 55
Returned by Rec 12
Unable to Deliv 6

Gender State Avg Salary This chart isn't available in your version of Excel.
Female California $81,400
Female Indiana $62,000 Editing this shape or saving this workbook into a diffe
permanently break the chart.
Female Pennsylvania $59,900
Male California $97,500
Male Indiana $45,200
Male Pennsylvania $45,900

This chart isn't available in your version of Excel.

Editing this shape or saving this workbook into a diffe


permanently break the chart.

Start $50,000 This chart isn't available in your version of Excel.


Jan $13,100
Editing this shape or saving this workbook into a diffe
permanently break the chart.
This chart isn't available in your version of Excel.

Feb $7,000 Editing this shape or saving this workbook into a diffe
permanently break the chart.
Mar $9,300
Apr $7,000
May $5,900
Jun $2,400
Jul $6,500
Aug $8,000
Sep $9,700
Oct $6,700
Nov $11,900
Dec $6,700
End

Month Sales 2015 Sales 2016


Jan $80,000 $81,000 Monthly Sales
Feb $70,000 $57,000 $250,000
Mar $90,000 $91,000
$200,000
Apr $120,000 $106,000
May $140,000 $139,000 $150,000
Jun $160,000 $141,000
$100,000
Jul $180,000 $199,000
Aug $190,000 $205,000 $50,000
Sep $130,000 $124,000
$0
Oct $110,000 $114,000 Jan Feb Mar Apr May Jun Jul Aug Se
Nov $70,000 $76,000 Sal es 2015 Sal es 2016
Dec $60,000 $58,000
ales

h East West

Sales

0 0 0 0 0 0 0
00 00 00 00 00 00 00
40, 50, 60, 70, 80, 90, 00,
$ $ $ $ $ $ $1
0 0 0 0 0 0 0
00 00 00 00 00 00 00
40, 50, 60, 70, 80, 90, 00,
$ $ $ $ $ $ $1

Sales

May Jun Jul Aug Sep Oct Nov Dec

Ea st We st

Vs Expenses on Culture

$1,000 $1,100 $1,200 $1,300 $1,400

es on Culture (Bubble size for Salary)


es on Culture (Bubble size for Salary)

$800 $1,000 $1,200 $1,400 $1,600

our version of Excel.

his workbook into a different file format will

our version of Excel.

his workbook into a different file format will


our version of Excel.

his workbook into a different file format will

our version of Excel.

his workbook into a different file format will

our version of Excel.

his workbook into a different file format will

our version of Excel.

his workbook into a different file format will


our version of Excel.

his workbook into a different file format will

Monthly Sales

May Jun Jul Aug Sep Oct Nov Dec


es 2015 Sal es 2016
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Sales1
Modifying an Existing Chart $8,627
$5,343
Once you create a chart and ensure that it charts the correct series, you $6,244
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, $9,451
but certainly not all, of the changes you can make: $6,698
$6,752
1. Add, delete, or change the chart title.
2. Add, delete, or change the axis titles. $5,985
3. Add, delete, or move the legend. $5,586
4. Change the scale, font, alignment, or number format of the axis labels.
5. Add, delete, or change the gridlines. For example, you might want to $8,476
make them lighter or darker. $9,191
6. Change the background color of the plot area, the inner part of the $7,242
chart.
7. Add data labels to points on the chart. $8,277

To make these or other changes, you can use the buttons on the Chart
Tools ribbons, or you can right-click the part of the chart you want to
change to get a context-sensitive menu. From there, it is a matter of
experimenting. It would be a waste of your time to read about all of the
possibilities. Your time would be better spent trying things, as in the
following exercise.

Try it! The top chart to the right was created by selecting the gray data
range to the right and inserting a scatter chart of the first subtype. Then
it was modified to produce the bottom chart. Repeat this exercise by
creating the default scatter chart and then modifying it to look like the
finished version.

If you have trouble, particularly with the March data label, watch the
corresponding video of this topic. Note that this was done in Excel 2013,
where the user interface is different from previous versions of Excel.

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.
The best advice is: Make sure it looks professional, make sure it tells the
intended story clearly, and keep it simple! Usually, simple and
uncluttered charts look best and tell the story best.
Sales2
$23,919 Sales2
$19,507 $40,000
$34,377
$35,000
$30,285
$19,673 $30,000

$21,007 $25,000
$16,644
$20,000
$21,022
$23,928 $15,000

$31,403 $10,000
$25,333
$5,000
$28,071
$0
$5,000 $5,500 $6,000 $6,500 $7,000 $7,500 $8,000 $8,500 $9,000 $9,500 $10,000

Sales of Product 2 versus Sales of Product 1


$40,000

$35,000
Product 2 ($1000s)

$30,000

$25,000

$20,000

$15,000
00 00 00 00 00 00 00 00 00 00 00
0
,0 ,5 ,0 ,5 ,0 ,5 ,0 ,5 ,0 ,5 0,
$5 $5 $6 $6 $7 $7 $8 $8 $9 $9 $1

Product 1 ($1000s)
March
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Month
Changing the Location of a Chart Jan-13
Feb-13
A chart can be placed in one of two locations: on a worksheet, usually the
worksheet that contains the data the chart is based on, or on a separate Mar-13
chart sheet, a sheet that has no rows or columns, only a chart. Some Apr-13
people prefer the first option, and others prefer the second. It is totally a May-13
matter of taste. When you create a chart from the Insert ribbon, the chart
is placed on the worksheet with the data by default. However, it is easy to Jun-13
move it. Jul-13
Aug-13
To change the location of a chart:
Sep-13
Select the chart and click the Move Chart button on the Chart Tools Oct-13
Design ribbon (see below). You can then choose from the above two Nov-13
options.
Dec-13
Try it! Create a chart on this worksheet using the data to the right and
then move this chart to a separate chart sheet. (This chart sheet will have
a name like Chart1, but you can rename it.) Then move the chart back to
this worksheet. Note that when you move the chart back to this
worksheet, the chart sheet will disappear.

Move Chart button on Chart Tools Design ribbon

Month
Overlapping Charts Jan-13
Feb-13
Some users like to create several charts on the same worksheet and
cascade them, as shown to the right. The problem with this is that only the Mar-13
"front" chart is totally visible. To see all of the charts, you have three Apr-13
options. May-13
1. You can bring one to the front or send one to the back. To do so, right- Jun-13
click either chart and select Send to Front or Send to Back. Note that it Jul-13
isnt enough to select the one in the back. For example, if you select the
Revenue 1 chart to the right, you still won't see it. Aug-13
Sep-13
2. You can move them around so they dont overlap. Oct-13
3. You can move each chart to its own chart sheet, as explained in the text Nov-13
box above. Dec-13

Try it! Use each of these three methods on the two charts to the right.
Finish by putting them back to the cascading positions you currently see.
2. You can move them around so they dont overlap.

3. You can move each chart to its own chart sheet, as explained in the text
box above.

Try it! Use each of these three methods on the two charts to the right.
Finish by putting them back to the cascading positions you currently see.
Sales
$8,627
$5,343
$6,244
$9,451
$6,698
$6,752
$5,985
$5,586
$8,476
$9,191
$7,242
$8,277

Revenue1 Revenue2
$8,627 $268,994 Revenue1
$5,343 $289,135 $10,000
$6,244 $159,351 $9,000
$9,451 $383,878 $8,000 Revenue2
$6,698 $355,345 $7,000 $600,000
$6,752 $444,653 $6,000
$5,985 $110,768 $5,000 $500,000
$5,586 $476,350 $4,000
$400,000
$8,476 $239,177 $3,000
$9,191 $121,368 $2,000 $300,000
$7,242 $472,650
$1,000
$8,277 $332,115 $200,000
$0
Jan-13 Mar-13 May-13 Jul -13 Sep-13 Nov-13
$100,000

$0
Jan-13 Mar-13 May-13 Jul -13 Sep-13 Nov-13
$400,000
$3,000
$2,000 $300,000
$1,000
$0 $200,000
Jan-13 Mar-13 May-13 Jul -13 Sep-13 Nov-13
$100,000

$0
Jan-13 Mar-13 May-13 Jul -13 Sep-13 Nov-13
Nov-13

Sep-13 Nov-13
Nov-13

Sep-13 Nov-13
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Function categories on For


Introduction to Excel Functions

Most of the formulas you create in Excel include one or more built-in
Excel functions, such as SUM, IF, VLOOKUP, and many others. Probably no
one, not even the developers at Microsoft, is familiar with all of the Excel
functions, but you should strive to learn, or at least be aware of, as many
as you can.

Excel's functions are grouped into categories, including Financial, Math &
Trig, Date & Time, and others. You can see these categories in the
Function Library group on the Formulas ribbon (see to the right). The
topics in this group of the tutorial illustrate some of the more useful
Excel functions in the various categories.

The names of these functions are capitalized in this tutorial, but this is
only for emphasis. They are not case sensitive. You can enter SUM or Bob
sum or even sUM, all with the same result. 10
5
Some functions are so useful that Excel automatically applies them to
selected ranges (when at least two cells are selected). The results are 13
displayed in the status bar at the bottom of the screen. If you right-click 2
any blank space on the status bar, you can check the functions you want 9
to be visible.
18
Try it! Select any parts of the data to the right (even discontigous ranges) 18
and look at the status bar. Then right-click the status bar and select more
options if you want them. 2
18
Function categories on Formulas ribbon

Mary Jack
6 5
11 7
10 6
15 19
5 20
16 19
15 1
19 10
14 6
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Finding Help for Excel Functions

If you havent used the fx (Insert Function) button located just to the left
of the formula bar, you should give it a try. 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 can proceed as follows.

To use the fx button:

Select a blank cell where you want to enter the formula. Click the fx
button and select 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 by clicking the "Help on this
function" link, or you can click the OK button and enter the appropriate
arguments for the function: interest rate, term, and principal, the latter
expressed as a negative number. (See screenshots to the right.)

Some people use the fx button as a "crutch" every time they want to
enter an Excel function. You probably shouldn't do this for functions you
know well because it takes more time. However, it is great for learning
how to use functions you are less familiar with.

Try it! Use the fx button to help you determine the function in the gray
cell to the right. (Scroll to the right for the solution.)

You can get the same help from the categories buttons on the Formulas
ribbon. You can scan the list for any category very quickly. In fact, this is a
good way to expand your repertoire of Excel functions. Just look at any of
the lists and ask for help on any that look interesting.

As a final note, the autocomplete feature provides automatic help as you


type functions. For example, if you type =SUMP, Excel shows you all
functions that start with SUMP. In this case, there is only one,
SUMPRODUCT, so if you press the Tab key, you automatically get
=SUMPRODUCT(, and it shows you the arguments this function expects.
Of course, you will memorize the functions you use most frequently, but
with this autocomplete feature and the other features described above,
there is really no need to memorize functions.
List of Topics sheet

Insert Function dialog box Help entering the formula

Monthly car payment model


Amount financed $15,000
Annual interest rate 8.90%
Term (number of months financed) 36
Monthly payment
Payment $476.30

Notethat
Note that the
the PMT
PMT function
functionisis in
in the
the financial
financial
category.In
category. In general,
general, itithas
hasfive
five arguments,
arguments, butbut
thelast
the last two
two are
are optional
optional and
andaren't
aren'tneeded
needed
here. There
here. Thereisis aa minus
minussignsignnext
next toto Principal
Principal
becauseititisispaid,
because paid, not
not received.
received.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

SUM function (Math & Trig Category)

The SUM function is probably the most used Excel function of all. It sums
all values in one or more ranges.

To use the SUM function: Table of costs for units pro


for use in another month (
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, Jan
separated by commas. (This can also be done with the COUNT, COUNTA, Feb
AVERAGE, PROLDUCT, MAX, and MIN functions, among others.) For Mar
example, =SUM(B5,C10:D12,Revenues) is allowable, where Revenues is
a range name. The result is the sum of the numeric values in all of these Apr
ranges combined. Again, if any cells in any of these ranges are
nonnumeric or blank, they are ignored. Total cost
Here is a shortcut, which works for any function that takes multiple
ranges, separated by commas. Hold the Ctrl key and then drag the
ranges, one after the other. The commas will be entered for you
automatically.

Try it! Use the SUM function in the above gray cell to calculate the total
of all costs. (Scroll to the right for the answer.)

Student ID
AVERAGE function (Statistical Category) 1533
8031
The AVERAGE function averages all of the numeric cells in a range.
9859
To use the AVERAGE function: 9106
3535
Enter the formula =AVERAGE(range) where range is any range. This
produces the average of the numeric values in the range. 8192
6102
Note that the AVERAGE function ignores labels and blank cells. So, for 6774
example, if the range C3:C50 includes scores for students on an exam, but
cells C6 and C32 are blank because these students havent yet taken the 7558
exam, then =AVERAGE(C3:C50) averages only the scores for the students 314
who took the exam. (It does not automatically average in 0s for the two
who didnt take the exam.) 9082
2397
Try it! Use the AVERAGE function in the two gray cells to the right to 2517
calculate the averages indicated. (For the formula in the lower gray cell,
replicate the exam scores in column M and make some changes. Scroll to 2432
the right for the answers.) 6016
Try it! Use the AVERAGE function in the two gray cells to the right to
calculate the averages indicated. (For the formula in the lower gray cell,
replicate the exam scores in column M and make some changes. Scroll to
the right for the answers.)
5269
4847
6537
9922
4525
1491
7897
PRODUCT function (Math & Trig Category)
4088
You certainly know the SUM function for summing, but you might not be 166
aware that there is a PRODUCT function for multiplying. It works exactly like 7925
the SUM function, that is, all of its arguments are multiplied together. Any
blank or text cells are ignored in the product. Specifically, they are not treated 6405
as 0s. 802
2931
Try it! Find the product of the first six exam scores to the right, including the
Absent value. Then delete the Absent value, that is, make its cell blank. Does 7625
this change the product? 2628
5417
7804
3994
394
8847
7855
8668
3738
5534
6965
8863
8762
6466
6100
1878
5970
9691
8666
4865
6198
8554
6753
9574
3891
8186
1306
6835
3136
4938
4807
4421
able of costs for units produced in one month (along side)
or use in another month (along top)

Feb Mar Apr May


$5,800 $3,600 $5,400 $5,700
$4,000 $3,500 $6,100
$3,000 $6,100
$4,300

Exam score Average (only for students who took the exam)
68
74
80 Average (giving 0s to students who were absent)
63
72
Absent
85
70
64
72
81
75
80
73
63
80
88
71
73
71
71
68 Product
82
76
75
81
76
83
67
67
92
72
69
85
78
81
Absent
77
70
71
69
73
60
76
74
67
62
77
91
81
87
76
77
81
Absent
73
83
59
74
74
78
Total cost $47,500

Student ID
1533
8031
9859
9106
3535
8192
6102
6774
7558
314
9082
2397
2517
2432
6016
5269
4847
6537
9922
4525
1491
7897
4088
166
7925
6405
802
2931
7625
2628
5417
7804
3994
394
8847
7855
8668
3738
5534
6965
8863
8762
6466
6100
1878
5970
9691
8666
4865
6198
8554
6753
9574
3891
8186
1306
6835
3136
4938
4807
4421
Exam score With 0s Average (only for students who took the exam)
68 68 74.7586207
74 74
80 80 Average (giving 0s to students who were absent)
63 63 71.0819672
72 72
Absent 0
85 85
70 70
64 64
72 72
81 81
75 75
80 80
73 73
63 63
80 80
88 88
71 71
73 73
71 71
71 71
68 68 Product
82 82 1826012160
76 76
75 75
81 81
76 76
83 83
67 67
67 67
92 92
72 72
69 69
85 85
78 78
81 81
Absent 0
77 77
70 70
71 71
69 69
73 73
60 60
76 76
74 74
67 67
62 62
77 77
91 91
81 81
87 87
76 76
77 77
81 81
Absent 0
73 73
83 83
59 59
74 74
74 74
78 78
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

COUNT, COUNTA, COUNTBLANK Functions (Statistical Category)

The COUNT function counts all of the cells in a range with numeric
values. The COUNTA function counts all nonblank cells in a 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. Student
1
To use the COUNT function:
2
Enter the formula =COUNT(range), where range is any range. This 3
returns the number of numeric values in the range.
4
To use the COUNTA function: 5
6
Enter the formula =COUNTA(range), where range is any range. This
returns the number of nonblank cells in the range. 7
8
The COUNTBLANK function counts all blank cells in a range. 9
To use the COUNTBLANK function: 10
11
Enter the formula =COUNTBLANK(range), where range is any range. This 12
returns the number of blank cells in the range.
13
Try it! Use the COUNT, COUNTA, and COUNTBLANK functions to fill in the 14
gray cells to the right. (Scroll to the right for the answers.)
15
Note: Excel uses somewhat different terms on the status bar. If you 16
select a range and right-click the status bar, you will see the two options 17
"Count" and "Numerical Count." The first corresponds to the COUNTA
function, and the second corresponds to the COUNT function. 18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Exam score Number enrolled
62
73
74 Number who took exam

77
57 Number who were absent
67
90
77
83
71
75
72
82
68
86
77
68
86

80
81
84
71
76
81
99
72
78
67
89
70
77

83
74
87
75
86
77
73
74
79
80
77
72
77
71
70
68
79
75
80
73
61
62
68
92
85
77
79
86
83
83
76
89
72
69
66
71
80
61
Number enrolled
72 or

Number who took exam


69 or

Number who were absent


3
72

who took exam


69

who were absent


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Background on ...IF Functions

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
customer demand, Microsoft added four new functions in Excel 2007: Student
AVERAGEIF (for a single condition), and COUNTIFS, SUMIFS, and AVERAGEIFS 1
(for multiple conditions). These are all handy functions, and you should learn
how to use them. 2
3
4
5
6
7
COUNTIF Function (Statistical Category) 8
9
The COUNTIF function counts all values in a specified range that satisfy a 10
certain condition.
11
To use the COUNTIF function: 12
13
Enter the formula =COUNTIF(criterion_range,criterion) in any cell, where
criterion is any expression that evaluates to TRUE or FALSE. This counts 14
all values in criterion_range that satisfy the condition. 15
The criterion can be tricky to specify. If you want a specific value, such as 16
Male, you can specify it as "Male" (double quotes required), or you can 17
use a cell reference such as Q8. Also, if you want a specific inequality, 18
such as younger than 20, you can specify it literally as "<20" (again,
double quotes required). But if you want it to be younger than the value 19
in cell Q9, you need to piece it together as a literal part, "<", and a 20
variable part, whatever is in cell Q9. The correct syntax is "<"&Q9. The 21
ampersand (&) symbol concatenates (pieces together) the two parts. For
example, if you want to count the number of students who are older 22
than then the value in cell Q9, the correct formula is 23
=COUNTIF(M9:M80,">"&Q9). 24
Try it! Use COUNTIF in the top gray cell to the right to find the number of 25
students who scored at least as high as the value in cell Q10. (Scroll to 26
the right for the answer.)
27
28
29
30
31
32
33
34
35
SUMIF Function (Math & Trig Category) 36
37
The SUMIF function sums values in one range where a condition in a
corresponding range is satisfied. Usually, the setup is like the example to
the right, where you want to sum or average scores in one column (N), but
only for rows that satisfy a condition in another column (L or M).

To use the SUMIF function:


SUMIF Function (Math & Trig Category)

The SUMIF function sums values in one range where a condition in a


corresponding range is satisfied. Usually, the setup is like the example to 38
the right, where you want to sum or average scores in one column (N), but 39
only for rows that satisfy a condition in another column (L or M).
40
To use the SUMIF function: 41
42
Enter the formula =SUMIF(criterion_range,criterion,sum_range). This
sums all values in sum_range where the corresponding value in 43
criterion_range satisfies the criterion. Note that the range for the condition 44
is listed first, and the range to be summed is listed last. 45
Try it! Calculate the sums indicated in rows 14-16 to the right. (Scroll to the 46
right for the answers.) 47
48
49
50
51
52
53
54
AVERAGEIF Function (Statistical Category)
55
The AVERAGEIF function works just like the SUMIF function, except that it 56
averages the values in the last argument range, the average_range. 57
Try it! Calculate the averages indicated in rows 18-20 to the right. (Scroll to the 58
right for the answers.) 59
60
61
62
63
64
65
66
67
68
69
70
71
72
Gender Age Exam score Gender condition Male
Male 18 62 Age cutoff 20
Female 21 73 Exam score cutoff 87
Female 18 74
Female 18 # of "high" scores
Male 18 77
Female 20 57 Sum of scores for males
Female 18 67 Sum of scores for "young" people
Male 19 90 Sum of scores for "old" people
Male 19 77
Male 22 83 Average of scores for males
Female 20 71 Average of scores for "young" people
Female 20 75 Average of scores for "old" people
Female 20 72
Female 24 82
Female 18 68
Male 18 86
Female 24 77
Male 21 68
Male 20 86
Female 21
Male 20 80
Female 18 81
Male 20 84
Female 19 71
Female 18 76
Male 21 81
Female 18 99
Male 20 72
Female 18 78
Female 21 67
Female 21 89
Female 19 70
Female 19 77
Female 18
Male 22 83
Female 19 74
Male 19 87
Male 18 75
Male 20 86
Male 21 77
Male 20 73
Male 20 74
Female 20 79
Male 18 80
Male 20 77
Female 21 72
Male 19 77
Male 19 71
Female 23 70
Female 19 68
Female 24 79
Male 19 75
Male 18 80
Female 19 73
Female 21 61
Female 21 62
Male 19 68
Male 19 92
Female 20 85
Male 22 77
Female 19 79
Male 20 86
Female 19 83
Male 19 83
Male 18 76
Female 24 89
Female 18 72
Female 21 69
Male 23 66
Male 24 71
Male 20 80
Female 18 61
# of "high" scores 6

Sum of scores for males 2660


Sum of scores for "young" people 2527
Sum of scores for "old" people 2733

Average of scores for males 78.235


Average of scores for "young" people 76.576
Average of scores for "old" people 75.917
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Background on ...IFS Functions

The "plural" functions discussed here, COUNTIFS, SUMIFS, and AVERAGEIFS, were added in
Excel 2007. They allow you to impose multiple conditions, such as male and younger than
some value. Their arguments, described in more detail below, include any number of pairs of
criterion ranges and criteria, such as L9:L80,"Male".

COUNTIFS Functions (Statistical Category)

The COUNTIFS function counts the number of rows that satisfy all of the conditions.
To use the COUNTIFS function:

Enter the function


=COUNTIFS(criterion_range1,criterion1,criterion_range2,criterion2,...), where each
criterion_range,criterion pair imposes a condition on a particular range, usually a column.
The "..." means that any number of criteria can be imposed.

Try it! In the top gray cell to the right, find the number of students with the gender in cell
Q8 and age younger than the age cutoff in cell Q9 who scored less than or equal to the
score cutoff in cell Q10. (Scroll to the right for the answer.)

SUMIFS Function (Math & Trig Category)

The SUMIFS function is similar in concept to SUMIF, but its syntax is different. (Microsoft
chose this syntax instead of the original SUMIF syntax for logical reasons, but they didn't
want to change the SUMIF syntax because it would have broken too many existing
spreadsheets.) Now the range to sum comes first, and the criteria ranges and criteria
come last.

To use the SUMIFS function:

Enter the formula

=SUMIFS(sum_range,criterion_range1,criterion1,criterion_range2,criterion2,...)

Again, the setup is typically like the example to the right. There is a column such as
exam score to sum. 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.

Try it! In the middle gray cell to the right, calculate the total of all scores made by the
gender in cell Q8 and ages younger than the age cutoff in cell Q9. (Scroll to the right for
the answer.)
Try it! In the middle gray cell to the right, calculate the total of all scores made by the
gender in cell Q8 and ages younger than the age cutoff in cell Q9. (Scroll to the right for
the answer.)

AVERAGEIFS Function (Statistical Category)

The AVERAGEIFS function works just like the SUMIFS function, except that it averages the
values in the the average_range argument.

Try it! Calculate the average in the bottom gray cell to the right, using the same criteria as in
the SUMIFS exercise above. (Scroll to the right for the answer.)
Return to List of Topics sheet

ded in
than
f pairs of

Student Gender Age Exam score Gender condition Female


1 Male 18 62 Age cutoff 20
2 Female 21 73 Exam score cutoff 87
3 Female 18 1
4 Female 18 65 COUNTIFS question
5 Male 18 77
. 6 Female 20 57 SUMIFS question
7 Female 18 67 AVERAGEIFS question
8 Male 19 90
9 Male 19 77
h 10 Male 22 83
olumn. 11 Female 20 71
12 Female 20 75
in cell 13 Female 20 72
the
14 Female 24 82
15 Female 18 68
16 Male 18 86
17 Female 24 77
18 Male 21 68
19 Male 20 86
20 Female 21 89
21 Male 20 80
22 Female 18 81
rosoft
didn't 23 Male 20 84
24 Female 19 71
ria 25 Female 18 76
26 Male 21 81
27 Female 18 99
28 Male 20 72
29 Female 18 78
30 Female 21 67
31 Female 21 89
s
same 32 Female 19 70
33 Female 19 77
the 34 Female 18 79
ht for 35 Male 22 83
36 Female 19 74
37 Male 19 87
the
ht for

38 Male 18 75
39 Male 20 86
40 Male 21 77
41 Male 20 73
42 Male 20 74
43 Female 20 79
44 Male 18 80
s the 45 Male 20 77
46 Female 21 72
ria as in 47 Male 19 77
48 Male 19 71
49 Female 23 70
50 Female 19 68
51 Female 24 79
52 Male 19 75
53 Male 18 80
54 Female 19 73
55 Female 21 61
56 Female 21 62
57 Male 19 68
58 Male 19 92
59 Female 20 85
60 Male 22 77
61 Female 19 79
62 Male 20 86
63 Female 19 83
64 Male 19 83
65 Male 18 76
66 Female 24 89
67 Female 18 72
68 Female 21 69
69 Male 23 66
70 Male 24 71
71 Male 20 80
72 Female 18 61
COUNTIFS question 18

SUMIFS question 1342


AVERAGEIFS question 70.632
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

SUMPRODUCT Function (Math & Trig Category)

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 in the gray cell. (Scroll to the right for the
answer.)

By the way, if you are tempted to write the formula without the
SUMPRODUCT function as the sum of nine products, as many beginning
users tend 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.
List of Topics sheet

Unit shipping costs City1 City2 City3


Plant1 1.25 1.35 1.55
Plant2 1.15 1.45 1.25
Plant3 1.35 1.45 1.15

Units shipped City1 City2 City3


Plant1 155 180 0
Plant2 250 130 185
Plant3 0 210 140

Total cost
Total cost 1609.5
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Basic IF Function (Logical Category)

IF functions are very useful for performing logic, and they vary from simple
to complex. A few typical examples are illustrated here. For each product, if the en
enough units are ordered t
To enter a basic IF function:
units of that product are o
Enter the formula =IF(condition,expression1,expression2), where condition
is any condition that is either true or false, expression1 is the value of the Product
formula if the condition is true, and expression2 is the value of the formula
if the condition is false. 1
2
A simple example is =IF(A1<5,10,NA). Note that if either of the 3
expressions is text, as opposed to a numeric value, it should be enclosed in
double quotes. 4

Try it! Enter appropriate IF formulas in columns M and N. (Scroll to the


right for answers.)

Each student gets an A (if s


Nested IF Functions is 60 or above but less tha

Sometimes IF functions are nested. For example, there might be three


possibilities, depending on whether the value in cell A1 is negative, zero, Student
or positive. A nested IF formula can then be used as follows. 1
2
To use nested IF functions:
3
Enter the formula 4
=IF(condition1,expression1,IF(condition2,expression2,expression3)). If 5
condition1 is true, the relevant value is expression1. Otherwise, condition2
is checked. If it is true, the relevant value is expression2. Otherwise, the 6
relevant value is expression3.

An example is =IF(A1<0,10,IF(A1=0,20,30)). Suppose this formula is


entered in cell B2. Then if A1 contains a negative number, B2 contains 10.
Otherwise, if A1 contains 0, B2 contains 20. Otherwise, meaning that A1
must contain a positive value, B2 contains 30.

Try it! Use a nested IF function to get the grades in column M. (Scroll to
the right for answers.)

IF Functions with Logical AND or OR Conditions

Sometimes more complex AND or OR conditions are required in IF


Investor sells stock only if i
IF Functions with Logical AND or OR Conditions (including the current day)

Sometimes more complex AND or OR conditions are required in IF Day


functions. They are not difficult once you know the syntax.
1
To use an AND condition in an IF function: 2
3
Enter the formula
=IF(AND(condition1,condition2),expression1,expression2). This results in 4
expression1 if both condition1 and condition2 are true. Otherwise, it 5
results in expression2.
6
Note the syntax. The keyword AND is followed by the conditions,
separated by a comma and enclosed within parentheses. Also, note that
any number of conditions, not just two, can be included in the AND, all
separated by commas.

Try it! Use an IF function with an AND condition to fill in the gray range
for selling to the right. Make sure you use double quotes for text. (Scroll
to the right for answers.) Any student who scores at
which is 1% of their total s
To use an OR condition in an IF function:

Enter the formula Student


=IF(OR(condition1,condition2),expression1,expression2). This results in 1
expression1 if either condition1 or condition2 is true (or if both are true).
Otherwise, it results in expression2. 2
3
Again, any number of conditions, not just two, can be included in the OR. 4
Try it! Use an IF function with an OR condition to fill in the bonuses in 5
column P. (Scroll to the right for answers.) 6
You can even have AND and OR conditions in the same formula. A typical
example is =IF(OR(AND(B3>=10,C3>=15),D3<50),1000,2000). For
example, if cells B3, C3, and D3 have values 12, 10, and 40, this returns
1000 because the second condition (D3<50) is true, even though the
AND condition is false.

The key to writing (and reading) such complex formulas is to pay careful
attention to the parentheses. Fortunately, Excel helps you by color-
coding pairs of parentheses. From now on, pay close attention to this
color coding. You will come to depend on it!
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

End inventory Order placed (yes or no)? # of units ordered


100
40
20
70

Each student gets an A (if score is 90 or above), S for satisfactory (if score
is 60 or above but less than 90) or U for unsatisfactory if score is below 60

Score Grade
70
95
55
80
60
90
Investor sells stock only if its price has gone up three consecutive days
(including the current day)

Price change Sell (yes or no)?


Up
Down
Up
Up
Up
Down

Any student who scores at least 95 on any of the exams gets a bonus
which is 1% of their total score.

Exam 1 Exam 2 Exam 3 Exam 4 Bonus


87 83 83 80
77 72 74 97
80 95 79 75
82 87 96 88
78 94 81 79
75 83 80 72
Order placed? # ordered
no 0
yes 160
yes 180
no 0

Grade
S
A
U
S
S
A
Sell?

No
No
Yes
No

Bonus
0
3.2
3.29
3.53
0
0
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Lookup Tables and VLOOKUP Function (Lookup & Reference Category)

Lookup tables are useful when you want to compare a particular value to
a set of values, and depending on where your value falls, return the
appropriate result. For example, you might have a tax table that shows,
for any 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, only the VLOOKUP function is discussed here. Besides,
VLOOKUP is 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 always in the left
column
3. The column number of the lookup table where you find the answer
4. TRUE or FALSE (which is TRUE by default if omitted)
That is, the general syntax is:

=VLOOKUP(value,lookup_table,column #,TRUE or FALSE)

The optional fourth argument requires some explanation. The default


value, TRUE, indicates that you are looking for an approximate match;
you don't necessarily expect to find your exact lookup value in the
lookup table. In this case, the first column of the lookup table must be in
ascending order. However, if the fourth argument is FALSE, this indicates
that you are looking for an exact match in the first column of the lookup
table. In this case, it doesn't matter whether the first column is in
ascending order or not. However, the function will return an error if no
exact match can be found.

Because the VLOOKUP function is often copied down a column, it is


usually necessary to make the second argument an absolute reference.
The easiest way to do this is to give the lookup table a range name such
as LookupTable, because range names are always treated as absolute
references. However, a range name is not absolutely necessary.

Student
Looking Up a Value in a Range (an Approximate Match) 1
2
The most common use of a lookup table is when you want to see where 3
a value fits in a range of values. Then the fourth argument can then be
omitted because its default value is TRUE. For example, suppose 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 lookup table to
the right (columns O and P) shows how you would set this up. The
Looking Up a Value in a Range (an Approximate Match)

The most common use of a lookup table is when you want to see where
a value fits in a range of values. Then the fourth argument can then be
omitted because its default value is TRUE. For example, suppose you 4
want to assign letter grades to students based on a straight scale: below 5
60, an F: at least 60 but below 70, a D; at least 70 but below 80, a C; at 6
least 80 but below 90, a B; and 90 or above, an A. The lookup table to
the right (columns O and P) shows how you would set this up. The 7
comparison column in the lookup table starts at 0 (the lowest grade 8
possible) and then records the cutoff scores 60 through 90.
9
The formula in the gray cell is =VLOOKUP(L43,$O$43:$P$47,2), which is
copied down column M. This formula compares the value in L43 (67) to Order #
the values in column O and chooses the largest value less than or equal
to it. This is 60. Then because the third argument in the VLOOKUP 1
function is 2, the score reported in the gray cell comes from the second 2
column of the lookup table next to 60, namely, D. 3
Try it! For the orders to the right, create a lookup table in columns O and 4
P, and a copyable VLOOKUP formula in column M. Assume there is 5
quantity discount pricing: for orders less than 300 units, the unit price is 6
$3.00; 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.00. (Scroll to 7
the right for the answer.) 8

Student
Looking for an Exact Match Adams
Davis
In the examples above, it wouldn't make sense to look for an exact match
because there usually isn't one. For example, a typical score such as 67 Edwards
does not exactly match any of the values in the first column of the lookup Johnson
table. However, there are many cases when it does make sense to look for Myers
an exact match. Then there are three things to remember. (1) The fourth
arguments is not optional; it must be FALSE. (2) The first column of the Smith
lookup table doesn't have to be in ascending order; it can be, but order Thomson
doesn't matter. (3) If no exact match exists, the function returns an error.
Williams
Try it! Use a VLOOKUP function in column M to find the gradepoints for
each student, using the lookup table in columns O and P. What happens
with Williams? (Scroll to the right for the answers.)

Note that the grades in column O of the lookup table are in the natural
order, but they are not in Excels A-Z sort order. Therefore, FALSE must be
entered as the fourth argument in the VLOOKUP function. Try it with the
fourth argument TRUE to confirm that you get incorrect results.
Score Grade Lookup table
67 D 0 F
72 C 60 D
77 C 70 C
70 C 80 B
66 D 90 A
81 B
93 A
59 F
90 A

Units sold Total cost


373
475
459
441
238
349
344
203

Grade Gradepoints Grade Gradepoints


B A 4
A- A- 3.7
C+ B+ 3.3
B- B 3
B+ B- 2.7
A C+ 2.3
C C 2
D C- 1.7
Total cost
$932.50
$950.00
$918.00
$882.00
$714.00
$872.50
$860.00
$609.00

Gradepoints
3
3.7
2.3
2.7
3.3
4
2
#N/A

Williams's grade
Williams's grade (D)
(D) isn't
isn'tin
in th
t
lookup table,
lookup table, so
so an
anerror
error resu
resu
Lookup table
0 $3.00
300 $2.50
400 $2.00

Gradepoints

Williams's grade
Williams's grade (D)
(D) isn't
isn'tin
in the
the
lookup table,
lookup table, so
so an
anerror
error results.
results.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

INT (Integer) Function (Math & Trig Category)


The INT function takes a decimal value and returns an integer by "chopping
off" (truncating) 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


numeric cell.

Try it! In row 11, apply the INT function to the numbers in row 10. (Scroll to
the right for answers.)

ROUND Function (Math & Trig Category)

The ROUND function rounds a value to the number of decimals you specify.
To use it:

Enter the formula =ROUND(value,decimals), where value is a number or a


reference to a numeric cell, and decimals indicates the number of decimal
places to round to. If decimals is 0, it rounds to the nearest integer. If
decimals is positive, it rounds to this many decimals. If decimals is negative, it
rounds to the nearest ten (if decimals = -1), the nearest hundred (if decimals
= -2), the nearest thousand (if decimals = -3), and so on.

Try it! In row 20, apply the ROUND function to the numbers in row 18, using
the decimals values in row 19. (Scroll to the right for answers.)
List of Topics sheet

INT function
1.7 -3.2 14 -7

ROUND function
100.35 14325 16.3467 154432 0.3569
0 -2 2 -3 1
1.7 -3.2 14 -7
1 -4 14 -7

100.35 14325 16.3467 154432 0.3569


0 -2 2 -3 1
100 14300 16.35 154000 0.4
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

ABS (Absolute Value) Function (Math & Trig Category)

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


numeric cell.

Try it! In row 10, apply the ABS function to the numbers in row 9. (Scroll to the
right for answers.)

SQRT (Square Root) Function (Math & Trig Category)

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


numeric cell. If value is negative, this returns an error.

Try it! In row 16, apply the SQRT function to the numbers in row 15. (Scroll to the
right for answers.)

SUMSQ (Sum of Squares) Function (Math & Trig Category)

The SUMSQ function returns the sum of squares of numbers. To use it:

Enter the formula =SUMSQ(range), where range is any range of numbers.

Try it! In cell P26, calculate the sum of squares of the numbers to its left. (Scroll to
the right for answers.)
List of Topics sheet

ABS function
6 -50 0

SQRT function
64 0.5 -20 0

SUMSQ function
21 43 4 21 35
6 -50 0
6 50 0

64 0.5 -20 0
8 0.707107 Err:502 0

21 43 4 21 35 3972
Alternatively 3972
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

LN (Natural Logarithm) Function (Math & Trig Category)

The LN function returns the natural logarithm of a number. To use it:

Enter the formula =LN(value), where value is a number or a reference to a LN function


numeric cell. If value is zero or negative, this returns an error.
1023
Try it! In row 9, apply the LN function to the numbers in row 8. (Scroll to the
right for answers.)

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 applications.

EXP function
EXP (Exponential) Function (Math & Trig Category) 1

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 raised
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. Alternatively, if you start with a (positive) number x and take LN of
it, and then take EXP 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 numeric cell.
Try it! In row 20, apply the EXP function to the numbers in row 19. Then in
row 21, apply the LN function to the numbers in row 20. Note that the
value you get in cell K20 is the special number e. (Scroll to the right for
answers.)
LN function
0.7 1 0 -40

EXP function
-4 2.3 0 15
1023 0.7 1 0 -40
6.930495 -0.35667 0 Err:502 Err:502

Logs aren't
Logs aren't defined
defined for
for 00
or negative
or negativenumbers.
numbers.

1 -4 2.3 0 15
2.718282 0.018316 9.974182 1 3269017
1 -4 2.3 0 15
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

RAND Function (Math & Trig Category)

The RAND function returns a random number uniformly distributed


between 0 and 1. That is, all numbers between 0 and 1 are equally likely to
be returned. 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 any cell to the right and copy it to some
range. Then press the F9 key a few times and watch the random numbers
change. (Scroll to the right for some possible live values.)

RANDBETWEEN Function (Math & Trig Category)

Until Excel 2007, the RAND function was the only function for generating
random numbers in Excel. 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. (Scroll to the right
for some possible live values.)
RAND
0.72671 0.660378 0.929445 0.669973 0.856141 0.448785
0.709663 0.010722 0.297684 0.537219 0.912569 0.204959
0.180374 0.160087 0.241601 0.384551 0.803176 0.058504
0.087449 0.317238 0.083321 0.171152 0.729906 0.439633
0.857127 0.180354 0.212282 0.009383 0.40187 0.001966
0.979886 0.382831 0.589731 0.822189 0.309887 0.399062
0.957238 0.690071 0.833852 0.090169 0.554428 0.665825
0.636328 0.755287 0.087427 0.637011 0.370954 0.078325
0.431923 0.878741 0.029835 0.787641 0.496876 0.477259
0.846585 0.315373 0.904592 0.042096 0.548385 0.553065
0.928499 0.404499 0.426547 0.04064 0.695066 0.897309

RANDBETWEEN
4
6
5
1
2
2
4
3
5
2
5
5
6
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Concatenating, CONCATENATE Function (Text Category)

To concatenate, you start with two or more pieces of text and piece them
together. For example, you might concatenate Bob and Jones into Bob
Jones. There are two equivalent ways to concatenate: with the ampersand Bob
(&) symbol and with the CONCATENATE function. Both are described here. Stephen
Andy
Suppose cells A1 and B1 contain text such as a first name and a last name.
To concatenate them with the ampersand symbol, you enter the formula John
=A1&B1 in some other cell such as cell C1. Literal text, such as a comma Kathy
and a space, can also be included, such as =A1&, &B1. In this case, if cell Karen
A1 contains Jones and cell B1 contains Bob, then cell C1 will contain
Jones, Bob. This concatenates the last name, the literal comma and space, Tom
and the first name. In general, you separate the pieces with ampersands, Peter
and you surround literal text with double quotes.
Ted
To concatenate the text in cells A1 and B1 with the CONCATENATE function, Jason
you 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
surrounded with double quotes.

Try it! Concatenate the first names, middle initials, and last names in
columns K, L, and M with the ampersand symbol so that full names of the
form Jones, Bob E. appear in column N. Do this with again with the
CONCATENATE function in column O. (Scroll to the right for answers.)
Ampersand CONCATENATE
E Jones
C Davis
T Thompson
F Wilson
C Fredericks
D Williams
T Smith
F Jennings
R Benson
E Samson
Ampersand CONCATENATE
Bob E. Jones Bob E. Jones
Stephen C. Davis Stephen C. Davis
Andy T. Thompson Andy T. Thompson
John F. Wilson John F. Wilson
Kathy C. Fredericks Kathy C. Fredericks
Karen D. Williams Karen D. Williams
Tom T. Smith Tom T. Smith
Peter F. Jennings Peter F. Jennings
Ted R. Benson Ted R. Benson
Jason E. Samson Jason E. Samson
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Parsing with Text to Columns

Parsing text, that is, separating it into its pieces, is sometimes easy, and it
is sometimes difficult. The text functions illustrated in the other parsing
topic in this tutorial are for the difficult cases, but this topic discusses an
easy tool that is worth trying first. Suppose you import data from a
legacy system or a Web site, and everything gets imported to a single
column, such as in column K to the right. The pattern is pretty clear: each
cell contains five numbers, all separated by commas. To parse these into
five columns with one number per cell, you can use the Text to Columns
button on the Data ribbon shown to the right. This launches a fairly
simple wizard (basically, the same wizard used for importing a text file),
where you can indicate that the "delimiter" is a comma.

Try it! Select the data in column K and try the Text to Columns wizard.
Note that it places the results in columns K-O, replacing the original data
in column K. If you want to keep the original data for some reason, you
should first make a copy in column L and then parse the copy.
Note: You might see little green triangles in the cells in column K. These
indicate errors, or at least what Excel thinks are errors. If you select any
of these cells, or all of them, you will see a dropdown to the left, which
provides options for dealing with the "errors," including ignoring them.
(They should be ignored in this example.) More generally, if you don't
want Excel to enter these error warnings in the first place--in any of your
workbooks--you can go to the Formulas section of Excel Options and
uncheck the "Enable error background checking" option.
List of Topics sheet

Text to Columns button on Data ribbon

606,360,516,1757,371
1631,1337,1260,1855,2823
904,749,486,1852,1612
2463,1324,1889,2597,312
1256,1839,1745,244,1508
2159,2917,1699,1351,974
1084,2379,1791,1933,507
1686,2454,1954,256,1068
1274,2330,2334,343,255
303,2128,578,824,1714
2989,2317,2196,642,2812
1743,2122,2428,871,2701
2817,2330,1217,407,327
894,1893,1963,1641,2533
2747,1952,243,2832,1487
358,2674,1660,1006,1249
1032,939,2172,2112,347
2639,2489,2905,412,2877
730,696,639,454,1591
1774,2506,2690,2498,2407
2406,493,1457,1317,2993
1359,894,2281,2454,1239
2847,1432,381,1518,941
1597,313,1231,596,702
2838,2547,846,868,1753
2049,558,201,1034,351
1395,1314,1004,489,275
2628,2596,1901,2114,381
1439,1574,2318,277,1202
918,2177,621,1777,2106
867,2906,2844,2173,1370
2314,236,1387,1586,1106
1316,1475,1791,1494,2405
1006,795,1804,861,979
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

General Approach to Parsing with Text Functions

Suppose that someone has given you a spreadsheet with a list of names
such as the one to the right. Each cell in column K has a last name, then a
comma and a space, and then a first name. Your job is to parse (that is,
separate) these names as indicated for the name in cells L10 and M10.
That is, column L should have all of the first names and column M should
have all of the last names. If this sounds easy, imagine that there are
10,000 names in column K. What would you do? If you just start typing,
you will be busy 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 the
most crucial step: discover the pattern.

Once you discover the pattern, you can then exploit it with a number of
useful text functions. The ones discussed here are FIND, LEN, RIGHT, LEFT,
and MID. If you want to learn about other text functions, click the Text
dropdown list on the Formulas ribbon.

LEN (Length) Function (Text Category)

The LEN function returns the number of characters in a piece of text.


To use the LEN function:

Enter the formula =LEN(text)

For example, =LEN("Bobby Jones") returns 11. This includes the space.

LEFT, RIGHT, MID Functions (Text Category)

These functions return the left, right, or middle characters from a piece of
text, where you indicate the number of characters to return.

To use the RIGHT function:

Enter the formula =RIGHT(text, n), where n is an integer. This returns the
right n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)
LEFT, RIGHT, MID Functions (Text Category)

These functions return the left, right, or middle characters from a piece of
text, where you indicate the number of characters to return.

To use the RIGHT function:

Enter the formula =RIGHT(text, n), where n is an integer. This returns the
right n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)

To use the LEFT function:

Enter the formula =LEFT(text, n), where n is an integer. This returns the
left n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)

To use the MID function:

Enter the formula =MID(text,s,n), where s is an integer and n is an


integer. (s stands for start.) This returns n characters of text, starting with
character s. (If n is larger than the number of characters from position s
on, this returns all characters from position s on.)

Here are some examples of MID:

The function =MID(Freddie,5,2) returns di.


The function =MID(Freddie,5,n) returns die for any n>=3.
The function =MID(Jones, Bob,FIND(,,Jones, Bob)+2,1) returns B.

The last example is trickier. As the next text box indicates, the FIND
function in this formula returns 6, the position of the comma, so this
formula is equivalent to =MID("Jones, Bob",8,1). Note that the starting
position is 8, not 7, because of the space.

FIND Function (Text Category)

The FIND function returns the position of the first occurrence of a string
of characters (which could be a single character) in a piece of text.

To use the FIND function:


Enter the formula =FIND(search_text,text,s), where search_text is a piece
of text to be found, text is the original text, and s is an optional integer
argument. This function returns the position of the first occurrence of
search_text, if any. If there are no occurrences, it returns an error. If the
argument s is missing, the search starts at character 1; otherwise, the
search starts at character s.

Here are a few examples:

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 search text


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.
Here are a few examples:

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 search text


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 t isnt


found in Jones, Bob.

Parsing Names with These Text Functions

The name-parsing problem at the top of this worksheet can be solved to


the right with the following series of steps:

1. In cell L107, find the length of the text in cell K107 with the LEN
function. This results in 10 in cell L107 because cell K107 has 10
characters, including the comma and space.

2. In cell M107, find the position of the comma with the FIND function.
This results in 6 in cell M107 because the comma in Jones, Bob is the 6th
character.

3. In cell N107, add 1 to find the position of the space after the comma.
This results in 7 in cell N107 because the space is the character right after
the comma.

4. In cell O107, 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 P107, 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 you have to do it only once, in the first
row. Then you 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 in the above steps and copy them
down. (Scroll to the right for the correct answers.)

Now try 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) FIND returns an error if it can't find the requested text. (2)
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) 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 and logic.
But it sure beats typing a long list of hundreds or thousands of names!

Flash Fill (introduced in Excel 2013)

Excel 2013 introduced a new Flash Fill tool that eliminates the need for some
(but not all) of these complex parsing formulas. You can read about Flash Fill in
the Text Functions section of the tutorial.
List of Topics sheet

Jones, Bob Bob Jones


Davis, Stephen
Thompson, Andy
Wilson, John
Fredericks, Kathy
Williams, Karen
Smith, Tom
Jennings, Peter
Benson, Ted
Samson, Jason
Full name Length Comma Space First name Last name
Jones, Bob
Davis, Stephen
Thompson, Andy
Wilson, John
Fredericks, Kathy
Williams, Karen
Smith, Tom
Jennings, Peter
Benson, Ted
Samson, Jason

Full name Length Comma Space1 Period Space2 Last name


Jones, Bob E.
Davis, F. Stephen
Thompson, Andy
Wilson, John B.
Fredericks, Kathy C.
Williams, Karen R.
Smith, J. Tom
Jennings, Peter
Benson, Ted C.
Samson, Jason A.
Used name Initial Middle initial
Full name Length Comma Space First name
Jones, Bob 10 6 7 Bob
Davis, Stephen 14 6 7 Stephen
Thompson, Andy 14 9 10 Andy
Wilson, John 12 7 8 John
Fredericks, Kathy 17 11 12 Kathy
Williams, Karen 15 9 10 Karen
Smith, Tom 10 6 7 Tom
Jennings, Peter 15 9 10 Peter
Benson, Ted 11 7 8 Ted
Samson, Jason 13 7 8 Jason

Full name Length Comma Space1 Period


Jones, Bob E. 13 6 7 13
Davis, F. Stephen 17 6 7 9
Thompson, Andy 14 9 10 #VALUE!
Wilson, John B. 15 7 8 15
Fredericks, Kathy C. 20 11 12 20
Williams, Karen R. 18 9 10 18
Smith, J. Tom 13 6 7 9
Jennings, Peter 15 9 10 #VALUE!
Benson, Ted C. 14 7 8 14
Samson, Jason A. 16 7 8 16
Last name
Jones
Davis
Thompson
Wilson
Fredericks
Williams
Smith
Jennings
Benson
Samson

Space2 Last name Used name Initial Middle initial


11 Jones Bob E Yes
10 Davis Stephen F No
#VALUE! Thompson Andy
13 Wilson John B Yes
18 Fredericks Kathy C Yes
16 Williams Karen R Yes
10 Smith Tom J No
#VALUE! Jennings Peter
12 Benson Ted C Yes
14 Samson Jason A Yes
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Flash Fill

Has Excel become a mind reader with the new Flash Fill tool introduced in
Excel 2013? You might think so after you read this topic. However, it's not
really about mind reading but rather about the ability to recognize
patterns.

Specifically, Flash Fill allows you to parse names, numbers, or dates


without any formulas if the items in your list follow a recognizable pattern.
A typical example where it applies is in the list of names to the right. Each
name follows a pattern: last name, comma and space, first name, space,
middle initial and period. Row 4 illustrates the desired results in gray.
There are several ways to proceed, and you can try any of these methods.
Just be aware that each method works only one column at a time, and you
must proceed from left to right, starting in the column adjacent to the
data column.

Method 1. Try it! Type the first name in the top row: Bob in cell L7. Then
select Flash Fill from the Fill dropdown on the Home ribbon. Pretty
amazing, isn't it? Now you could repeat with the other columns. Note that
right after doing a flash fill, you get a mini dropdown that provides several
options, such as undoing the flash fill.

Method 2. Try it! Type the middle initial and period in the top row: E. in
cell M7. Then start typing the next initial in the second row: T. in cell M8.
Pretty soon, Excel will guess the pattern and show it for all rows in light
font, at which time you can press Enter to accept the results. Again, you
could now repeat with the other columns.

Method 3. Try it! Type the last name in the top row: Jones in cell N7. Then
with any gray cell in column N selected, use the Flash Fill shortcut key
combination, Ctrl+e. Now repeat this method for the other columns.

By the way, as you do any of these, you might see text appear in row 6,
not just in the gray range. This is because Flash Fill is also parsing the
Names to parse label in cell K6!

Note how Flash Fill can recognize many patterns, such as the initials in
column Q and even the lower case name in column R. However, if names
don't fit the pattern, Flash Fill will likely fail. For example, if the bottom
two names were replaced with Lincoln, Abe and Fitzgerald, F. Scott, Flash
Fill wouldn't get everything correct. (You might want to verify this.) As this
indicates, Flash Fill can't completely take the place of text functions for all
parsing tasks.
Flash Fill also works on certain patterns of numbers and dates, as you can
check on the examples to the right. However, except for the year column
on the dates, only methods 1 and 3 seem to work; method 2 doesn't
work. It isn't clear why method 2 works in some situations but not in
others, and youll probably have to experiment to see which method
works best for you. In any case, the Flash Fill tool can often save you from
entering a lot of complex text formulas.
entering a lot of complex text formulas.
List of Topics sheet

Results for a typical name


Roberts, Julie T. Julie T. Roberts Julie Roberts Julie T. Roberts JTR

Names to parse
Jones, Bob E. Bob
Davis, Stephen T.
Thompson, Andy S.
Wilson, John T.
Kelley, Jennifer B.
Williams, Karen S.
Smith, Tom F.
Jennings, Peter R.
Benson, Ted A.
Samson, Jason T.

Results for a typical number Results for a typical date


123.78 123 78 2/21/2013 2013 2

Numbers to parse Dates to parse


126.90 1/3/2012
321.45 3/26/2000
860.22 5/7/1999
98.14 4/4/2008
113.67 6/17/1976
85.62 3/29/2000
256.48 12/25/2014
julie roberts

21
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Date and Time functions


Dates and Times in Excel

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. This tutorial can't cover all of the intricacies
of Excel-based dates and times, but it does illustrate some of the most
useful methods for working with them, including several of the functions
listed to the right.

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, 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. Actually, there
are several formats Excel recognizes as dates, including 3/14/2004,
March 14, 2004, 3-14-04, and a few others, but they are all stored as
38060.

The same is true 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 doesnt


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 doesnt understand 3/14/2004 4:30PM, simply because there
is no space between 4:30 and PM! 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 ways.
Format these as numbers with three decimals to see the serial values.
Then reformat them as date-times in any formats you prefer.
Date and Time functions Dates to format
3/14/04 1:30 PM
12/31/1901
3:50
12:00 PM
29-Feb-96
9/24/46 14:45
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

TODAY, NOW Functions (Date & Time Category)

Excel has two useful functions, TODAY and NOW, for automatically
entering the current date or the current date and time .

To use the TODAY function:

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 tomorrows date, that is, it will update each day.
To use the NOW function:

Enter the formula =NOW() in any blank cell. (Again, the blank parentheses
are necessary.) It returns the current date and time. It is also dynamic, but
it won't change until worksheet recalculates.

Try it! Enter the TODAY and NOW functions in the gray cells. Then format
the result of NOW as time onlyno date. (Scroll to the right for answers.)

After you have worked a few other exercises in this tutorial, come back to
this topic 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.)
List of Topics sheet

Today's date
Current time
Today's date 10/17/2017
Current time 7:50 AM

The value
The value in
in cell
cell AF8
AF8 was
was
formatted to
formatted to show
show time
time only,
only,
not date
not dateand
and time.
time.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Date
YEAR, MONTH, DAY, WEEKDAY Functions (Date & Time Category) 9/11/2001
1/28/1986
If a cell contains a date, it is easy to strip off the year, month, and day 11/22/1963
with the YEAR, MONTH, and DAY functions. There is also a WEEKDAY
function that returns the weekday index, 1 (Sunday) to 7 (Saturday). Each 8/6/1945
of these functions has a single argument, a date or a reference to a cell 12/7/1941
containing a date.
4/14/1912
Try it! For each date to the right in column K, return the year, month, day,
and weekday in columns L-O. (See to the right for answers.)

You might want the month name, such as September, and the day name,
such as Tuesday, rather than numbers. You can do this with custom
formatting. To get to custom formatting, right-click on any cell, select
Format Cells, and select Custom to bring up the dialog box to the right.
For month names, you can enter the code mmm (for three-letter
abbreviations) or mmmm (for full month names). Similarly, you can enter
the codes ddd or dddd for days.

Try it! Copy the values in columns M and O to columns P and Q,


respectively. Then custom format the months in column P as mmmm, and
custom format the days in column Q as dddd. This serves as an excellent
reminder that dates can be formatted in many ways.
Year Month Day Weekday Month name Day name
Date
9/11/2001
1/28/1986
11/22/1963
8/6/1945
12/7/1941
4/14/1912
Year Month Day Weekday Month name Day name
2001 9 11 3 September Tuesday
1986 1 28 3 January Tuesday
1963 11 22 6 November Friday
1945 8 6 2 August Monday
1941 12 7 1 December Sunday
1912 4 14 1 April Sunday
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

DATE Function (Date & Time Category)

The DATE function takes three numerical arguments, a year, a month, and a
day, and it returns the corresponding date. The important part is that Excel
recognizes the result as a date, which you can then format in any date
format you like.

To use the DATE function:

Enter the formula =DATE(year,month,day), where year is a 4-digit year,


month is a number from 1 to 12, and day is a day from 1 to the number of
days in the month.

This function can be very useful for manipulating dates. For example, it can
be used to find your next birthday, given your birthdate, as illustrated in cell
L8. The formula in cell L8 is a long one, but it is 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's date.

Tip: Depending on the width of your Excel window, you might not be able
to see all of the long cell L8 formula in the formula bar. To see long formulas
like this one, you can make the formula bar "taller." Just drag the border
below the formula bar down.

Try it! Enter your birthdate in cell K17 and then calculate your current age
(as an integer) in cell L17. (Scroll to the right for the answer.)

DATEVALUE Function (Date & Time Category)

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 wont 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.

To use the DATEVALUE function:

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 L corresponding to the text values in column K
that happen to look like dates. Then format the results with any date format
you prefer. (Scroll to the right for answers.)
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 L corresponding to the text values in column K
that happen to look like dates. Then format the results with any date format
you prefer. (Scroll to the right for answers.)
List of Topics sheet

Birthdate Next birthday


7/22/1976 7/22/2017

Birthdate Age

Dates imported from a legacy system


Nov 25, 1997
Nov 26, 1997
Nov 29, 1997
Dec 1, 1997
Dec 3, 1997
Birthdate Age
8/16/1976 41

Nov 25, 1997 35759


Dec 1, 1997 35765
Dec 3, 1997 35767

The values
The valuesin
ingray
graycould
couldnow
now
be formatted
be formatted as
asdates.
dates.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

MIN, MAX Functions (Statistical Category)

The MIN function returns the smallest numeric value in a range. Similarly,
the MAX function returns the largest numeric value in a range.
Sales rep
To use MIN and MAX functions:
Jan sales
Enter the formula =MIN(range) or =MAX(range) where range is any range. Feb sales
These produce the obvious results: the maximum (or minimum) value in
the range.

Try it! Use the MIN and MAX functions to fill in the gray range to the right.
(Scroll to the right for answers.) Jan
Note that MIN and MAX work only on numeric data. If you have a list of Feb
names, you might expect MIN and MAX to return the first and last names
in alphabetical order, but unfortunately they don't. (There are two other
functions called MINA and MAXA, but they don't appear to be very useful.)
Allison Baker Jones Miller Smith Taylor
$3,700 $2,400 $2,300 $3,000 $3,800 $3,700
$2,600 $2,200 $2,400 $2,800 $3,600 $2,300

Min sales Max sales


Jan
Feb
Min sales Max sales
$2,300 $3,800
$2,200 $3,600
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

MEDIAN Function (Statistical Category)

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. 33
3
To use the MEDIAN function: 0
Enter the formula =MEDIAN(range), where range is any numeric range. 1
4
Note that if range contains labels or blank cells, these are ignored when 14
calculating the median. This is also true for the other statistical functions.
5
Try it! Find the median of the data in column K. Does it equal the average? 41
Why or why not? (Scroll to the right for answers.) 3
5
9
1
0
22
10
QUARTILE Function (Statistical Category) 5
13
The values in a data set are often ranked in some way. For example, if you 7
take the SAT exam to get into college, you learn your ranking by a percentile.
If you are at the 85th percentile, you know that 85% of all people scored 6
lower than you, and only 15% scored higher. Excel has two useful functions 3
for finding this type of information: PERCENTILE and QUARTILE.
9
The QUARTILE function is the easiest to understand. Imagine that you have 5
1000 scores. You sort them from low to high and then divide them into four 14
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 first, second, 7
and third quartiles are the breakpoints between these sets. For example, 27
25% of the scores are below the first quartile, and 75% are above it. By 10
definition, the second quartile is the median.
7
To use the QUARTILE function: 3
11
Enter the formula =QUARTILE(range,k), where k is 1, 2, or 3. For example, if
you enter 3 for k, you get the third quartile. 15
35
Try it! Find all three quartiles, Q1, Q2, and Q3, for the data in column K.
9
0
5
6
11
13
4
17
3
PERCENTILE Function (Statistical Category) 19
The PERCENTILE function takes any percentage, expressed as a decimal 4
number from 0 to 1, and it returns the value such that the given percentage of 5
all values is below this value. For example, if the percentage is 10% (0.10) and 1
the PERCENTILE function returns 45, you know that 10% of all values in the
data set are below 45 and 90% are above it. 21
4
To use the PERCENTILE function: 16
Enter the formula =PERCENTILE(range,pct), where pct is any percentage 6
expressed as a decimal between 0 and 1, such as 0.10 for 10%. 18
18
Try it! Find the requested percentiles for the data in column K. For example,
P10 indicates the 10th percentile. Do you see the relationship between the 2
quartiles and certain percentiles? 3
17
7
9
6
4
2
Technical Note About QUARTILE and PERCENTILE Functions 7
The QUARTILE and PERCENTILE functions are typically used on data sets with a 3
large number of values. If they are used on a very small data set, you might be 0
surprised at the results. In fact, you might even disagree with them. For 14
example, if the data set has the five values 10, 20, 30, 40, and 50, Excels
PERCENTILE function indicates that the 10 th percentile is 14. This is certainly not 2
a very intuitive answer, and you might disagree with it, but why anyone would 4
want the 10th percentile of a five-value data set in the first place? 24
In any case, Microsoft introduced the functions QUARTILE.INC, QUARTILE.EXC, 12
PERCENTILE.INC, and PERCENTILE.EXC in Excel 2010. The INC versions are 1
identical to the original QUARTILE and PERCENTILE function (which still work
fine). The EXC versions were evidently added to work better on small data sets. 4
You can go to online help for further details. 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
Average
Median

Quartiles
Q1
Q2
Q3

Percentiles
P01
P05
P10
P25
P50
P75
P90
P95
P99
Average 10.27
Median 7

Quartiles
Q1 3.75
Q2 7
Q3 14.25

Percentiles
P01 0
P05 0.95
P10 1
P25 3.75
P50 7
P75 14.25
P90 22.2
P95 33.1
P99 41.04
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

STDEV and VAR Functions (Statistical Category)

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 1034.44
Excel implements these with the VAR and STDEV functions. (These 877.35
functions calculate the sample variance and sample standard deviation. 794.42
There are similar functions, VARP and STDEVP, for calculating the
population variance and population standard deviation. For large data 828.45
setsover 100 values, saythe sample and population measures are 765.9
practically the same.)
1088.95
The variance is essentially the average of the squared deviations from 786.05
the mean, and the standard deviation is the square root of the variance. 1523.02
Each measures variability, but standard deviation is easier to understand
because it is expressed in the same units as the datadollars, for 920.48
example. In addition, many data sets have the property that about 68% 777.23
of the data are within one standard deviation of the mean, about 95% of 1247.63
the data are within two standard deviations of the mean, and virtually all
of the data are within three standard deviations of the mean. These 1117.87
"empirical" rules typically hold when the distribution of values follows a 1157.3
symmetric, bell-shaped curve, that is, the normal distribution. 641.35
To use the VAR function: 520.49
586.68
Enter the formula =VAR(data_range). This is equivalent to
=(STDEV(data_range))^2, the square of the standard deviation. 952.22
878.36
To use the STDEV function: 1582.12
Enter the formula =STDEV(data_range). This is equivalent to 807.99
=SQRT(VAR(data_range)), the square root of the variance. 913.13
1051.65
Try it! Find the mean (average), variance, and standard deviation of the
data in column K. Then use COUNTIF to find the percentage of values 628.44
that are within one standard deviation of the mean. Is it about 68%? 651.86
(Scroll to the right to see the answers.) 843.55
Note: In Excel 2010, VAR and VARP were replaced by VAR.S and VAR.P. 1233.37
Similarly, STDEV and STDEVP were replaced by STDEV.S and STDEV.P. 1036.55
However, the old versions still work fine.
543.17
866.31
883.25
1285.68
650.44
1412.4
1105.44
671.55
1077.21
1471.87
1362.55
1044.37
601.52
1256.48
1069.69
407.54
1609.11
1141.03
972.54
851.91
1324.67
1061.09
809.91
655.81
1224.02
1105.52
1102.63
342.62
642.01
762.48
945.73
1431.55
695.66
871.12
827.21
1468.62
863.17
582.4
919.07
1314.83
1418.85
909.82
1086.11
620.14
668.74
598.66
1175.09
1139
1369.23
618.31
693.67
1341.85
1479.33
477.41
962.29
686.64
1495.96
1101.87
1018.6
1027.43
921.99
868.49
856.14
724.87
1345.72
1127.91
1467.66
918.88
997.56
965.11
1059.32
1157.35
1116.73
1410.39
786.62
1477.32
1328.5
753.26
905.17
821.06
1052.57
926.89
579.01
873.54
1100.79
727.32
718.17
948.09
866.89
684.5
1391.63
678.82
961.36
1023.22
851.44
1247.63
1373.37
1177.79
929.79
690.18
736.95
1293.14
1134.24
1316.3
1440.09
1249.47
787.9
1320.84
1263.38
1212.95
1081.63
1214.14
1367.41
1579.93
1405.68
965.25
1081.01
713.61
1033.28
999.4
361.42
721.3
1052.62
1094.3
937.92
1217.14
225.9
707.88
856.16
949.8
1510.56
1234.83
1147.42
820.95
1049.69
915.41
862.87
1017.05
763.08
978.67
1357.03
1279.62
1361.16
952.66
523.33
1375.14
545.6
847.12
1464.07
1113.21
1292.26
634.98
651.65
602.12
1367.6
891.63
1197.37
1355.34
904.44
1638.89
1325.24
892.26
1553.37
697.54
1127.03
854.27
810.98
902.46
623.26
952.45
853.4
1029.52
1172.72
Mean
Variance
Standard deviation

% within 1 stdev
Mean 999.77
Variance 83102.38
St Dev 288.27

Mean - Stdev 711.50 # less 36


Mean + Stdev 1288.05 # greater 40
Pct with 1 stdev of mean 62%
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

CORREL and COVAR Functions (Statistical Category)

If there are two columns of data that are matched in a particular way,
such as monthly sales of two company products, it is often useful to see
how they are related. If one is unusually large, does the other tend to be Month
unusually large or does it tend to be unusually small? The statistical Jan-09
measure for this is correlation, and it can be calculated with the CORREL Feb-09
function. A correlation is a number between -1 and +1. If the correlation
is positive, the two sets of numbers tend to vary in the same direction. If Mar-09
one is small, the other tends to be small; if one is large, the other tends Apr-09
to be large. Exactly the opposite is true if the correlation is negative. In
this case, the two sets of numbers tend to vary in opposite directions. May-09
The magnitude of the correlation indicates the strength of the Jun-09
relationship between the two sets of numbers. There is a strong Jul-09
relationship (positve or negative) if the correlation is close to -1 or +1.
The relationship is much weaker, or nonexistent, if the correlation is Aug-09
close to 0. Sep-09
Oct-09
To calculate a correlation between two sets of numbers:
Nov-09
Enter the formula =CORREL(range1,range2), where range1 and range2 Dec-09
contain the two matched sets of numbers. Jan-10
Try it! The data to the right represent monthly sales of three products. Feb-10
Calculate the indicated correlations in column Q. (Scroll to the right for Mar-10
the answers.)
Apr-10
There is a similar function COVAR for calculating covariances. A May-10
covariance is a correlation multiplied by the product of the two variables' Jun-10
standard deviations. Because a covarance is affected strongly by the units
in which the variables are measured, such as dollars versus thousands of Jul-10
dollars, it is not as easy to interpret as a correlation. Aug-10
Sep-10
Note: Two new functions, COVARIANCE.S and COVARIANCE.P, were
added in Excel 2010. COVARIANCE.P (P for population) is identical to the Oct-10
old COVAR function, which still works fine. Its denominator is n, the Nov-10
sample size. In contrast, COVARIANCE.S (S for sample) uses denominator Dec-10
n-1. However, no new CORREL function was required.
Jan-11
Feb-11
Mar-11
Apr-11
May-11
Jun-11
Jul-11
Aug-11
Sep-11
Oct-11
Nov-11
Dec-11
Jan-12
Feb-12
Mar-12
Apr-12
May-12
Jun-12
Jul-12
Aug-12
Sep-12
Oct-12
Nov-12
Dec-12
Jan-13
Feb-13
Mar-13
Apr-13
May-13
Jun-13
Jul-13
Aug-13
Sep-13
Oct-13
Nov-13
Dec-13
Jan-14
Feb-14
Mar-14
Apr-14
May-14
Jun-14
Jul-14
Aug-14
Sep-14
Oct-14
Nov-14
Dec-14
Jan-15
Feb-15
Mar-15
Apr-15
May-15
Jun-15
Jul-15
Sales1 Sales2 Sales3 Correlations
800 1750 640 Sales1 vs Sales2
1360 2970 280 Sales1 vs Sales3
1150 2370 230 Sales2 vs Sales3
940 2010 410
740 1690 290
1090 2590 460
780 1640 760
910 2100 840
990 1620 760
800 1790 710
1200 2320 690
1150 2090 640
880 2170 530
870 1640 640
870 1980 560
760 1360 980
1010 2110 880
820 1740 570
1140 2040 650
730 1940 600
1150 2000 540
690 890 1130
1210 2480 600
1080 2050 660
1420 2840 330
1230 2490 710
1170 2330 610
1140 2540 840
560 1750 1010
910 2490 950
1260 2930 150
1050 2500 390
1020 2240 440
760 1630 420
710 1380 880
1000 2000 660
940 2200 630
1270 2510 510
1370 2610 560
1050 2180 620
1110 2590 470
1170 2160 580
990 2020 480
1040 1870 300
1350 2590 540
820 1440 520
860 1870 620
1190 2640 460
910 1980 590
950 2290 510
820 1850 550
770 1710 610
810 1480 720
1370 2820 770
940 2360 540
1020 1940 420
930 1900 800
1110 2520 660
1230 2320 610
1080 2240 990
890 1840 530
970 1940 520
920 2510 480
1000 2360 370
1250 2400 380
1280 2490 640
790 1760 450
940 2000 290
1140 2570 460
1020 2760 370
1060 1680 560
1130 2000 60
1050 2270 710
1380 2350 660
770 1410 800
860 2410 360
1130 1980 700
1350 2960 300
920 2320 380
Correlations
Sales1 vs Sales2 0.776112
Sales1 vs Sales3 -0.31274
Sales2 vs Sales3 -0.41242
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

New Statistical Functions (introduced in Excel 2010)

Note: This item should be of particular to users who have used, or plan
to use, Excel's many statistical functions such as NORMDIST.

Microsoft revamped a lot of its built-in functions, particularly the


statistical functions, in Excel 2010. Most of these use a new "dot" name.
A typical example is with the functions for the normal distribution. In
previous versions, the two main functions were NORMDIST, for finding a
probability to the left of a given value, and NORMINV, for finding a value
with a given probability to the left of it. These were renamed NORM.DIST
and NORM.INV. Fortunately, the old functions still work exactly as before
for backward compatibility, so you can continue to use the old versions,
or you can start using the new versions.

Similar functions, with .DIST and .INV versions, now exist for other
probability distributions such as binomial, chi-square, and others. In fact,
for the t distribution, commonly used in statistical inference, there are six
versions. Their functionality was available in the older TDIST and TINV
functions, but only through obscure combinations of arguments. Now
their names indicate more precisely their purpose. (Only five of the six
are shown to the right. The other one is T.TEST, which you can look up in
online help.)

A few of the more common statistical functions are illustrated to the


right. As you can see, the changes are not exactly earth-shaking, but the
names of the new functions and their arguments are more intuitive.
Admittedly, the T functions are still far from obvious, but they are much
better than before. (Note: If you are viewing these in Excel 2007 or
earlier, you will see _xlfn. in front of the functions in column M in the
Formula bar. This indicates that these functions aren't available in pre-
2010 versions of Excel.)

Again, the majority of the new (or newly named) functions are statistical
functions, but there are a few others. For example, in the Date & Time
group, there are NETWORKDAYS (old) and NETWORKDAYS.INTL (new)
functions. The best way to get acquainted with these new functions is to
go to the Formulas tab and click one of the dropdowns lists in the
Function Library group. From there, you can get as much help as you
need. By the way, help for the old functions such as NORMDIST is still
available. You can find it in the Compatibility group under More
Functions on the Formulas ribbon.
List of Topics sheet

New function Old version New example Old example Result


NORM.DIST NORMDIST 0.2119 0.2119 Probability to the left of 80
NORM.INV NORMINV 121.0405 121.0405 Value with probability 0.8 to the left of it
BINOM.DIST BINOMDIST 0.1841 0.1841 Probability of <= 45 successes
BINOM.INV CRITBINOM 58 58 Value such that there is about probability 0.95 of being <= it
CHISQ.DIST CHIDIST 0.2236 0.2236 Probability to the left of 15
CHISQ.DIST.RT CHIDIST 0.7764 0.7764 Probability to the right of 15
CHISQ.INV CHIINV 15.4518 15.4518 Value with probability 0.25 to the left of it
CHISQ.INV.RT CHIINV 31.4104 31.4104 Value with probability 0.05 to the right of it
T.DIST TDIST 0.8354 0.8354 Probability to the left of 1
T.DIST.2T TDIST 0.3293 0.3293 Probability to the left of -1 plus probability to the right of 1 (i.e
T.DIST.RT TDIST 0.1646 0.1646 Probability to the right of 1
T.INV TINV -1.7247 -1.7247 Value with probability 0.05 to the left of it
T.INV.2T TINV 0.0635 0.0635 Value with probability 0.05 between it and the negative of it (
probability 0.95 of being <= it

the left of it
the right of it

s probability to the right of 1 (i.e., combined probability in tails)

the left of it
tween it and the negative of it (i.e., combined 0.95 in the tails)
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

PMT (Payment) Function (Financial Category)

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.

To use the PMT function:


Enter the formula =PMT(interest_rate,term,principal). 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 3.75% and the term of the loan is 36 months.
Calculate your monthly payment in the gray cell. Then use a data table to
see how your monthly payment varies for terms of 24, 36, 48, or 60
months. (Scroll to the right for the answers. The Data Table topic in this
tutorial explains data tables.)
List of Topics sheet

Principal $30,000 Data table for payment versus term


Annual interest 3.75% Term Payment
Term 36
Payment 24
36
48
60
Data table for payment versus term
Term Payment
$882.39
24
36
48
60
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

NPV (Net Present Value) Function (Financial Category)

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,
future cash inflows or outflows are discounted to get their present values
now. Given a future stream of cash inflows and/or outflows, the sum of all
their present values is called the net present value, or NPV. If this stream is
incurred at regular time intervalsat the end of each year from year 1 on
you can use Excels handy NPV function to calculate the NPV of the
stream.

To use the NPV function:

Enter the formula =NPV(rate,cash_stream). Here, rate is the discount


rate, which is essentially the rate the company believes it can earn on its
money, and cash_stream 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 an initial cash inflow or outflow at the beginning of


year 1, it should be entered outside the NPV function. The reason is that it
doesnt 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 for the
answer.)

XNPV Function (Financial Category)

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 cash flows directly, but it is easier to use the little-known XNPV
function. (Before Excel 2007, this function was actually part of the Analysis
ToolPak add-in that ships with Excel. Since Excel 2007, it has been part of
the regular financial functions group.)

To use the XNPV function:

Enter the formula =XNPV(discount_rate,cash_flows,dates), where


discount_rate is the same as with NPV, cash_flows is a stream of cash
inflows or outflows, and dates is a stream of the dates when they are
incurred.

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.
Enter the formula =XNPV(discount_rate,cash_flows,dates), where
discount_rate is the same as with NPV, cash_flows is a stream of cash
inflows or outflows, and dates is a stream of the dates when they are
incurred.

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! 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 2013.
(Scroll to the right for the answer.)
List of Topics sheet

Discount rate 12%


Initial payment $100,000

Cash inflows at ends of years


Year 1 2 3 4 5
Inflow $20,000 $35,000 $50,000 $45,000 $35,000

NPV

Discount rate 12%

Stream of cash flows


Date 1-Jan-13 25-May-13 15-Sep-13 15-Jan-14 30-Jun-14
Cash $85,000 $22,500 $31,000 $65,500 $55,000

NPV
NPV $29,806

NPV $69,805
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

IRR (Internal Rate of Return) and XIRR Functions

Companies often have investment opportunities where they pay initially Cash flows (initial value is a
and then receive 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 $100,000
large enough discount rates, the NPV will typically become negative,
meaning that the future returns are not enough to offset the initial IRR
payment. 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 attractive. Stated equivalently,
the investment is worth pursuing only if its IRR is greater than the
companys hurdle rate.

Excel has an IRR function that calculates an investments IRR. As with the
NPV function, the investment should be 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.

To use the IRR function:

Enter the formula =IRR(cash_stream,rate_guess), where cash_stream is


a stream of cash flows, where the first (the initial payment) should be
negative, and rate_guess is an initial guess for the IRR.
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 shouldnt make any difference in the final answer except in
unusual cases.

Try it! Find the IRR for the investment to the right, using an initial guess of
15%. What does this IRR say about the attractiveness of the investment?
(Scroll to the right for the answer.)

Note: The NPV topic in this tutorial describes an XNPV function for cash
flows that don't occur at regularly spaced intervals. There is a
corresponding XIRR function. You can look it up in online help.
sh flows (initial value is a payment)
$35,000 $45,000 $40,000 $25,000 $10,000
IRR

The company
The companywillwill find
findthis
this in
i
attractive only
attractive only ifif its
its hurdle
hurdlerr
below 19.81%
below 19.81% (which
(whichititprobpro
19.81%

The company
The companywillwill find
findthis
this investment
investment
attractive only
attractive only ifif its
its hurdle
hurdlerate
rate isis
below 19.81%
below 19.81% (which
(whichititprobably
probably is). is).
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

INDEX Function (Lookup & Reference Category)

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 indexes 4, 8
indicate the 4th row and 8th column of the range.

To use the INDEX function:

Enter the formula =INDEX(range,row index,column index), where row


index is an integer (for row) and column 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, the column index argument can be
omitted. In that case, =INDEX(range,row index) returns the value in the
specified row 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 column 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
the top gray cell. Then enter a formula in the bottom gray cell that finds
the unit shipping cost from the plant to the city specified in the two cells
above it. This formula should respond appropriately to whatever plant
and city indexes are entered in these two cells. (Scroll to the right for the
answers.)
List of Topics sheet

Unit shipping costs City1 City2 City3


Plant1 1.25 1.35 1.55
Plant2 1.15 1.45 1.25
Plant3 1.35 1.45 1.15

Unit shipping from Plant2 to City3

Plant 1
City 2
Unit shipping cost
Unit shipping from Plant2 to City3 1.25

Unit shipping cost 1.35


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

MATCH Function (Lookup & Reference Category)

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
a 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 order
quantity in the data table with the largest profit.

To use the MATCH function:

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
third cell of the range, this returns 3. The last argument, 0, indicates that
you want an exact match. If there is no exact match, the formula returns
an error. (Actually, the MATCH function can also look for an inexact
match by using a +1 or -1 for the third argument. You can look up the
details in online help.)
The top 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, corresponding to an order quantity of 300. However, if inputs
(not shown here) that drive the profit model change, the best order
quantity and the corresponding profit could change. You want formulas
in the two gray cells to show the best profit and best order quantity
regardless of where they appear in the table.

The formula in cell L15 is =INDEX(K8:K12,MATCH(L14,L8:L12,0)). The


whole purpose of the MATCH function here is to provide the row index
for the INDEX function. That is, you know that the best order quantity is
one of the values in the range K8:K12, and you need to know which one.
So you find a match for the maximum profit to the profits in L8:L12. In
this case, the maximum is the third profit in the list, so the formula is
equivalent to =INDEX(K8:K12,3).

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
copyable formulas in the gray range to find the best order quantity for
each unit stockout cost. (Scroll to the right for the answers.)
List of Topics sheet

Table of profit versus order quantity


Order quantity Profit
200 $5,325
250 $5,430
300 $5,640
350 $5,565
400 $5,235

Best profit $5,640


Best order quantity 300

Profit for various order quantities (column L) and unit stockout costs (row 32)
$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

Best order quantities


Best order quantities 250 300 300 350
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

OFFSET Function (Lookup & Reference Category)

The OFFSET function allows you to reference a range (or a single cell)
relative to another cell. It is hard to appreciate this function unless you
see some examples, so some typical examples are illustrated here.

To use the OFFSET function:

Enter the formula =OFFSET(cell,row_offset,column_offset,height,width).


Here, row_offset and column_offset are integers that can be positive,
negative, or zero, and height and width are optional positive integers. If
either height and width are missing, they default to 1. This formula
returns a reference to a range that has as many rows as height and as
many columns as width. To find the upper left cell of this referenced
range, start at cell, move row_offset rows down (if positive) or up (if
negative), and move column_offset columns to the right (if positive) or
the left (if negative).

For example the formula =OFFSET(A1,2,3,4,1) returns a reference to the


range D3:D6, a range with 4 rows and 1 column. Its upper left cell, D3, is
offset from cell A1 by going 2 rows down and 3 columns to the right.

As another example, the formula =OFFSET(F4,0,-3) references a single


cell (because the last two arguments are missing), and this single cell is 3
columns to the left of cell F4, namely, C4.

Using the OFFSET Function for Delayed Payments

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
L30. The sales occur as indicated in row 33, but the receipts from the
retailer occur two months later, as indicated in row 34. The goal is to
calculate the receipts from January on.

Without the OFFSET function, you could simply put links in the Receipts
row that point to sales two months earlier. For example, the formula for
receipts in January would be =M33. But what if the retailer decides to
delay payments by three months instead of two? Then you would need
to fix the links in the Receipts row. However, the OFFSET function avoids
this updating of links. You can use the formula =OFFSET(O33,0,-$L$30) in
cell O34 for January and copy it across row 34 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 L30. To see how it works, change the value in cell L30 to
3 or 1. (If the delay is 3, you will need to copy the formula ahead to
September; if the delay is 1, you can delete the August formula.)

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
one month from now and the other 60% two 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
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 L30. To see how it works, change the value in cell L30 to
3 or 1. (If the delay is 3, you will need to copy the formula ahead to
September; if the delay is 1, you can delete the August formula.)

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
one month from now and the other 60% two 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 update automatically if you change the inputs in the blue cells.
For example, make sure your formulas react correctly if you enter 2 and 3
in the blue cells in column N. (Scroll to the right for answers.)

Creating Dynamic Range Names with OFFSET

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 L, and the total of all sales values is
calculated in the gray cell. Every month, an extra sales value and its
month label are appended to the list in columns K and L. You can make
the formula in the gray cell update automatically to the appended values
by using a dynamic range name.

To do this, select the Define Name dropdown in the Formulas ribbon. In


the Name box at the top of the resulting dialog box, enter Sales as the
range name, as shown to the right. In the Refers To box at the bottom,
enter the formula

=OFFSET($L$61,0,0,COUNTA($L:$L)-COUNTA($L$1:$L$60),1).

Then click OK. Finally, enter the formula =SUM(Sales) in the gray cell.
Note that COUNTA($L:$L) returns the number of nonblank cells in
column L, and COUNTA($L$1:$L$60) returns the number of nonblank
cells in the first 60 rows of column L. So the difference is the number of
sales values in column L. Therefore, this OFFSET function refers to a
range that starts in cell L61 and has as many rows as there are sales
values in column L. To see how it adjusts, enter a sales value for June in
cell L66 and watch how the total changes automatically.

Again, note that COUNTA($L:$L) counts all nonblank values in column L,


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 L200. 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 L61:L66, that is, 6 cells starting with L61.
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! Create the dynamic range name just described. Then enter the
formula for the total in the gray range, and add a new sales value for
June to see if your formula updates as it should.
Try it! Create the dynamic range name just described. Then enter the
formula for the total in the gray range, and add a new sales value for
June to see if your formula updates as it should.
List of Topics sheet

Receipts with payment delays


Payment delay 2

Month Oct Nov Dec Jan Feb Mar Apr May Jun
Sales 3200 4600 5500 2500 3300 4200 2900 4500 2750
Receipts 4600 5500 2500 3300 4200 2900

Costs with payment delays


Percent paid 40% when: 1 month from now
60% 2 months from now

Month Oct Nov Dec Jan Feb Mar Apr May Jun
Cost $1,950 $2,900 $4,150 $2,500 $3,350 $2,850 $3,550 $1,850 $4,200
Payment
Month Sales Total
Jan-11 $2,450
Feb-11 $3,140
Mar-11 $3,250
Apr-11 $4,510
May-11 $3,680

Creating dynamic range name


Jul Aug

4500 2750

Jul Aug Jan


$2,300
$3,400
Feb Mar Apr May Jun Jul Aug

$3,490 $2,840 $3,150 $3,130 $2,870 $2,790 $3,440


Total sales

Answer: Open
Answer: Open thth
definition of
definition of the
the
Smith Jones Wilson Donalds
Jan-05 $6,700 $7,400 $5,800 $9,000
Feb-05 $5,800 $8,900 $5,500 $7,900
Mar-05 $5,000 $7,900 $5,900 $8,300
Apr-05 $6,700 $5,800 $6,000 $9,700
May-05 $9,400 $7,800 $6,700 $8,400
Jun-05 $6,200 $5,800 $9,400 $8,500
Jul-05 $8,700 $5,300 $6,900 $7,500

Answer: Open
Answer: Open the
thename
namemanager
manager and
and look
look at
atthe
the
definition of
definition of the
the SalesDynamic1
SalesDynamic1 range
range name.
name.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

INDIRECT Function (Lookup & Reference Category)

The INDIRECT function is useful when you have named ranges and want to
refer to these, via labels, in your formulas. For example, suppose you have
ranges named Sales1, Sales2, and Sales3. Each of these is a long column of
data. Then suppose you have labels Sales1, Sales2, and Sales3 in some other
cells, say, G1, G2, and G3. If you enter the formulas
=AVERAGE(INDIRECT(G1)), =AVERAGE(INDIRECT(G2)), and
=AVERAGE(INDIRECT(G3)) in cells H1, H2, and H3, this is the same as
entering the formulas =AVERAGE(Sales1), =AVERAGE(Sales2), and
=AVERAGE(Sales3). The name of the function implies that you are indirectly
referencing a range via a label with this range name.

Try it! Name the data ranges in columns L-O by their labels in row 4. Then
use the AVERAGE, STDEV, and CORREL functions, along with the INDIRECT
function, to enter copyable formulas in the gray ranges below. As you should
appreciate, this is particularly useful for the matrix of correlations. (See to
the right for the answers.)
of Topics sheet

Monthly sales
Month Product1 Product2 Product3 Product4
Jan-13 1043 1047 957 1031
Feb-13 993 832 883 796
Mar-13 968 1114 1206 1048
Apr-13 1461 1487 1495 1519
May-13 1137 1183 1035 1045
Jun-13 1103 999 931 1133
Jul-13 1140 1025 1124 982
Aug-13 772 927 797 922
Sep-13 1195 1297 1231 1230
Oct-13 1140 1358 1267 1253
Nov-13 1236 1120 1107 1275
Dec-13 696 573 513 687
Jan-14 749 581 481 711
Feb-14 984 1005 998 804
Mar-14 1114 933 1084 963
Apr-14 758 832 950 745
May-14 307 418 428 508
Jun-14 1055 807 865 1102
Jul-14 1108 1149 1240 1275
Aug-14 1286 1041 919 968

Averages, standard deviations


Average Stdev
Product1
Product2
Product3
Product4

Correlations
Product1 Product2 Product3 Product4
Product1
Product2
Product3
Product4
Averages, standard deviations
Average Stdev
Product1 #REF! #REF!
Product2 #REF! #REF!
Product3 #REF! #REF!
Product4 #REF! #REF!

Correlations
Product1 Product2 Product3 Product4
Product1 #REF! #REF! #REF! #REF!
Product2 #REF! #REF! #REF! #REF!
Product3 #REF! #REF! #REF! #REF!
Product4 #REF! #REF! #REF! #REF!
Total sales
Smith
Jan-05 $6,700
Feb-05 $5,800
Mar-05 $5,000
Apr-05 $6,700
May-05 $9,400
Jun-05 $6,200
Jul-05 $8,700
Jones Wilson Donalds
$7,400 $5,800 $9,000 Answer: Open
Answer: Openthe
thename
name manager
manager and
andlook
lookat
at
the definition
the definitionof
of the
the Sales1
Sales1 range
range name.
name.
$8,900 $5,500 $7,900
$7,900 $5,900 $8,300
$5,800 $6,000 $9,700
$7,800 $6,700 $8,400
$5,800 $9,400 $8,500
$5,300 $6,900 $7,500
anager and
anager andlook
lookat
at
1 range
range name.
name.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Date
Quick Analysis 6-Mar
6-Mar
The Quick Analysis tool, introduced in Excel 2013, is a feature that 6-Mar
received considerable publicity. Starting with a data set such as the one
to the right, the new Quick Analysis tools provide you with instant 6-Mar
conditional formatting, pivot tables, charts, and other results with almost 6-Mar
no work. You can decide how useful this new feature really is. It 6-Mar
undoubtedly gives you very quick results, but it might not give you the
results you want. 7-Mar
7-Mar
To see how this works, select the entire data range to the right, including
the labels in row 3. You will see a Quick Analysis icon at the bottom right 7-Mar
of the data range. (Remember that if you are using a pre-2013 version of 8-Mar
Excel, this won't work.) When you click this icon (or press Ctrl+Q), you 8-Mar
see the Quick Analysis options below and to the right. Then you can
explore the possibilities. They are all straightforward. 8-Mar
9-Mar
As an example, if you choose Tables and then choose the first of several 9-Mar
automatic pivot tables, you get the pivot table on the next sheet, which
breaks down the sum of Total Cost by Region. This might or might not be 10-Mar
the pivot table you really want, but at least it gives you a pivot table that 10-Mar
you can then modify as you like. Similar statements can be made about 10-Mar
the automatic charts available from the Charts item. You can decide
whether this is any easier than building the pivot table or the chart you 10-Mar
really want from scratch. 11-Mar
Starting in Excel 2013, two of these Quick Analysis options are duplicated 11-Mar
by two "let us guess what you want" items in the Insert ribbon, shown to
the right. These are the Recommended PivotTables and Recommended Quick Analysis options
Charts items. They provide exactly the same options for pivot tables and
charts as from the Quick Analysis tools.

New items in Insert ribbon


Day Time Region Card Type Gender Buy Categos Ordered Total Cost High Item
Tue Morning West ElecMart Female High 4 $136.97 $79.97
Tue Morning West Other Female Medium 1 $25.55 $25.55
Tue Afternoon West ElecMart Female Medium 5 $113.95 $90.47
Tue Afternoon NorthEast Other Female Low 1 $6.82 $6.82
Tue Afternoon West ElecMart Male Medium 4 $147.32 $83.21
Tue Afternoon NorthEast Other Female Medium 5 $142.15 $50.90
Wed Evening West Other Male Low 1 $18.65 $18.65
Wed Evening South Other Male High 4 $178.34 $161.93
Wed Evening West Other Male Low 2 $25.83 $15.91
Thu Morning MidWest Other Female Low 1 $18.13 $18.13
Thu Morning NorthEast ElecMart Female Medium 2 $54.52 $54.38
Thu Afternoon South Other Male Medium 2 $61.93 $56.32
Fri Morning NorthEast ElecMart Male High 3 $147.68 $96.64
Fri Afternoon NorthEast Other Male Low 1 $27.24 $27.24
Sat Morning West Other Female Low 3 $46.18 $44.27
Sat Afternoon West Other Male Low 5 $107.44 $91.64
Sat Afternoon South ElecMart Female Medium 6 $96.53 $93.68
Sat Afternoon West ElecMart Female Medium 4 $77.44 $77.28
Sun Morning South Other Male Low 1 $15.19 $15.19
Sun Afternoon South Other Male Medium 1 $45.52 $45.52

Quick Analysis options

New items in Insert ribbon


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Person
Some Background on Tables 1
2
Note: Several of the screenshots on this worksheet are to the right of the
data, so scroll across to see them. 3
4
It is very common to work with "data sets" in Excel, where a data set is
typically a rectangular range with "observations" in the rows, "variables" in 5
the columns, and variable names in the top row. (Observations are also 6
called cases or records, and variables are also called fields or attributes.) A 7
typical data set appears to the right. Each row is an observation on some
person, and each column lists an attribute about the person. 8
9
Excel users have worked with data sets for years, and for a long time, they 10
were known somewhat informally as lists. But in Excel 2007, they gained
much more prominence and became known as tables. This was a much 11
needed change. You can perform many useful tasks with tables that you 12
either couldn't perform before or could perform only with extra work. Now 13
these tasks are easy.
14
15
16
17
18
19
20
Designating a Data Set as a Table 21
22
It is not enough to have a rectangular range of data to apply the table 23
tools. You must designate the range as a table. There are three ways to
do this, and all are easy. For each, make sure any cell in the table is 24
selected. Then (see screenshots to the right): 25
26
1. Click the Table button near the left of the Insert ribbon, or
27
2. Click the Format as Table dropdown arrow on the Home ribbon and 28
choose any of the color styles.
29
3. Press Ctrl+t. 30
31
Excel guesses that the range "surrounding" the active cell is the table
range in the Create Table dialog box (see screenshot to the right), but 32
you can override this if necessary. 33
34
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 (see 35
blue screenshot to the right). First, there is a dropdown arrow next to 36
each variable name. These are used for sorting and filtering, as discussed 37
below. Second, if the cursor is inside the table, there is a new Table Tools
Design tab and corresponding ribbon. It contains the tools for 38
manipulating the table. 39
If you no longer want the range to be designated as a table, you can click 40
Convert to Range on the Table Tools Design ribbon. The dropdown 41
arrows will disappear. Only the cell formatting will remain, and you can 42
restore it to "plain" if you like. Try this on the table you just created.
manipulating the table.

If you no longer want the range to be designated as a table, you can click
Convert to Range on the Table Tools Design ribbon. The dropdown
arrows will disappear. Only the cell formatting will remain, and you can
restore it to "plain" if you like. Try this on the table you just created.
43
44
45
46
47
48
49
50
51
Filtering in Tables 52
53
One of the main uses of tables is filtering, that is, hiding (but not 54
deleting) rows that don't match various conditions. Filtering is done
through the dropdown arrows next to the column headings. This tutorial 55
won't explain all of the options because there are so many, 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 two children are showing, you
will see only males with at least two children.
Filtering on a numeric vari
The screenshots to the right shows filter dialog box for a numeric
variable, Salary. It shows all distinct values of Salary, which you could
check or uncheck, but more importantly, the Number Filters group
contains many useful possibilities, such as Greater Than. Similarly, if you
filter on a text variable such as State or a Date variable such as Birthdate,
there are many Text Filters and Date Filters you can choose from.

Try it! If you haven't already done so, designate the data set to the right
as a table, and then experiment with the filters.

To clear a filter, click the column's dropdown arrow and select Clear
Filter. To clear all filters, click the Clear button in the Sort & Filter group
on the Home ribbon. You can also do it from the Data ribbon. (See to the
right.)

Sorting in Tables

You probably noticed that when you click a column dropdown arrow, there are
sorting options. This provides one more way to sort in Excel. It is not clear that
sorting in tables provides any advantages over sorting in regular (non-table)
data sets, but it is certainly possible and easy.

Summarizing with the Total Row

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
Summarizing with the Total Row Total Row button on Table
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, as shown to the right. But it gives you
many more options. If you select any cell in the total row, you will see a
dropdown list of summarizing options for that column (count, sum, average,
and others). And 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.) Example of Total Row

Try it! Create a total row for the table of people, and show summary
measures that seem appropriate. Then filter in some way and watch how
the summary measures change.

Expanding Tables Month


A feature of tables that business people will love is that they expand Jan-13
automatically as new data are added. For example, suppose you designate Feb-13
the data set to the right as a table. Later you add new products to the right Mar-13
and/or new months 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 Apr-13
automatically to include new data. The same is true of pivot tables if they May-13
are built from tables. Jun-13
Try it! Designate the data set to the right as a table. Next, select the entire Jul-13
table and insert a line chart. By default, you should see a line for each Aug-13
product, with month on the horizontal axis. Now add a couple more months Sep-13
of data at the bottom of the table and add a new product with some data at
the right of the table. The chart should update automatically! Oct-13
Nov-13
Dec-13
Jan-14
Feb-14
Mar-14
Apr-14
May-14
Jun-14
Jul-14
Aug-14
Sep-14
Oct-14
Birthdate Gender State Children Salary Table button on Insert ribbon
8/5/1959 Male Illinois 1 $65,400
10/15/1977 Female Wisconsin 2 $62,000
1/3/1981 Male Ohio 0 $63,200
5/5/1949 Male Indiana 2 $52,000
4/4/1987 Female Michigan 3 $81,400
6/30/1949 Female Indiana 3 $46,300 Format as Table options
5/22/1949 Female Illinois 2 $49,600
10/30/1952 Male Michigan 1 $45,900
1/17/1957 Male Michigan 3 $47,700
9/18/1985 Female Indiana 1 $59,900
7/19/1953 Male Ohio 1 $48,100
12/10/1946 Female Wisconsin 0 $58,100
3/29/1986 Female Michigan 2 $56,000
12/12/1952 Female Indiana 2 $53,400
6/12/1977 Female Indiana 2 $39,000
11/19/1989 Male Wisconsin 1 $61,500
9/6/1957 Male Ohio 0 $37,700
9/30/1970 Female Michigan 2 $36,700
10/24/1973 Male Wisconsin 2 $45,200
6/8/1978 Male Illinois 0 $59,000
8/27/1990 Female Ohio 2 $54,300
2/9/1947 Male Indiana 1 $62,100
4/1/1989 Male Michigan 0 $78,000
3/12/1970 Male Wisconsin 0 $43,200
3/28/1970 Male Ohio 1 $44,500
5/6/1963 Male Michigan 1 $43,300 Create Table dialog box
5/7/1959 Male Indiana 3 $45,400
3/6/1987 Male Michigan 2 $53,900
2/9/1958 Male Illinois 1 $44,100
8/4/1955 Female Ohio 2 $31,000
11/9/1984 Male Indiana 2 $67,400
2/10/1961 Female Ohio 1 $59,300
4/1/1961 Female Ohio 1 $48,600
10/20/1961 Male Illinois 0 $58,400
4/25/1970 Male Michigan 2 $65,500
2/17/1977 Male Michigan 0 $46,900
4/13/1985 Male Michigan 2 $41,000
5/16/1966 Male Ohio 0 $89,300 Dropdown arrows next to variable na
10/28/1969 Female Indiana 3 $71,800
11/30/1958 Male Illinois 1 $95,000
9/27/1962 Male Illinois 1 $49,700
1/25/1968 Male Ohio 2 $71,700
10/15/1988 Female Wisconsin 0 $52,900
2/11/1978 Female Michigan 0 $58,300
6/19/1974 Male Indiana 2 $82,000
9/22/1989 Male Wisconsin 0 $41,300 Table Tools Design ribbon
7/25/1983 Female Wisconsin 1 $72,000
4/9/1956 Female Indiana 2 $73,500
2/9/1989 Male Ohio 2 $55,200
12/10/1960 Female Michigan 1 $57,000
8/6/1956 Male Michigan 2 $84,300
9/20/1981 Male Indiana 2 $68,900
1/31/1963 Male Wisconsin 2 $59,000
12/7/1973 Female Ohio 0 $83,200
12/3/1988 Male Wisconsin 0 $52,400

Filtering on a numeric variable Clear all filters on Home ribbon Clear all filters button on Data ribbon
Total Row button on Table Tools Design ribbon

Example of Total Row

Product 1 sales Product 2 sales


$1,015 $1,779
$1,693 $1,768
$1,555 $4,476
$3,681 $3,565
$1,737 $3,475
$3,669 $2,186
$2,978 $4,363
$1,304 $2,412
$2,456 $4,433
$2,613 $1,572
$4,114 $2,861
$3,316 $3,251
$1,811 $4,382
$3,553 $3,833
$1,108 $4,373
$1,810 $2,839
$2,167 $4,476
$2,355 $3,744
$1,698 $1,216
$3,814 $4,351
$4,619 $3,058
$3,868 $4,497
tton on Insert ribbon

s Table options

ble dialog box

n arrows next to variable names


ls Design ribbon

on on Data ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Background on Pivot Tables

Pivot tables are a manager's dream. They allow you to "slice and dice" data in all sorts
of ways. Essentially, you use pivot tables to break down variables like revenue or
items sold by categories, such as region, month, and store.
Pivot tables have been in Excel since the late 1990s, and each new version has
changed them slightly. Then Excel 2007 made significant changes to the user interface
for pivot tables. Minor changes have then been made in Excel 2010 and 2013.
Regardless of the version, an argument can be made that no tool in any software
package enables you to get as much information as quickly and easily as Excel's pivot
tables.

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. However, rather
than read such books, you can learn the essentials discussed here and then
experiment. Don't worry about making mistakes. Pivot tables are very forgiving, and if
nothing else, you can always start over.

Creating a Pivot Table

The data set starting in column AA 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, select any cell in the data set and click 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. (Throughout
this topic, refer to the screenshots to the right.)

Try it! Create a pivot table from this data set, and place it on a new worksheet. You
can then use this pivot table to try all of the modifications discussed below. (Note
that there are no pivot tables on this Topic sheet. It contains only screen captures
of pivot tables; they are not "live.")

You will see a blank pivot table as shown to the right, and if the active cell is inside
it, you will see a PivotTable Fields pane and two PivotTable Tools tabs, Analyze and
Design. (The Analyze ribbon was called Options before Excel 2013.) Just remember
that the Fields pane and the pivot table tabs are visible only when the pivot table
is selected. So if they disappear, you now know why.

The key is the PivotTable Fields pane. The top section shows all of the available
fields (columns), and the bottom section shows the four areas you can drag these
to. Rather than read through a long explanation, try the following:

Drag Gender to the Rows area, Region to the Columns area, Paid With to the
Filters area, and 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 category values. (See the typical pivot table screenshot below
and to the right.)
to. Rather than read through a long explanation, try the following:

Drag Gender to the Rows area, Region to the Columns area, Paid With to the
Filters area, and 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 category values. (See the typical pivot table screenshot below
and to the right.)

Modifying a Pivot Table

Here are some other things you can do to the pivot table you just built. Try each of
these, hands-on. (Screenshots are not shown for all of these, but if you follow the
directions, you shouldn't have any problems with these modifications.)

1. The default layout for a pivot table (starting in Excel 2007) is called Compact
layout. You might prefer Tabular layout (the only layout in pre-2007 versions)
because it shows the names of the fields in the row and column areas. Both
layouts are shown in the screenshots to the right. You can change the layout
through the Report Layout dropdown on the PivotTable Tools Design ribbon.

2. By default, the sums are for all categories of any variables in the Filters area. To
show sums for VISA sales only, say, click the dropdown arrow next to Paid With
and select VISA.

3. You can hide any row or column categories. For example, click the Column
Labels dropdown list and select only Midwest and West.

4. You can change the way Total Cost is summarized and the way its values are
formatted. To do so, right-click any number in the pivot table and select a
summarizing function from the Summarize Values By dropdown list. For example,
select Average. Then right-click again and select Number Format and choose a
number format in the usual way. Now you see the average of Total Cost for the
various categories. (As an alternative, you can right-click and select Value Field
Settings. This opens a dialog box where you can make several changes at once.)

5. In the bottom section of the Fields pane, drag Gender to the Columns area and
Region to the Rows area. This is called pivoting. In fact, this is why they are called
pivot tables!

6. In the bottom section of the Fields pane, drag any of the fields to a blank space
on the worksheet, or simply uncheck its box in the top section. This removes the
field from the pivot table. There is no requirement that each of the four areas
must contain a field.

7. You can have two or more fields in a given area. For example, drag both Region
and Time to the Rows area. It starts to get "busy," but you are certainly allowed to
do it. Let's say you drag Gender to the Rows area and then you drag Time to the
Rows area. As you will see, the Gender button will be above the Time button in the
bottom section of the Fields pane, and Gender will be the "outer" field in the pivot
table. If you would rather reverse their roles, you can drag the Time button above
the Gender button in the bottom section of the Fields pane.

8. You can sort the values in the Rows or Columns areas through the dropdown
arrows, but the sort order might not be the natural order. For example, drag Time
to the Rows area (and drag any other variables off). The natural order is Morning,
Afternoon, Evening, but this isn't what you get with a sort. To sort appropriately,
select the Morning cell, and place your cursor at the bottom of the cell so that it
becomes a four-way arrow, and drag it up above Afternoon.

9. You can remove the grand totals from the rows and/or the columns. To do so,
the Gender button in the bottom section of the Fields pane.

8. You can sort the values in the Rows or Columns areas through the dropdown
arrows, but the sort order might not be the natural order. For example, drag Time
to the Rows area (and drag any other variables off). The natural order is Morning,
Afternoon, Evening, but this isn't what you get with a sort. To sort appropriately,
select the Morning cell, and place your cursor at the bottom of the cell so that it
becomes a four-way arrow, and drag it up above Afternoon.

9. You can remove the grand totals from the rows and/or the columns. To do so,
right-click any number in the pivot table and select PivotTable Options. This leads
to a dialog box with many pivot table options, including the option to show or hide
grand totals.

Pivot Charts
A pivot table begs for a corresponding chart. Fortunately, it is very easy to get such a
chart, called a pivot chart. Just select the pivot table, click the PivotChart button on the
PivotTable Tools Analyze (or 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 to the
pivot table. The pivot table and the pivot chart are perfectly synchronized.

Try it! Make some changes to the pivot table to see what happens to the chart. This is
almost too good to be true!

Displaying Counts in Various Ways

You can also summarize by counts. Then it doesn't matter which field is in the
Values area.

Try it! Start over by dragging everything off the pivot table. Now drag Gender to
the row area, Region 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 if you
drag a numeric variable to the Values area, you will have to right-click in the pivot
table and select Count from the Summarize Values By list. (It's also a good idea to
change the title right above the pivot table to Count, rather than Count of Total
Cost, for example. The reason is that Total Cost, or whichever variable is in the
Values area, has nothing to do with the counts, so the default label is misleading.)

Each count shows the number of customers in the category. For example, you
Try it! Start over by dragging everything off the pivot table. Now drag Gender to
the row area, Region 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 if you
drag a numeric variable to the Values area, you will have to right-click in the pivot
table and select Count from the Summarize Values By list. (It's also a good idea to
change the title right above the pivot table to Count, rather than Count of Total
Cost, for example. The reason is that Total Cost, or whichever variable is in the
Values area, has nothing to do with the counts, so the default label is misleading.)

Each count shows the number of customers in the category. For example, you
should see that there are 43 females from the Midwest. (Examples appear in the
screenshots to the right).

Sometimes it is more informative to display the counts as percentages. To do so,


right-click in the pivot table and select % of Row Total from the Show Values As list.
You should see, for example, that 26.50% of all female customers are from the
NorthEast. Do it again, but now select % of Column Total. Now you should see, for
example, that 32.26% of all South orders were placed by males.

You can experiment with the other Show Values As options. It all depends on how
you want to "tell the story."

Grouping

Another useful feature is grouping. When you drag a field to the Rows area, for
example, you get a row for each distinct value of the field. If there are many distinct
values, the pivot table becomes unwieldy and probably not very informative. 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 Rows area and Total Cost to the Values area.

Note that there is already some summarizing at this point because multiple sales
were made on some of the dates, but there are so many dates that it is difficult to
see any interesting trends through time. So it is useful to group on dates.

Try it! Right-click any date, select Group, and then select Month. Now you see total
sales in each of the four months.

If this data set were over a multi-year period and you grouped by Month, 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 in the Group dialog
box.

Creating a Pivot Table from a Table

There is a distinct advantage to building a pivot table from a table as opposed to a


fixed range. The advantage is that if you decide to add rows and/or columns to the
Creating a Pivot Table from a Table

There is a distinct advantage to building a pivot table from a table as opposed to a


fixed range. The advantage is that if you decide to add rows and/or columns to the
table, the table expands automatically, and the pivot table can then be refreshed with
the click of a button to accommodate the new data. You do not need to build a new
pivot table.

Try it! Designate the data set starting in column AA as a table. It will have a default
table name, such as Table1, which you can change if you like. Then build a pivot table
from the table. You will notice that the Table/Range box shown to the right contains
the name of the table, not a range address. This is what you want. Once you have
created the pivot table, go back and add a new column to the right of the table
and/or add some extra data to the bottom of the table. Go back to the pivot table and
click the Refresh button on the PivotTable Tools Analyze (or Options) ribbon. The pivot
table will automatically be populated with the new data. This is a feature business
managers will love!

Slicers (introduced in Excel 2010)

Excel 2010 introduced a new feature for pivot tables called a slicer. See the Slicer topic in
this tutorial for more information about this feature. Then add one or more slicers to
your pivot table.

Note: Starting in Excel 2016, there is a multi-select button at the top of a slicer. This is for
touch devices. When you click it, you can then select multiple items using touch input.

Recommended PivotTables (introduced in Excel 2013)

Excel 2013 introduced a new Recommended PivotTables button on the Insert ribbon. If
you select a cell in your data set and then click this button, Excel recommends the pivot
tables you might want. If nothing else, this at least gets you started.

Grouping on dates (introduced in Excel 2016)

Starting in Excel 2016, if you drag a date field to the Rows or Columns area, it is
automatically grouped, say, by month and year. You can then modify the grouping, or
ungroup, if you like.
ungroup, if you like.
List of Topics sheet

PivotTable button on Insert ribbon

Create PivotTable dialog box

Blank pivot table PivotTable Fields pane


PivotTable Tools Analyze ribbon (previously Options ribbon)

PivotTable Tools Design ribbon

Typical pivot table in Compact Layout

Typical pivot table in Tabular Layout


Pivot chart for pivot table above

Pivot table of counts

Pivot table with counts shown as % of row totals


Pivot table of counts shown as % of column totals

Pivot table grouped by Month


Creating a pivot table from a table
Date Day Time
3/10/2013 Sunday Morning
3/10/2013 Sunday Morning
3/10/2013 Sunday Afternoon
3/10/2013 Sunday Afternoon
3/10/2013 Sunday Afternoon
3/10/2013 Sunday Afternoon
3/11/2013 Monday Evening
3/11/2013 Monday Evening
3/11/2013 Monday Evening
3/12/2013 Tuesday Morning
3/12/2013 Tuesday Morning
3/12/2013 Tuesday Afternoon
3/13/2013 Wednesday Morning
3/13/2013 Wednesday Afternoon
3/14/2013 Thursday Morning
3/14/2013 Thursday Afternoon
3/14/2013 Thursday Afternoon
3/14/2013 Thursday Afternoon
3/15/2013 Friday Morning
3/15/2013 Friday Afternoon
3/16/2013 Saturday Morning
3/16/2013 Saturday Afternoon
3/16/2013 Saturday Evening
3/17/2013 Sunday Afternoon
3/17/2013 Sunday Evening
3/18/2013 Monday Morning
3/18/2013 Monday Afternoon
3/18/2013 Monday Evening
3/19/2013 Tuesday Afternoon
3/19/2013 Tuesday Afternoon
3/20/2013 Wednesday Morning
3/20/2013 Wednesday Afternoon
3/20/2013 Wednesday Afternoon
3/20/2013 Wednesday Evening
3/21/2013 Thursday Morning
3/21/2013 Thursday Afternoon
3/21/2013 Thursday Evening
3/22/2013 Friday Morning
3/22/2013 Friday Morning
3/22/2013 Friday Morning
3/22/2013 Friday Evening
3/22/2013 Friday Evening
3/22/2013 Friday Evening
3/22/2013 Friday Evening
3/23/2013 Saturday Afternoon
3/24/2013 Sunday Morning
3/24/2013 Sunday Morning
3/24/2013 Sunday Afternoon
3/24/2013 Sunday Afternoon
3/24/2013 Sunday Afternoon
3/25/2013 Monday Morning
3/25/2013 Monday Afternoon
3/25/2013 Monday Evening
3/26/2013 Tuesday Morning
3/27/2013 Wednesday Morning
3/27/2013 Wednesday Afternoon
3/28/2013 Thursday Morning
3/28/2013 Thursday Afternoon
3/28/2013 Thursday Afternoon
3/28/2013 Thursday Evening
3/29/2013 Friday Morning
3/29/2013 Friday Morning
3/29/2013 Friday Morning
3/29/2013 Friday Morning
3/29/2013 Friday Afternoon
3/29/2013 Friday Afternoon
3/29/2013 Friday Afternoon
3/29/2013 Friday Afternoon
3/29/2013 Friday Evening
3/29/2013 Friday Evening
3/30/2013 Saturday Afternoon
3/30/2013 Saturday Evening
3/31/2013 Sunday Afternoon
3/31/2013 Sunday Afternoon
3/31/2013 Sunday Evening
3/31/2013 Sunday Evening
4/1/2013 Monday Morning
4/1/2013 Monday Afternoon
4/1/2013 Monday Afternoon
4/1/2013 Monday Afternoon
4/2/2013 Tuesday Morning
4/2/2013 Tuesday Afternoon
4/2/2013 Tuesday Afternoon
4/2/2013 Tuesday Afternoon
4/3/2013 Wednesday Morning
4/3/2013 Wednesday Afternoon
4/3/2013 Wednesday Afternoon
4/3/2013 Wednesday Evening
4/4/2013 Thursday Morning
4/4/2013 Thursday Afternoon
4/5/2013 Friday Morning
4/5/2013 Friday Afternoon
4/5/2013 Friday Afternoon
4/5/2013 Friday Afternoon
4/5/2013 Friday Evening
4/6/2013 Saturday Morning
4/6/2013 Saturday Afternoon
4/6/2013 Saturday Afternoon
4/6/2013 Saturday Evening
4/7/2013 Sunday Evening
4/8/2013 Monday Morning
4/8/2013 Monday Morning
4/8/2013 Monday Morning
4/8/2013 Monday Evening
4/9/2013 Tuesday Morning
4/9/2013 Tuesday Morning
4/9/2013 Tuesday Morning
4/9/2013 Tuesday Morning
4/9/2013 Tuesday Morning
4/10/2013 Wednesday Morning
4/10/2013 Wednesday Morning
4/10/2013 Wednesday Afternoon
4/10/2013 Wednesday Afternoon
4/10/2013 Wednesday Evening
4/10/2013 Wednesday Evening
4/11/2013 Thursday Afternoon
4/12/2013 Friday Morning
4/12/2013 Friday Morning
4/12/2013 Friday Afternoon
4/12/2013 Friday Afternoon
4/13/2013 Saturday Afternoon
4/14/2013 Sunday Morning
4/14/2013 Sunday Afternoon
4/14/2013 Sunday Afternoon
4/15/2013 Monday Morning
4/15/2013 Monday Morning
4/15/2013 Monday Morning
4/15/2013 Monday Afternoon
4/15/2013 Monday Afternoon
4/15/2013 Monday Evening
4/15/2013 Monday Evening
4/16/2013 Tuesday Afternoon
4/16/2013 Tuesday Afternoon
4/16/2013 Tuesday Evening
4/17/2013 Wednesday Morning
4/17/2013 Wednesday Afternoon
4/17/2013 Wednesday Evening
4/18/2013 Thursday Morning
4/18/2013 Thursday Afternoon
4/18/2013 Thursday Evening
4/19/2013 Friday Morning
4/19/2013 Friday Afternoon
4/19/2013 Friday Evening
4/20/2013 Saturday Afternoon
4/20/2013 Saturday Evening
4/20/2013 Saturday Evening
4/21/2013 Sunday Morning
4/21/2013 Sunday Afternoon
4/21/2013 Sunday Afternoon
4/21/2013 Sunday Afternoon
4/22/2013 Monday Morning
4/22/2013 Monday Afternoon
4/22/2013 Monday Evening
4/23/2013 Tuesday Morning
4/23/2013 Tuesday Afternoon
4/24/2013 Wednesday Morning
4/24/2013 Wednesday Morning
4/24/2013 Wednesday Afternoon
4/24/2013 Wednesday Afternoon
4/24/2013 Wednesday Evening
4/24/2013 Wednesday Evening
4/25/2013 Thursday Morning
4/25/2013 Thursday Evening
4/26/2013 Friday Morning
4/26/2013 Friday Morning
4/26/2013 Friday Afternoon
4/27/2013 Saturday Morning
4/27/2013 Saturday Evening
4/27/2013 Saturday Evening
4/28/2013 Sunday Afternoon
4/28/2013 Sunday Afternoon

4/29/2013 Monday Morning


4/29/2013 Monday Afternoon
4/29/2013 Monday Evening
4/29/2013 Monday Evening
4/29/2013 Monday Evening
4/29/2013 Monday Evening
4/30/2013 Tuesday Morning
4/30/2013 Tuesday Afternoon
4/30/2013 Tuesday Evening
5/1/2013 Wednesday Afternoon
5/2/2013 Thursday Evening
5/3/2013 Friday Afternoon
5/3/2013 Friday Afternoon
5/4/2013 Saturday Evening
5/5/2013 Sunday Morning
5/5/2013 Sunday Afternoon
5/6/2013 Monday Morning
5/6/2013 Monday Morning
5/6/2013 Monday Morning
5/6/2013 Monday Morning
5/6/2013 Monday Morning
5/6/2013 Monday Afternoon
5/6/2013 Monday Afternoon
5/6/2013 Monday Evening
5/6/2013 Monday Evening
5/6/2013 Monday Evening
5/7/2013 Tuesday Evening

5/7/2013 Tuesday Evening


5/8/2013 Wednesday Morning
5/8/2013 Wednesday Afternoon
5/8/2013 Wednesday Evening
5/8/2013 Wednesday Evening
5/8/2013 Wednesday Evening
5/8/2013 Wednesday Evening
5/9/2013 Thursday Morning
5/9/2013 Thursday Afternoon
5/9/2013 Thursday Evening
5/9/2013 Thursday Evening
5/10/2013 Friday Morning
5/10/2013 Friday Afternoon
5/11/2013 Saturday Afternoon
5/11/2013 Saturday Evening
5/12/2013 Sunday Morning
5/12/2013 Sunday Evening
5/13/2013 Monday Morning
5/13/2013 Monday Afternoon
5/13/2013 Monday Evening
5/13/2013 Monday Evening
5/14/2013 Tuesday Evening
5/15/2013 Wednesday Morning
5/15/2013 Wednesday Morning
5/15/2013 Wednesday Afternoon
5/15/2013 Wednesday Afternoon
5/15/2013 Wednesday Afternoon
5/15/2013 Wednesday Afternoon
5/15/2013 Wednesday Evening
5/16/2013 Thursday Morning
5/16/2013 Thursday Afternoon
5/16/2013 Thursday Evening
5/16/2013 Thursday Evening
5/17/2013 Friday Morning
5/17/2013 Friday Morning
5/17/2013 Friday Evening
5/17/2013 Friday Evening
5/18/2013 Saturday Morning
5/18/2013 Saturday Afternoon
5/18/2013 Saturday Evening
5/19/2013 Sunday Morning
5/19/2013 Sunday Morning
5/19/2013 Sunday Morning
5/19/2013 Sunday Morning
5/19/2013 Sunday Afternoon
5/19/2013 Sunday Afternoon
5/19/2013 Sunday Afternoon
5/19/2013 Sunday Afternoon
5/19/2013 Sunday Afternoon
5/19/2013 Sunday Evening
5/20/2013 Monday Afternoon
5/21/2013 Tuesday Afternoon
5/21/2013 Tuesday Afternoon
5/21/2013 Tuesday Evening
5/21/2013 Tuesday Evening
5/22/2013 Wednesday Morning
5/22/2013 Wednesday Afternoon
5/22/2013 Wednesday Afternoon
5/22/2013 Wednesday Afternoon
5/22/2013 Wednesday Afternoon
5/22/2013 Wednesday Evening
5/23/2013 Thursday Evening
5/24/2013 Friday Morning
5/24/2013 Friday Afternoon
5/24/2013 Friday Afternoon
5/25/2013 Saturday Morning
5/25/2013 Saturday Afternoon
5/25/2013 Saturday Afternoon
5/26/2013 Sunday Morning
5/26/2013 Sunday Afternoon
5/26/2013 Sunday Evening
5/26/2013 Sunday Evening
5/27/2013 Monday Afternoon
5/27/2013 Monday Evening
5/28/2013 Tuesday Morning
5/28/2013 Tuesday Evening
5/29/2013 Wednesday Evening
5/29/2013 Wednesday Evening
5/30/2013 Thursday Morning
5/30/2013 Thursday Morning
5/30/2013 Thursday Afternoon
5/30/2013 Thursday Evening
5/31/2013 Friday Morning
5/31/2013 Friday Morning
5/31/2013 Friday Morning
5/31/2013 Friday Afternoon
5/31/2013 Friday Evening
6/1/2013 Saturday Afternoon
6/1/2013 Saturday Afternoon
6/1/2013 Saturday Afternoon
6/1/2013 Saturday Evening
6/1/2013 Saturday Evening
6/1/2013 Saturday Evening
6/1/2013 Saturday Evening
6/1/2013 Saturday Evening
6/2/2013 Sunday Morning
6/2/2013 Sunday Evening
6/3/2013 Monday Afternoon
6/3/2013 Monday Evening
6/4/2013 Tuesday Morning
6/4/2013 Tuesday Morning
6/4/2013 Tuesday Evening
6/4/2013 Tuesday Evening
6/4/2013 Tuesday Evening
6/5/2013 Wednesday Evening
6/6/2013 Thursday Morning
6/6/2013 Thursday Evening
6/7/2013 Friday Morning
6/7/2013 Friday Afternoon
6/7/2013 Friday Afternoon
6/7/2013 Friday Evening
6/8/2013 Saturday Morning
6/8/2013 Saturday Evening
6/8/2013 Saturday Evening
6/8/2013 Saturday Evening
6/9/2013 Sunday Afternoon
6/10/2013 Monday Afternoon
6/10/2013 Monday Afternoon
6/10/2013 Monday Afternoon
6/10/2013 Monday Evening
6/10/2013 Monday Evening
6/10/2013 Monday Evening
6/11/2013 Tuesday Afternoon
6/11/2013 Tuesday Afternoon
6/11/2013 Tuesday Afternoon
6/11/2013 Tuesday Evening
6/11/2013 Tuesday Evening
6/12/2013 Wednesday Morning
6/12/2013 Wednesday Evening
6/12/2013 Wednesday Evening
6/12/2013 Wednesday Evening
6/13/2013 Thursday Morning
6/13/2013 Thursday Morning
6/13/2013 Thursday Afternoon
6/14/2013 Friday Afternoon
6/14/2013 Friday Afternoon
6/14/2013 Friday Afternoon
6/14/2013 Friday Afternoon
6/14/2013 Friday Evening
6/15/2013 Saturday Morning
6/15/2013 Saturday Morning
6/15/2013 Saturday Morning
6/15/2013 Saturday Afternoon
6/15/2013 Saturday Afternoon
6/16/2013 Sunday Morning
6/17/2013 Monday Morning
6/17/2013 Monday Afternoon
6/18/2013 Tuesday Afternoon
6/18/2013 Tuesday Evening
6/19/2013 Wednesday Evening
6/19/2013 Wednesday Evening
6/19/2013 Wednesday Evening
6/20/2013 Thursday Morning
6/21/2013 Friday Morning
6/21/2013 Friday Morning
6/21/2013 Friday Afternoon
6/21/2013 Friday Afternoon
6/21/2013 Friday Afternoon
6/21/2013 Friday Evening
6/21/2013 Friday Evening
6/22/2013 Saturday Morning
6/22/2013 Saturday Morning
6/22/2013 Saturday Afternoon
6/22/2013 Saturday Evening
6/23/2013 Sunday Morning
6/23/2013 Sunday Morning
6/23/2013 Sunday Afternoon
6/23/2013 Sunday Evening
6/23/2013 Sunday Evening
6/23/2013 Sunday Evening
6/23/2013 Sunday Evening
6/24/2013 Monday Morning
6/24/2013 Monday Afternoon
6/24/2013 Monday Afternoon
6/25/2013 Tuesday Morning
6/25/2013 Tuesday Afternoon
6/25/2013 Tuesday Afternoon
6/26/2013 Wednesday Morning
6/26/2013 Wednesday Morning
6/26/2013 Wednesday Morning
6/26/2013 Wednesday Afternoon
6/26/2013 Wednesday Afternoon
6/26/2013 Wednesday Afternoon
6/26/2013 Wednesday Evening
6/27/2013 Thursday Morning
6/27/2013 Thursday Morning
6/27/2013 Thursday Evening
6/28/2013 Friday Morning
6/28/2013 Friday Morning
6/28/2013 Friday Morning
6/28/2013 Friday Afternoon
6/28/2013 Friday Afternoon
6/28/2013 Friday Afternoon
6/29/2013 Saturday Morning
6/29/2013 Saturday Afternoon
6/29/2013 Saturday Afternoon
6/29/2013 Saturday Afternoon
6/29/2013 Saturday Afternoon
6/29/2013 Saturday Afternoon
Region Paid With Gender Items Ordered Total Cost
West VISA Female 4 $136.97
West Mastercard Female 1 $25.55
West VISA Female 5 $113.95
NorthEast VISA Female 1 $6.82
West Mastercard Male 4 $147.32
NorthEast VISA Female 5 $142.15
West Mastercard Male 1 $18.65
South VISA Male 4 $178.34
West Cash Male 2 $25.83
MidWest Mastercard Female 1 $18.13
NorthEast Mastercard Female 2 $54.52
South VISA Male 2 $61.93
NorthEast VISA Male 3 $147.68
NorthEast Mastercard Male 1 $27.24
West Mastercard Female 3 $46.18
West VISA Male 5 $107.44
South Cash Female 6 $96.53
West VISA Female 4 $77.44
South Mastercard Male 1 $15.19
South Cash Male 1 $45.52
West VISA Male 4 $157.05
West VISA Male 2 $51.95
West Mastercard Female 9 $429.98
South VISA Female 1 $33.37
West VISA Male 3 $71.84
NorthEast Mastercard Female 5 $139.51
South Mastercard Male 3 $78.46
MidWest Mastercard Male 3 $125.13
MidWest VISA Male 1 $14.76
South Cash Female 2 $83.38
West Mastercard Female 3 $104.91
NorthEast VISA Male 4 $101.37
NorthEast VISA Female 2 $53.16
West VISA Female 2 $40.63
West VISA Female 7 $286.41
South Mastercard Female 2 $59.39
NorthEast VISA Male 4 $185.45
NorthEast Mastercard Female 2 $35.08
MidWest Mastercard Male 2 $91.62
NorthEast Cash Female 8 $155.50
West VISA Male 4 $20.89
West Mastercard Male 6 $186.29
West Cash Female 1 $42.22
West VISA Male 2 $42.19
MidWest VISA Female 1 $47.86
South Mastercard Female 3 $139.76
NorthEast Mastercard Female 6 $186.42
South Mastercard Female 1 $54.08
West Mastercard Female 3 $84.98
South Cash Female 2 $27.13
West Mastercard Female 2 $54.70
South Mastercard Female 5 $229.54
West Cash Male 4 $124.21
West VISA Female 2 $26.39
West Mastercard Female 4 $106.97
West Cash Female 8 $377.18
NorthEast Mastercard Female 1 $24.31
South Mastercard Female 1 $34.47
West Mastercard Male 3 $106.19
NorthEast VISA Male 2 $55.30
NorthEast VISA Female 2 $82.98
NorthEast Cash Male 4 $101.79
MidWest Mastercard Male 3 $99.28
NorthEast Mastercard Female 3 $100.09
NorthEast Cash Female 3 $88.91
MidWest Cash Male 2 $62.58
South VISA Female 1 $28.87
MidWest VISA Male 4 $141.29
NorthEast Cash Male 4 $66.54
South VISA Female 2 $69.03
South Mastercard Female 2 $65.51
West VISA Female 2 $35.59
South VISA Female 7 $320.18
MidWest Mastercard Male 5 $128.57
West Mastercard Male 6 $248.42
NorthEast Cash Male 2 $50.04
NorthEast Cash Male 4 $145.48
West Mastercard Female 9 $403.60
NorthEast Cash Female 6 $284.14
West Mastercard Female 1 $81.14
MidWest Mastercard Female 3 $82.36
MidWest Mastercard Female 2 $32.65
NorthEast VISA Female 6 $200.70
NorthEast Mastercard Female 3 $99.13
South VISA Female 4 $85.88
South Mastercard Male 3 $183.52
West VISA Female 2 $53.87
NorthEast Mastercard Male 3 $44.08
MidWest VISA Female 1 $82.34
South Cash Male 3 $151.29
NorthEast VISA Male 5 $87.02
MidWest VISA Male 2 $54.96
MidWest Mastercard Female 1 $65.11
NorthEast Mastercard Female 3 $76.69
NorthEast VISA Female 2 $48.38
NorthEast Cash Female 5 $76.64
NorthEast VISA Female 2 $54.08
South Mastercard Female 3 $130.00
MidWest Mastercard Female 4 $218.29
West VISA Male 1 $38.10
NorthEast VISA Male 4 $100.02
West Cash Female 4 $248.73
West Mastercard Female 2 $25.80
MidWest Cash Male 1 $52.83
West VISA Male 3 $131.89
NorthEast Mastercard Male 3 $82.69
West Mastercard Male 1 $70.03
NorthEast Mastercard Female 1 $102.86
West Cash Male 4 $174.13
South Mastercard Female 2 $49.80
MidWest Cash Female 2 $29.97
MidWest Mastercard Male 2 $82.53
South Mastercard Female 4 $142.76
NorthEast Cash Male 2 $72.58
MidWest VISA Male 2 $55.39
West VISA Female 4 $206.39
MidWest Mastercard Female 4 $245.67
NorthEast Mastercard Female 5 $265.69
South Mastercard Female 3 $124.46
NorthEast Mastercard Female 6 $206.26
South Mastercard Female 7 $306.23
South Cash Female 1 $48.12
MidWest Mastercard Male 4 $113.95
West VISA Female 6 $261.44
South Cash Male 2 $59.90
MidWest VISA Female 2 $49.73
MidWest VISA Female 3 $65.06
West VISA Male 4 $97.71
NorthEast Cash Female 1 $49.84
MidWest Cash Female 6 $233.94
West Mastercard Female 9 $370.26
West Cash Male 6 $313.11
NorthEast Cash Female 6 $141.77
South Mastercard Female 1 $27.99
MidWest VISA Female 3 $81.34
West VISA Female 2 $97.15
West Cash Male 7 $352.49
South VISA Female 3 $88.75
NorthEast VISA Female 4 $107.95
NorthEast Mastercard Male 5 $186.22
MidWest Mastercard Female 4 $159.23
MidWest Mastercard Female 2 $82.43
NorthEast Mastercard Male 4 $99.42
NorthEast Cash Male 3 $79.32
South VISA Male 3 $160.01
West VISA Male 2 $51.99
West VISA Female 8 $267.67
NorthEast Mastercard Female 9 $429.22
NorthEast Cash Female 1 $46.20
NorthEast VISA Female 5 $240.02
South Cash Male 4 $157.14
MidWest Mastercard Female 5 $140.40
NorthEast Mastercard Male 5 $204.93
South VISA Female 2 $88.18
South Cash Female 3 $95.47
South Mastercard Female 5 $224.73
West Mastercard Female 8 $344.73
NorthEast VISA Female 4 $185.32
South VISA Female 6 $297.31
South Cash Male 4 $223.32
South VISA Female 3 $164.40
West Mastercard Female 2 $123.57
NorthEast Mastercard Male 5 $236.97
West VISA Female 2 $82.75
South Cash Male 6 $307.75
MidWest Cash Female 4 $200.73
MidWest VISA Female 4 $242.06
South VISA Male 4 $215.09
NorthEast Mastercard Male 3 $162.90
West Mastercard Female 5 $214.31
South Mastercard Female 1 $42.07

MidWest Mastercard Male 3 $138.32


West Mastercard Male 2 $61.71
South VISA Male 3 $120.11
MidWest Mastercard Male 1 $72.80
MidWest Mastercard Female 2 $134.86
West VISA Male 4 $89.75
West Mastercard Female 4 $220.04
South Mastercard Female 3 $168.39
NorthEast Mastercard Male 6 $277.80
NorthEast VISA Female 3 $130.49
NorthEast Cash Male 2 $94.39
West Mastercard Female 4 $120.48
South VISA Female 6 $304.95
West VISA Female 9 $389.79
NorthEast VISA Female 4 $161.08
NorthEast VISA Female 2 $69.61
West VISA Female 3 $59.99
MidWest Mastercard Male 2 $120.78
West Cash Female 3 $82.30
South VISA Female 2 $91.88
West Mastercard Male 1 $87.10
MidWest Mastercard Female 2 $70.10
NorthEast Cash Female 2 $106.67
NorthEast Mastercard Male 1 $34.31
West VISA Male 3 $77.69
West Mastercard Female 2 $85.31
NorthEast Mastercard Female 1 $65.92

MidWest Cash Female 1 $89.98


West VISA Female 3 $102.07
South VISA Female 4 $199.83
South Cash Male 3 $134.21
South Mastercard Male 4 $188.41
West VISA Male 4 $102.72
West Mastercard Male 2 $85.63
West Cash Male 4 $206.87
South Mastercard Female 2 $141.22
West VISA Male 10 $463.40
South Mastercard Female 5 $166.54
MidWest Mastercard Female 6 $260.62
MidWest VISA Female 1 $79.16
West Mastercard Female 6 $320.40
MidWest Cash Male 2 $79.01
West Mastercard Female 2 $126.22
NorthEast VISA Male 5 $263.45
South Cash Male 3 $135.86
West VISA Male 1 $98.74
South Mastercard Female 1 $101.05
NorthEast Cash Male 7 $361.60
NorthEast VISA Female 3 $120.56
West Mastercard Female 1 $52.68
NorthEast VISA Female 3 $99.51
South VISA Female 1 $85.29
NorthEast Mastercard Female 3 $143.59
South Mastercard Female 3 $197.13
South VISA Female 3 $190.74
West VISA Male 3 $111.44
West VISA Male 3 $153.39
MidWest Mastercard Female 2 $65.40
NorthEast Mastercard Female 9 $448.20
South Mastercard Male 2 $123.19
South Mastercard Female 5 $210.28
NorthEast Mastercard Female 7 $349.46
South VISA Male 4 $290.63
MidWest Mastercard Female 3 $103.03
South Mastercard Male 2 $112.54
MidWest VISA Male 8 $399.36
South VISA Male 2 $68.18
MidWest Mastercard Male 3 $146.58
MidWest Cash Female 6 $309.50
West Mastercard Male 5 $177.96
South Mastercard Male 2 $119.46
West Cash Female 3 $119.66
MidWest Cash Female 4 $168.87
South Cash Female 4 $192.39
South VISA Female 2 $101.73
NorthEast Mastercard Male 2 $74.94
MidWest Cash Female 8 $291.30
West Cash Female 3 $161.00
West VISA Female 3 $116.01
West VISA Male 2 $74.39
NorthEast VISA Male 4 $226.25
West Cash Male 3 $135.19
West Mastercard Male 4 $126.16
South Cash Female 4 $156.30
South Mastercard Female 3 $73.42
NorthEast VISA Female 7 $310.74
NorthEast VISA Female 6 $296.26
West Cash Male 2 $115.29
West Mastercard Male 4 $212.94
South VISA Female 2 $85.93
West Mastercard Male 2 $80.02
NorthEast Cash Female 5 $286.17
South VISA Female 4 $190.27
NorthEast Mastercard Male 5 $265.24
West VISA Female 7 $353.93
NorthEast Mastercard Male 5 $314.77
MidWest Mastercard Female 2 $169.23
West VISA Female 3 $149.71
MidWest VISA Male 2 $105.35
South Mastercard Female 2 $111.47
West VISA Male 9 $441.16
MidWest VISA Female 5 $179.56
South VISA Male 2 $83.15
South Mastercard Male 4 $262.86
MidWest Mastercard Male 2 $82.51
NorthEast VISA Female 5 $290.27
West Mastercard Female 5 $223.08
NorthEast VISA Female 3 $165.77
South Mastercard Female 2 $99.81
NorthEast Mastercard Female 3 $158.95
MidWest Mastercard Female 5 $280.99
South Mastercard Female 4 $149.89
South VISA Female 7 $363.52
NorthEast VISA Male 2 $93.97
NorthEast Mastercard Female 8 $391.97
West VISA Female 5 $275.54
NorthEast VISA Male 1 $115.55
MidWest Mastercard Male 3 $125.00
South Mastercard Female 1 $103.15
NorthEast Mastercard Male 9 $256.70
MidWest VISA Female 1 $117.99
South VISA Female 2 $98.55
MidWest Cash Female 2 $112.93
South VISA Female 2 $76.30
NorthEast Cash Female 2 $129.80
South Mastercard Female 3 $140.25
NorthEast Mastercard Male 3 $149.79
NorthEast Mastercard Female 4 $172.20
West VISA Female 3 $139.85
West Cash Male 1 $96.46
West VISA Female 3 $127.83
NorthEast VISA Male 6 $215.88
NorthEast Mastercard Female 2 $133.49
West VISA Male 2 $117.33
West VISA Female 2 $107.98
MidWest VISA Female 6 $203.11
West VISA Female 5 $193.33
NorthEast Cash Male 7 $343.26
NorthEast Mastercard Male 11 $485.01
MidWest Mastercard Female 4 $221.93
West Cash Male 2 $94.04
NorthEast Mastercard Male 1 $113.37
NorthEast Cash Male 5 $188.26
West VISA Female 4 $170.19
West Cash Female 4 $224.15
NorthEast Cash Female 7 $352.32
MidWest Cash Male 4 $257.18
West VISA Male 2 $122.06
NorthEast VISA Male 4 $239.95
MidWest Mastercard Female 3 $124.44
NorthEast VISA Male 4 $116.58
MidWest Cash Female 2 $154.46
MidWest Mastercard Male 1 $76.92
South Mastercard Male 4 $194.85
South Mastercard Female 6 $367.70
NorthEast Cash Male 1 $119.50
West Mastercard Male 7 $270.94
West Cash Male 2 $94.71
South VISA Male 4 $154.01
MidWest VISA Female 5 $313.30
West VISA Male 7 $217.99
NorthEast VISA Female 3 $127.22
South Mastercard Male 1 $135.97
West Mastercard Female 1 $87.14
MidWest VISA Male 2 $96.77
West Mastercard Female 1 $74.74
South Cash Female 1 $117.48
West VISA Male 2 $132.89
NorthEast VISA Male 5 $230.26
NorthEast VISA Male 10 $451.03
MidWest Cash Female 3 $153.31
MidWest Mastercard Male 3 $117.79
West VISA Female 7 $357.32
South VISA Female 7 $374.17
NorthEast Mastercard Female 3 $122.28
West Mastercard Male 2 $122.57
South Cash Female 2 $134.59
South VISA Male 1 $134.98
MidWest Cash Male 1 $109.45
West VISA Female 3 $131.52
MidWest VISA Female 1 $88.76
South Mastercard Female 2 $174.28
West Mastercard Male 1 $100.70
NorthEast Mastercard Female 7 $387.43
West Mastercard Female 3 $160.71
South Mastercard Male 1 $105.91
West Cash Male 1 $101.46
West Mastercard Female 5 $271.67
NorthEast Mastercard Male 1 $112.74
NorthEast VISA Male 1 $96.42
NorthEast VISA Female 6 $271.48
NorthEast Mastercard Male 2 $156.79
South Cash Female 5 $249.63
West Mastercard Male 6 $278.62
NorthEast VISA Male 2 $84.46
NorthEast Mastercard Male 3 $221.17
West Mastercard Male 4 $194.79
South Mastercard Male 4 $199.22
NorthEast VISA Female 2 $141.70
MidWest VISA Female 4 $191.15
NorthEast Mastercard Female 2 $142.41
NorthEast Mastercard Female 3 $134.53
West Cash Female 7 $374.37
South VISA Female 3 $241.73
MidWest Mastercard Female 4 $278.58
South Mastercard Female 1 $106.25
South Cash Female 3 $115.71
NorthEast VISA Female 1 $78.34
West Mastercard Female 4 $216.03
West Mastercard Female 2 $140.01
NorthEast Mastercard Male 8 $458.51
West VISA Female 4 $210.60
South Mastercard Female 4 $189.49
West Cash Male 7 $359.42
West Cash Female 3 $132.06
West VISA Female 5 $252.33
MidWest Mastercard Male 2 $172.05
West Mastercard Female 4 $206.19
MidWest Mastercard Female 2 $143.98
NorthEast VISA Female 4 $276.67
MidWest VISA Male 1 $111.67
NorthEast VISA Male 6 $268.39
NorthEast Cash Female 3 $169.11
West Mastercard Male 6 $242.46
NorthEast VISA Male 4 $168.64
NorthEast VISA Female 1 $107.59
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Introduction to Data Tables

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
often called sensitivity analysis, or simply what-if analysis, and it is a key
part of most business models.

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 price decreased by y%? And so on. Data tables are
perfect for answering these types of questions in a systematic way, and
they are quite easy to create. Therefore, it is surprising that so few Excel
users are aware of data tables. This is a very valuable tool, so you should
definitely learn it!

There are two types of data tables: one-way data tables and two-way data
tables. A one-way data table has one input and any number of outputs. A
two-way data table has two inputs but only one output. Both of these are
discussed here.

You find the Data Table option (for one-way or two-way data tables)
under the What-If Analysis dropdown on the Data ribbon, as shown to the
right.

Creating a One-Way Data Table with One Output

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 you buy a new car for $20,000, make a $5,000
down payment, and finance 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 on the loan. These are affected by the four inputs in blue to the
right.

Lets 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.

To create the data table (which has already been done):

Enter a link to the output in cell L39. Specifically, because the monthly
payment was calculated with the PMT function in cell L34, enter the
formula =L34 in cell L39. Then, starting in cell K40, enter any sequence of
interest rates. Next, select the entire tablethe range K39:L44. Then
select Data Table from the What-If Analysis dropdown on the Data
ribbon. Finally, enter L31, the interest rate cell, as the column input cell in
the resulting Data Table dialog box shown to the right. There is no row
input cell, so leave it blank.

If one of the input values along the side of the data table equals the
original value of this input, this provides an internal check of your data
payment was calculated with the PMT function in cell L34, enter the
formula =L34 in cell L39. Then, starting in cell K40, enter any sequence of
interest rates. Next, select the entire tablethe range K39:L44. Then
select Data Table from the What-If Analysis dropdown on the Data
ribbon. Finally, enter L31, the interest rate cell, as the column input cell in
the resulting Data Table dialog box shown to the right. There is no row
input cell, so leave it blank.

If one of the input values along the side of the data table equals the
original value of this input, this provides an internal check of your data
table. In this example, the original annual interest rate, 6.50%, is one of
the values in the data table, and the corresponding monthly payments, in
cells L34 and L42, are both equal to $459.74, as they should be.

It is important to understand exactly what happens when you create a


data table, so read this paragraph several times until it sinks in. Excel
takes each interest rate in column K, substitutes it into the column input
cell you designated (cell L31), recalculates the monthly payment in cell
L34 with this new interest rate (and hence the link in cell L39, the one
colored gray for emphasis), and records the result in the corresponding
row of the data table. You use a column input cell because the possible
values of the input (the interest rates) are listed down a column.

You can tell that you have a data table by looking at any of the "answer"
cells, such as cell L40. It contains a formula =TABLE(,L31), 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 should create the table
as explained above. However, the formula documents what the answer
range contains.

Try it! Create a one-way data table to the right, where the monthly
payment is calculated for each price of car from $18,000 to $25,000 in
increments of $1000 (with the down payment fixed at $5000). (Scroll to
the right for the answer.)

Creating a One-Way Data Table with Multiple Outputs

It is also possible to capture multiple outputs in a one-way data table. The


extra outputs appear as extra columns of the data table. Other than this,
the data table is structured exactly as before.

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, using the same column input cell,
except that the data table range now includes column M, and there are
links to both outputs in the gray cells.

Try it! Create a one-way data table to the right that shows the monthly
payments and the total interest paid for each value of the number of
payments from 12 to 48, in increments of 12. (Scroll to the right for the
the data table is structured exactly as before.

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, using the same column input cell,
except that the data table range now includes column M, and there are
links to both outputs in the gray cells.

Try it! Create a one-way data table to the right that shows the monthly
payments and the total interest paid for each value of the number of
payments from 12 to 48, in increments of 12. (Scroll to the right for the
answer.)

Creating a Two-Way Data Table

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 has already been done):

Enter the formula =L34 for the single output in the upper left corner, cell
K102, of the data table. (Again, this cell has been colored gray for
emphasis.) Enter any sequence of down payments to the right of this and
any sequence of interest rates below this. Next, select Data Table from
the What-If Analysis dropdown, and enter L29 as the row input cell and
L31 as the column input cell as shown 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 L103. Each contains the formula
=TABLE(L29,L31), surrounded by curly brackets. This formula indicates
that cell L29 is the row input cell and cell L31 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 two-way data
tables, one for each output.

Try it! Create a two-way data table to the right that calculates the total
interest paid for each value of the number of payments from 12 to 60 in
increments of 12, and each down payment from $4000 to $6000 in
increments of $1000. Put the down payments along the top and the
numbers of payments along the side. (Scroll to the right for the answer.)

Recalculation and Data Tables

Some data tables are very long (many rows), and each value might require
the recalculation of a complex business model. Therefore, the recalculation
Recalculation and Data Tables
Some data tables are very long (many rows), and each value might require
the recalculation of a complex business model. Therefore, the recalculation
of the entire data table can take a while, several seconds or even minutes.
For this reason, Excel allows you to select the Automatic Except for Data
Tables calculation option from the Formulas ribbon, as shown to the right.
In this case, the data tables won't recalculate until you force them to by
pressing the F9 key.

Try it again! Check that the calculation setting is Automatic (the default
setting), and create any data table to the right. Next, change the calculation
setting from Automatic to Automatic Except for Data Tables and create the
data table again. You should see the same value throughout the table,
which is disconcerting. But you can press the F9 key to get the correct
answers. Then change the calculation setting back to Automatic.
List of Topics sheet

Data Table item on Data ribbon

Payment model
Price of car $20,000
Down payment $5,000
Amount financed $15,000
Annual interest rate 6.50%
Number of payments 36

Monthly payment $459.74


Total interest paid $1,550.46

Data table
Interest rate Monthly payment
$459.74
6.00%
6.25%
6.50%
6.75%
7.00%
Data Table dialog box

Data table for exercise


Price of car Monthly payment

Data table
Interest Monthly payment Total interest
$459.74 $1,550.46
6.00%
6.25%
6.50%
6.75%
7.00%
Data table for exercise
Number of payments Monthly payment Total interest

Data table of monthly payment


$459.74 $4,000 $5,000 $6,000
6.00%
6.25%
6.50%
6.75%
7.00%

Data Table dialog box

Data table for exercise


Calculation options on Formulas ribbon
Data table for exercise
Price of car Monthly payment
$459.74
$18,000
$19,000
$20,000
$21,000
$22,000
$23,000
$24,000
$25,000
Data table for exercise
Number of payments Monthly payment Total interest
$459.74 $1,550.46
12
24
36
48

Data table of total interest paid


$1,550.46 $4,000 $5,000 $6,000
12
24
36
48
60
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Goal Seek: Solving One Equation in One Unknown

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 equal a specified value.

A simple example of this appears below and 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 fixed and variable costs of production.
The company wants to find the breakeven price, that is, the price that
makes profit equal to 0. This breakeven price can be found with Goal
Seek. Here are the steps. (Before you do this, you might see if you can
find the breakeven price by trial and error, by entering different values in
cell L32. If nothing else, this will help you understand the model better,
and it will give you a better appreciation of Goal Seek.)

1. Choose Goal Seek from the What-If Analysis dropdown on the Data
ribbon (see to the right)

2. Fill in the Goal Seek dialog box as shown to the right. Specifically, the
price in cell L32 should be changed so that the profit in cell L39 is driven
to 0.

If you try this, you will see the Goal Seek Status dialog box to the right,
and you will see that the the price should be set to $22.57. This price
makes demand equal to 3900, so the company sells 3900 units and
makes $2.57 on each of them, which is just enough to offset the $10,000
fixed cost. The calculations with this unit price are shown in column N.

Try it! Use Goal Seek to find the price that makes profit equal to $30,000.

Note: For numerical reasons, Goal Seek doesn't force profit to exactly the
value you specify; it sometimes only gets close. If this isn't close enough,
you can change an Excel setting to make it closer. Go to Excel Options
and choose the Formulas group. (See below and to the right.) Then
change the "Maximum Change" to a smaller value (more zeros to the
right of the decimal).
List of Topics sheet

Goal Seek item on Data ribbon

Goal Seek dialog box

Goal Seek Status dialog box

Profit model
Fixed cost $10,000 $10,000
Variable cost $20.00 $20.00
Unit price $25.00 $22.57

Demand curve (linear)


Intercept 4000 4000
Slope -5 -5
Demand 3875 3887.137

Profit $9,375 $0

Maximum Change Setting in Excel Options


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Optimizing with Solver

Solver is an add-in that ships with Excel but is developed by Frontline Systems,
not Microsoft. It is used for constrained optimization models. There is much
more about Solver models than can possibly be covered here, but basically,
you must first develop a spreadsheet model that starts with numerical inputs
and values of decision variables (called changing cells), and then uses
formulas that capture the business logic and eventually lead to an objective,
such as profit or total cost, that you want to maximize or minimize. Then you
fill out a Solver dialog box to indicate the objective, the changing cells,
constraints that must be satisfied, and appropriate options. When you click
the Solve button, the add-in uses powerful algorithms to find the optimal
solution.
A simple optimization model appears to the far right. The objective is to find
the minimum-cost way to send units of some product from manufacturing
plants to customer regions so that plant capacities are not exceeded and
regional demands are met. The blue ranges contain given inputs (the unit cost
of transportation from plant sites to regions, the demands in the regions, and
the capacities of the plants), the red cells are the changing cells, and the gray
cell is the objective to minimize. You can check the formulas in the yellow and
gray cells that capture the business logic. The formulas are very simple for this
model, but the logic can be much more complex in other models.

You then invoke Solver from the Data ribbon and fill out its main dialog box as
shown to the right for Excel 2010 or later versions. (Scroll down for equivalent
screenshots in pre-2010 versions of Solver. There you have to go to an
Options dialog box to complete the settings.) When you click the Solve
button, you will see the Solver Results dialog box shown to the right, and the
solution in the red changing cells to the right will be found, regardless of the
original values in the red cells. This solution minimizes total cost, while
satisfying capacity and demand constraints.

Note: If Solver is not on your Data ribbon, you will need to add it in. Click the
File menu and Options in Excel 2010 or later (or the Office button and then
Excel options in Excel 2007), then Add-ins, and then the Go button. Check the
Solver item to add it in. If Solver isn't in the list below, you will need to run the
Office installer to install it.

Add-Ins list with Solver checked


Improved Solver
Solver was upgraded in Excel 2010. If you have used earlier versions of Solver, you
will see two basic changes.

First, the user interface has been streamlined, as shown to the right. In particular, for
most optimization models, you no longer need to go to the Options dialog box. You
can now check the nonnegativity option and choose an appropriate Solver algorithm
from this initial screen.

Second, there is an extra algorithm, Evolutionary Solver, available for complex


"nonsmooth" optimization models. This was available only in Premium Solver before
Excel 2010, not in the standard Solver that accompanied Excel. Now you get
Evolutionary Solver with Excel.

Actually, there are other differences "under the hood" in the improved Solver. In
short, it works better. Frontline Systems has many Solver products, one of which was
known as Premium Solver (and had to be purchased separately). Now the improved
Solver introduced in Excel 2010 is essentially the old Premium Solver.
short, it works better. Frontline Systems has many Solver products, one of which was
known as Premium Solver (and had to be purchased separately). Now the improved
Solver introduced in Excel 2010 is essentially the old Premium Solver.
List of Topics sheet

Solver button on Data ribbon Solver model

Unit shipping costs


From

Solver dialog box settings

Units shipped
From

Total cost

Solver Results dialog box


Solver dialog box in pre-2010 versions Solver Options dialog box in p
Solver model
To
Unit shipping costs Region 1 Region 2 Region 3 Region 4
Plant 1 $131 $218 $266 $120
Plant 2 $250 $116 $263 $278
Plant 3 $178 $132 $122 $180

To
Units shipped Region 1 Region 2 Region 3 Region 4 Total shipped Capacity
Plant 1 150 0 0 300 450 <= 450
Plant 2 100 200 0 0 300 <= 600
Plant 3 200 0 300 0 500 <= 500
Total received 450 200 300 300
>= >= >= >=
Demand 450 200 300 300

$176,050
Solver Options dialog box in pre-2010 versions
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Power BI

Power BI, short for "self-service power business intelligence," is a suite of


tools Microsoft has been developing in the past several years, starting
with Excel 2010. These powerful tools, including Power Query, Power
Pivot, Power View, and Power Map, enable you to build powerful
applications in Excel for importing data from a variety of sources,
analyzing the data with pivot tables and other tools, and creating reports
and 3D maps of the data. These Power BI tools rely on the relatively new
Excel Data Model, which allows you to store large multi-table data sets,
along with the relationships between the tables, inside Excel. The term
"self-service" implies that typical Excel users like yourself can import,
analyze, and report data in a variety of ways, without having to rely on IT
departments to generate the results you need.

The Power BI tools, especially their user


interfaces, have changed rapidly over the
past few years, and they continue to change.
Therefore, there is no guarantee that the
screenshots and explanations provided in
this section of the tutorial will be completely
accurate when you try them. The basic ideas
will probably change very little, but you will
probably have to experiment to get used to
the changing user interfaces.

In addition, Microsoft offers several versions


of Office, and not all of them include all of
the Power BI tools discussed here. At this
writing, you should have a Professional Plus
or higher version to ensure that you have all
of the Power BI tools -- but even this could
change in the future.

Note that the "Power" topics in this section


all indicate "introduced in Excel 2016." This
isn't strictly true. These Power tools have
been available in one way or another
(usually as free add-ins) for Excel 2013 or
even Excel 2010. However, they are all
available as part of Excel 2016, at least for
versions of Office Professional Plus or higher.
been available in one way or another
(usually as free add-ins) for Excel 2013 or
even Excel 2010. However, they are all
available as part of Excel 2016, at least for
versions of Office Professional Plus or higher.
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Data Model

The Data Model introduced in Excel 2013 is a technology that lets you work with
multiple-table data sets, all within Excel. The tables can be from a variety of sources,
including text files, Web pages, relational databases, and others. Also, because of the
special way the data are stored in a Data Model, the tables can be huge, even multi-
million row tables. Excel tools can then be used to relate the tables (assuming they
are relatable through key fields). Finally, pivot tables or reports can be created from
the underlying Data Model. Similar functionality has been possible in Excel for years,
but it always required you to create a relational database first, with Access or another
database system, or relate Excel tables with multiple VLOOKUPS. Now you can do it
much more easily, entirely with Excel tools.

Once you have a Data Model in an Excel workbook, you will probably use Power Pivot
to create pivot tables based on the data. In fact, it is easy to confuse Data Model with
Power Pivot, and many users believe that they are the same thing. They are not.
Actually, your version of Office, such as Office 365 Home, might contain the Data
Model but not Power Pivot. (You get Power Pivot only with a higher version of Office,
such as Professional Plus.) In this case, the Data Model allows you to store and relate
tables from various sources, and to build pivot tables (or reports) from the data.
However, without Power Pivot, you don't get a user interface for working with the
Data Model, and you don't get various advanced tools available with Power Pivot.
If you have Power Pivot, you can learn some of its tools from the Power Pivot topic in
this tutorial. But even if you don't have Power Pivot, you can still use the Data Model
to perform powerful data analysis, as discussed next.

Important note: The following instructions apply to Excel 2013 or later with Power
Pivot installed. (The screenshots come from Excel 2016, and there might be slight
differences in Excel 2013.)

Assume there are three sources of external data: (1) an Access database with five
tables, related as shown above to the right; (2) a Stores file in Excel which will
eventually be related to the Sales table through the StoreKey fields; and (3) a comma-
delimited (csv) Geography file which will eventually be related to the Stores table
through the GeographyKey fields.

To create a Data Table from these sources:

1. Click the Manage button on the Power Pivot tab. This takes you to a Power Pivot
window where you can manage, and see, your eventual Data Model. The window has
several tabs and associated ribbons, but only the Home ribbon is used here.

2. Select From Access from the From Database dropdown. Browse to the Access file
and then check all of the tables, all five of them, to be imported. Once you click
Finish, the data will not be loaded into physicial Excel tables; they will be loaded into
the Data Model.

2. Repeat step 1 for the single table in the Stores file. This time you will select Excel
File from the From Other Sources list. The user interface will be slightly different, but
the process is straightforward. (In the second step of the wizard, it is a good idea to
change the Friendly Name from Data to Stores, which shows up in the tab to the
right.)

3. Repeat step 2 with obvious modifications to import the data from the Geography
file. This time you will select Text File from the From Other Sources list.

4. The imported data now appear as seven tabs in Data View of the Power Pivot
window, very much like an Excel spreadsheet.

5. You can click the Diagram View button to see the relationships between the tables.
The first five tables are already related because they were related in the Access file.
change the Friendly Name from Data to Stores, which shows up in the tab to the
right.)

3. Repeat step 2 with obvious modifications to import the data from the Geography
file. This time you will select Text File from the From Other Sources list.

4. The imported data now appear as seven tabs in Data View of the Power Pivot
window, very much like an Excel spreadsheet.

5. You can click the Diagram View button to see the relationships between the tables.
The first five tables are already related because they were related in the Access file.
However, the Stores and Geography tables need to be related. This can be done by
dragging from the StoreKey field in the Sales table to the StoreKey field in the Stores
table, and dragging from the GeographyKey field in the Stores table to the
GeographyKey field in the Geography table. The completed diagram view is shown to
the far right.

You have now created a Data Model, which is really just a set of related tables. It is
stored with the Excel file, but it is stored very compactly, and you can see it only in
the Power Pivot window. Then you can click the PivotTable button on the Home
ribbon of the Power Pivot window to create a pivot table in the usual way, based on
any or all of the related tables. Alternatively, you can close the Power Pivot window
and create a pivot table in the usual way from the Insert ribbon, as shown below.
Note, however, that the source for the pivot table is now the Data Model.

The method explained here for creating a Data Model is not the only possible
method. Watch the companion video to see another slightly different method.
Access database related tables

Stores table in Excel

Geography data in text file

Data View in Power Pivot Window


Diagram View in Power Pivot Window
Diagram View with all tables related
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Power Pivot

The Excel Data Model, described in another topic in this tutorial, lets you
relate tables of data much like relational database software has been doing
for decades, but now it is done entirely inside Excel. The current topic
discusses Power Pivot, arguably the most popular component of the Power BI
suite. Power Pivot, as the name suggests, is related to pivot tables, but Power
Pivot is more flexible and provides more powerful tools than normal pivot
table tools. In part, it is a front end, or user interface, for working with the
Data Model, but it is much more. You can build pivot tables from a Data
Model without using Power Pivot, but Power Pivot makes the process easier
and it provides many advanced options.

Power Pivot does not ship with all versions of Office. At least for Office 2016,
you need the Professional Plus version or higher. And even if you have Power
Pivot, it is an add-in that you need to load. To do so, make sure the Developer
tab is visible. (If it isn't, right-click a ribbon, select Customize the Ribbon, and
check the Developer item in the right pane of the resulting Customize dialog
box.) Then check the Power Pivot item in the COM add-ins list. (If this item is
not in your list, then your version of Office does not include Power Pivot.)
Once Power Pivot is loaded, you will see a Power Pivot tab with the
associated ribbon shown to the right.

Probably your first question is how the Data Model and Power Pivot benefit
you. Here are the main benefits:

1. The Data Model and/or Power Pivot let you merge data from multiple
tables without using database software or VLOOKUPs within Excel. As the
Data Model topic in this tutorial indicates, it is now easy to manage
relationships across tables by using primary and foreign keys, all within Excel.

2. The Data Model and/or Power Pivot enable you to base a pivot table on
huge tables with millions of rows. They are limited only by the 2GB maximum
file size for a workbook and your computer's available memory.

3. With Power Pivot, you can create measures with the DAX (Data Analysis
Expressions) language. This is probably the most difficult part of Power Pivot
to master, but it is worth the effort. Measures with DAX provide many more
possibilities than regular pivot table calculated fields, and they can be
extremely powerful. (Note: Microsoft has gone back and forth on the
terminology. The original term used was "measures." Then in Excel 2013, they
were renamed "calculated fields." Now with Excel 2016, the original term
"measures" is back, and most analysts are glad to see it. In addition, Microsoft
finally had the sense to put a space between Power and Pivot!)

The rest of this explanation assumes that you do have Power Pivot and that it
is loaded. Now you are ready to get started. Because the procedure requires
quite a few steps, only a brief discussion of the procedure is given here.

As shown to the right, there is a Manage


button on the Power Pivot ribbon. You use this
to open a Power Pivot window, which is
basically a backstage view for managing your
Data Model, a set of tables in Excel that will
eventually be related. If you have used Access,
the Power Pivot window will look fairly familiar.
(See the two screenshots to the right.) It allows
button on the Power Pivot ribbon. You use this
to open a Power Pivot window, which is
basically a backstage view for managing your
Data Model, a set of tables in Excel that will
eventually be related. If you have used Access,
the Power Pivot window will look fairly familiar.
(See the two screenshots to the right.) It allows
you to view, create, and manage relationships
between tables. That is, it enables you to
manage your Data Model in an intuitive
manner. Then back in Excel or in the Power
Pivot window, you can build pivot tables from
the data in your Data Model in the usual way.

Two important possibilities in the Power Pivot


window are worth mentioning. First, as
discussed earlier, you can create measures with
the new DAX language. For example, given
SalesAmount, TotalCost, and ReturnAmount
fields, you can create a measure called Profit
with the formula =SUM([SalesAmount])-
SUM([TotalCost])-SUM([ReturnAmount]),
where the square brackets are required. Then
Profit can be used in a pivot table. Actually, if
you drag an existing field like SalesAmount to
the Values area of a pivot table, an implicit
measure, SUM([SalesAmount]), is created, so
that SalesAmount is summarized by the Sum
function. Fortunately, you can create other
explicit measures, like the Profit measure just
described, for summarizing in a pivot table.

Second, you can create hierarchies, such as the


hierarchy ProductCategory,
ProductSubcategory, ProductName for
products, or Year, Quarter, Month, Day for
dates. Then you can add these hierarchies to
the Rows or Columns area of a pivot table,
which allows you to drill down for insightful
information. Fortunately, this is very easy to do.

Again, this discussion only scratches the surface


of what you can do with Power Pivot and its
powerful DAX language. To learn more, you
which allows you to drill down for insightful
information. Fortunately, this is very easy to do.

Again, this discussion only scratches the surface


of what you can do with Power Pivot and its
powerful DAX language. To learn more, you
should search for discussions on the Web or
read one of the recent books on Power Pivot.
This will be time well spent because the skills
you will learn are becoming increasingly
valuable in the business world.
List of Topics sheet

COM Add-Ins button on Developer ribbon

Power Pivot in COM Add-Ins

Power Pivot ribbon

Power Pivot window with a data model (data view)


Power Pivot window with a data model (diagram view)
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Power View

Power View is an add-in in the Power BI suite that lets you create quick but
insightful reports based on data in a Data Model.

Power View does not ship with all versions of Office. At least for Office 2016,
you need the Professional Plus version or higher. And even if you have Power
View, it is an add-in that you need to load. To do so, make sure the Developer
tab is visible. (If it isn't, right-click a ribbon, select Customize the Ribbon, and
check the Developer item in the right pane of the resulting Customize dialog
box.) Then check the Power View item in the COM add-ins list. (If this item is
not in your list, then your version of Office does not include Power View.)

Once Power View is loaded, you should see a Power View item on one of the
ribbons -- but you don't. For some reason, Microsoft deleted the Power View
button that was on the Insert ribbon in Excel 2013. However, it is still available
by customizing the ribbon. To do so, right-click any ribbon, select Customize
the Ribbon, select Insert a Power View Report from the All Commands list on
the left, and drag it to a ribbon (and a position on the ribbon) of your choice. I
did this, adding the Power View button to the Insert ribbon (as it was in Excel
2013), as shown to the right.

The rest of this explanation assumes that you do have Power View and that it
is loaded and available. Now you are ready to get started. Because Power
View provides so many options, only a brief discussion is given here.

Once you have built your Data Model, you can


use Power View to create reports that are
based on your Data Model. You do this by
clicking the Power View button (on whichever
ribbon you inserted it). This creates a new
Power View interactive worksheet. Depending
on what is selected, new tabs and associated
ribbons become available, and the Power View
pane on the right changes appropriately. The
various options allow you to create lists, bar
charts, column charts, and even maps of your
data broken down in many possible ways by
the fields in the various (related) tables of the
Data Model. See to the right for three
possibilities. (Be aware that maps use the Bing
search engine, so you must have an active
Internet connection.)
Again, this discussion only scratches the surface of what you can do with
Power View. To learn more, you should search for discussions on the Web or
read one of the recent books that discusses Power View.
search engine, so you must have an active
Internet connection.)
Again, this discussion only scratches the surface of what you can do with
Power View. To learn more, you should search for discussions on the Web or
read one of the recent books that discusses Power View.
List of Topics sheet

COM Add-Ins button on Developer ribbon

Power View in COM Add-Ins

Power View button on Insert ribbon

Power View table


Power View map

Power View map with a tile for product category


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Power Map (introduced in Excel 2016)

The 3D Map option, available on the Insert ribbon, implements the Power
Map tool in the Power BI suite. It lets you create maps of geographical
information with a few clicks. The example to the right is typical. The data
set lists the numbers of customers for some product in various states and
cities. To get the map on the right, just select any cell in the data range
and click Open 3D Maps. A 3D map opens in a new window, and from
there, it is just a matter of adding elements to the map. You could State
probably read a long explanation of the various options, but it's better to California
simply experiment. The map shown, with a bubble for each city with size
proportional to the number of customers, required only a couple mouse California
clicks. California
Florida
The map to the right is a static map. To make it dynamic, you could change
the data set to have a date column, with the number of customers in each Florida
city and state listed for each date. Then you could "play" the resulting map Florida
to show the changes in time.
Florida
Try it! Do exactly what the preceding paragraph suggests. You can make Florida
up the dates and the customer data. Michigan
Michigan
Michigan
Michigan
New York
New York
New York
New York
Texas
Texas
Texas
Texas
City Customers
Los Angeles 43498
San Francisco 28760
Sacramento 15083
Tallahassee 5963
Miami 29036
Orlando 22176
Tampa 25735
Jacksonville 16327
Detroit 38216
Ann Arbor 12741
East Lansing 7667
Grand Rapids 10145
New York 41963
Buffalo 22336
Rochester 18605
Syracuse 12470
Houston 37776
Dallas 40597
San Antonio 18013
Austin 23476
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

New Query options


Power Query (introduced in Excel 2016)

As discussed in the Importing External Data section of this tutorial, Excel


has long contained a number of tools for importing data, and these "old"
tools continue to work fine. However, Microsoft has recently been
developing newer and better tools for importing data, and these newer
tools are collectively referred to as Power Query. Starting in Excel 2016,
they are built into Excel, and you can find them on the Data ribbon in the
Get & Transform group, as shown to the right.

It is important to realize that Power Query continues to evolve, so the


screenshots and explanations given here might have changed by the time
you read this. However, the ideas presented here should still be relevant.

The screenshots to the right indicate the possible sources of data when
you click the New Query dropdown. As an example, if you query the
Northwind Access database, this leads to the Power Query Navigator to
the right. If you choose the Products table, you see a preview of the data
in this table. By clicking the Edit Query button, an Editor opens with a
variety of options for "shaping" the query.

There are multiple ways to use Power Query to "join" relatable tables.

1. For tables from a relational source such as Access, you can join the
tables inside Access and save the result as an Access query. Then you can
use Power Query to import this saved query as a table.

2. You can use Power Query multiple times, each time importing a single
table. Then you can use its Merge option to join the queries, resulting in
a single joined table.

3. You can use Power Query multiple times, each time importing a single
table. Then you can use its Load To option to load each table to an Excel
Data Model. Then you can use Excel's Relationships tool to create
relationships between the tables. Power Query Navigator

Note that any queries you create with Power Query are saved with the
Excel workbook. Then to see and possibly edit any of them, you can click
Show Queries on the Data ribbon. This opens a Workbook Queries pane
at the right of the worksheet.

If you are used to the older tools for importing data into Excel, you might
question whether it is worth your time to learn a new set of tools. There
are several good reasons for doing so.

1. You can connect to more data sources, including Facebook, OData


feeds, and others, and the list will almost certainly grow in the future.

2. Even when the Power Query sources are the same as with Get External
Data, Power Query improves on the native functionality. For example,
Power Query is able to extract from far more Web pages than the "From
Web" option in Get External Data.

3. Queries with Power Query are saved as a series of steps, so they can
be automated with a single click at a later time. This saves a lot of
repetitive work if you perform the same types of queries on a regular
basis.

4. Power Query provides tools in its user interface for filtering,


aggregating, sorting, and other operations. In short, it provides a simpler
and friendlier environment for managing queries.
Web" option in Get External Data.

3. Queries with Power Query are saved as a series of steps, so they can
be automated with a single click at a later time. This saves a lot of
repetitive work if you perform the same types of queries on a regular
basis.

4. Power Query provides tools in its user interface for filtering,


aggregating, sorting, and other operations. In short, it provides a simpler
and friendlier environment for managing queries.

5. Assuming you have the right version of SharePoint, you can share
queries from Power Query with other users.

Power Query Editor


New Query options From File options From Database options

From Other Sources options Combine Queries options

Power Query Navigator


Power Query Editor
abase options

Queries options
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Get External Data on Data


Introduction to Importing External Data into Excel

Excel's strength lies in its ability to analyze data. However, the data you
want to analyze will not always reside in an Excel worksheet. The data
might be on a Web site, in a text file, in a database, or in some other
source. The question, then, is how you can import the required data into
Excel. Fortunately, Excel has some very powerful tools for importing data,
both "old" and "new." The older tools, discussed in this section of the
tutorial, have been part of Excel for years, and they still work fine. You can
find them in the Get External Data group on the Data ribbon, shown to
the right. (Depending on the size of the Excel window, the Get External
Data group might appear as a single Get External Data dropdown.)

The newer tools comprise Power Query, part of the Power BI suite that is
discussed in another section of this tutorial. These tools are in the Get &
Transform group to the right of the Get External Data group.

Many Excel users are comfortable using the older tools and will probably
continue to use them (assuming that Microsoft continues to support
them). However, if you are new to importing external data, we highly
recommend the newer Power Query tools.
Get External Data on Data ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Importing Data from a Text File

Data sets are often stored in "plain vanilla" text files, usually with a .txt, .dat,
or .prn extension, simply because everyone can view text files. All you need is
a text editor, such as Notepad. Fortunately, Excel has a wizard for importing
data from a text file into Excel. It is easy to use, but you have to be careful that
everything lines up properly in the import.

Text files come in two varieties: fixed width and delimited. In a fixed width
data set, each variable starts in the same column. For example, First Name
might be in columns 1-15, Last Name might be in columns 16-30, and so on.
This is a carryover from the old days of IBM punched cards, but fixed width
text files are still fairly common. In contrast, in a delimited text file, pieces of
data are separated by a delimiter character, the most common being a space,
a tab, a common, and a semicolon. You can tell that a data set is delimited
when you open it in a text editor and see that the columns don't line up; they
are "ragged."

Once you understand this distinction, importing text data is easy. To do so,
click the From Text button in the Get External Data group on the Data ribbon
(see to the right), and then browse to find your text file. This launches a
three-step wizard, shown in the three dialog boxes to the right.

In the first dialog box, you can see from the data in the first few rows that the
data are not fixed width, so Delimited is the correct choice. You also have the
option to start the import at a row other than the first row. Text files often
have data you don't want to import in the first few rows.

In the second dialog box, you can choose the delimiter, in this case, a comma.

In the third dialog box, you can fine-tune the import, but it usually suffices to
click the Finish button. If any fine-tuning is necessary, you can do it in Excel.

There is a final dialog box, not shown here, where you can select the location
of the imported data. For this example, the imported data are listed below.

Always look carefully at the imported data to make sure everything lines up
correctly. If it doesn't, you have to fix the imported data or fix something in
the original text file. One "small" error, such as when some of the Salary
values end up in the Age column, can completely mess up the data to be
analyzed.

Note: Starting in Excel 2016, another option is to use Power Query, which is
discussed in another topic in this tutorial. (You select From File and then From
Text from the New Query dropdown.
Faculty Support StaSupply Budget
Credit HourResearch Pubs
Business
150 70 5
15 225
Education
60 20 3
5.4 70
Arts & Sciences
800 140 20
56 1300
HPER
30 15 1
2.1 40

No. 2
List of Topics sheet

From Text button on Data ribbon

Step 1 of Text Import Wizard

Step 2 of Text Import Wizard


Step 3 of Text Import Wizard
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

From Access button on Da


Importing Data from a Database

The other topics in this section of the tutorial explain how to import data
from the Web or from a text file. Although these operations are common,
they probably aren't as common as the importing method described
here: importing data from a database. This is a huge topic, and this
tutorial only scratches the surface.

There are many database packages available for storing data, including
Microsoft Access (part of the Office suite) and many server-based
systems such as Microsoft's SQL Server, Oracle's RDBMS, IBM's DB2, and
others. Fortunately, all of these store data in essentially the same way: as
related tables, where each table stores information about a particular
entity such as a product, a customer, or a vendor. Also, they all use
essentially the same query language, Structured Query Language, or SQL,
to retrieve specific subsets of the data. Because of this commonality
across database packages, technologies have been developed over the
past two decades that allow users, often programmers, to import
database data into applications, including Excel.

The simplest way to import database data into Excel, and the only one
described in detail here, is to use the From Access button in the Get Named queries (top icons
External Data group on the Data ribbon, shown above and to the right.
After you then browse for an Access database file, you have two options.
The first is to import one or more tables. (The option to select multiple
tables was introduced in Excel 2013.)

The second possibility is more flexible. You can import data from a
named query in an Access file. For example, the list to the right includes
several named queries from the famous Northwind database provided by
Microsoft. This means that you should first create queries of interest in
Access, and save them, before importing the data into Excel. Of course,
this assumes that you know how to create queries through Access's user
interface. This is not difficult, but it takes some practice.

Other import options appear under the From Other Sources dropdown
list shown to the right. The most common of these is From Microsoft
Query. Only the outline of the procedure is given here. Basically, it is a
three-step process.

1. You identify the data source and the type of database you have:
Access, SQL Server, Oracle, or whatever. In case of a server-based system,
you must identify the server and probably provide a valid username and Microsoft Query in the Fro
password.

2. You create a query for the data you want. You can do this through a
user interface that is very similar to the one in Access, or you can enter
an SQL statement directly.

3. You tell Microsoft Query to return the data to Excel, in a location of


your choice, either as a table or a pivot table.

This procedure creates a link to the underlying database source, so that if


there are changes to the database, you can do a refresh in Excel to get
the latest data.
Note: Starting in Excel 2016, another option is to use Power Query, which
is discussed in another topic in this tutorial. (You select From Database
and then From Microsoft Access Database from the New Query
dropdown.
This procedure creates a link to the underlying database source, so that if
there are changes to the database, you can do a refresh in Excel to get
the latest data.

Note: Starting in Excel 2016, another option is to use Power Query, which
is discussed in another topic in this tutorial. (You select From Database
and then From Microsoft Access Database from the New Query
dropdown.
From Access button on Data ribbon

Named queries (top icons) and tables (bottom icons) in Northwind database

Microsoft Query in the From Other Sources list on the Data ribbon
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Web Queries

To say the least, there is an abundance of interesting data on the Web. Because
Web authors can design their sites in a variety of ways, there is no guarantee
that the Web data can be imported easily into Excel, but it is worth trying with a
Web query, a simple and powerful tool.

To understand how Web queries work, you need to understand a little about
Web pages. They are all written in HTML, a markup language that has "tags" to
identify different parts of a page. One such tag is the Table tag. It often indicates
a rectangular array of data, but it is also used for all sorts of things that aren't
really tables. In any case, a Web query can import anything that is surrounded
by table tags. You can then decide which "tables" are of interest to you.

Try it! First open your browser, locate a website that has data you want to
import, and copy its URL. For this example, you could use the URL for monthly
IBM stock prices from November 2013 back to 2000:

http://finance.yahoo.com/q/hp?
s=IBM&a=0&b=1&c=2000&d=10&e=1&f=2013&g=m

Then, starting in a blank workbook, click From Web in the Get External Data
dropdown on the Data ribbon, as shown above and to the right. This opens the
New Web Query dialog box to the right. Paste your URL into the Address box
and click Go. The Web page will open, hopefully with one or more yellow
arrows corresponding to the table tags on the page. Find the one(s) you want
and click them, which changes them to green check marks. Then click Import.

The Import Data dialog box to the right lets you choose where to start the
import. Just make sure there is plenty of blank space below and to the right of
the selected cell. Note that not all of the data are imported. This particular
website sends back only a certain number of data items per query.

Excel remembers the source of this data and keeps a link to it. The connection in
the current workbook was removed, but to see it in your own workbook, you
can click the Connections button on the Data ribbon. You will see the Workbook
Connections dialog box to the right. (The connection has the generic name
Connection, but it can be renamed as shown. ) From here, you can do several
things. First, in case the Web data change through time, you can click Refresh to
get the newest data. Second, you can click Properties, then the Definition tab,
and then the Edit Query button to return to the New Web Query dialog box.
Finally, if you don't want a live link to the website, you can click Remove, as was
done here.

Note: Unfortunately, the Web query method described above doesn't work on a
lot of promising websites. The good news, however, is that, starting with Excel
2016, you can import Web data with Power Query, described in another topic in
this tutorial. (You select From Other Sources and then From Web from the New
Query dropdown.) Our experience is that the Power Query method works on
many websites where the "old" method described above does not work.
List of Topics sheet

From Web button on Data ribbon

New Web Query "mini-browser"

Import Data dialog box

Workbook Connections dialog box


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

General Documentation

There is nothing worse than getting a spreadsheet from someone with no


documentation. All you see are loads of meaningless numbers and possibly a
few not-well-thought-out labels. This is a very poor 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 should use descriptive labels and a clear, logical
structure, but you can do more than this. For example, you can include cell
comments and text boxes, as explained below.

Insert comment
Cell Comments

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 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 the gray cell to the right: Sales
are in $1000s. Then change the comment to: Monthly sales in $1000s.
Then delete the cell comment.

For more on cell comments, visit the Comments group on the Review
ribbon. You might not ever use all of these buttons, but they could be
handy if someone gives you a spreadsheet with a lot of cell comments,
and you want to browse through them quickly.

Text Box button in (right s


Text Boxes

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.? Many people do this, but 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 the Text Box button on the Insert ribbon, as
shown to the right, and drag a text box in some area of the worksheet.
next line, etc.? Many people do this, but 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 the Text Box button on the Insert ribbon, as
shown 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 it twice so that the border becomes a solid line. (It's a dashed line
after the first click). Then you will see a Drawing Tools Format tab and
associated ribbon where you can make all sorts of changes. For example,
in this tutorial all text boxes are rounded in two corners and have a blue
border. If you like the appearance, you can right-click the text box 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. Then see if you
format it like the text boxes in this tutorial.

Note again that if you click a text box once, its border becomes a dashed
line. If you then click it again, it becomes a solid line. The options
available are slightly different in these two cases. For example, if you
want to delete a text box, you should make the border a solid line and
then press the Delete key. In contrast, if you press the Delete key when
the border is dashed, you will delete some text.

Format Shape dialog box

Positioning of Text Boxes (and other shapes)

When you add text boxes (or other shapes such as circles, rectangles, and
arrows) to a worksheet, they essentially "float" above the worksheet cells. If
you then insert rows or columns under these shapes, or if you change row
heights or column widths under them, the shapes might move or expand. You
might want this behavior, or you might not. In either case, you can control the
behavior. To do so, right-click a shape, such as a text box, and select Size and
Properties. The dialog box to the right appears. (This is for Excel 2013, where
the user interface changed noticably.) You can then select the "Object
positioning" option you want under Properties. For example, if you want the
shape to stay fixed in the same size and position, select the "Don't move or
size with cells" option, as shown here.

Shapes dropdown list on I


Using Shapes for Emphasis

Using shapes, such as red ovals for emphasis, is another documentation


possibility. Actually, the red ovals you see in the tutorial's screenshots, such as
the one above, were created in the screen capture software itself, but they
could also be created with Excel's shapes. As you can see to the right, Excel
provides many shapes to choose from.
Using Shapes for Emphasis

Using shapes, such as red ovals for emphasis, is another documentation


possibility. Actually, the red ovals you see in the tutorial's screenshots, such as
the one above, were created in the screen capture software itself, but they
could also be created with Excel's shapes. As you can see to the right, Excel
provides many shapes to choose from.

By default, a shape such as an oval is opaque, with a blue fill and a darker blue
border. But if you select it, you get the Drawing Tools Format tab and
associated ribbon, where you can format the shape in an endless number of
ways.
Insert comment Edit or Delete comment Sales
15.3
14.7
9.6
12.1
14.2

Text Box button in (right side of) Insert Ribbon


Format Shape dialog box

Shapes dropdown list on Insert menu


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Conditional Formatting bu
Background on Conditional Formatting

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 Conditional Formatting op
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 many users didn't even know it was available. Now it is
very prominent, right in the middle of the Home ribbon, as shown to the
right. It is also much easier to use. As illustrated here, most uses of
conditional formatting are really easy, but a few are tricky.
The user interface for conditional formatting is shown in the screenshots
to the right. When you click the Conditional Formatting button on the
Home ribbon, you see five categories of built-in conditional formatting
rules: Highlight Cell Rules to Icon Sets. Each of these leads to a list of
possibilities. For example, the Highlight Cell Rules options and
Top/Bottom Rules options are shown to the right. These are all fairly self-
explanatory: you select a range, click one of these options, and specify
parameters and a format to apply a rule.

There are also three options at the bottom of the main Conditional
Formatting list: New Rule, Clear Rules, and Manage Rules. The New
Formatting Rule dialog box shown to the right lets you build a new rule,
and the possibilities are almost unlimited. The Clear Rules option (dialog
box not shown) lets you delete rules for the selected range or for the
entire workbook. Finally, the Manage Rules dialog box shown to the right New Formatting Rule dialo
lets you see and edit the rules, if any, for the current selection or any of
the worksheets in the current workbook.

It is impossible to explain all of the possibilities, but a few typical options


are illustrated below.

Exam score
Applying Some Simple Conditional Formatting 62

A typical use of conditional formatting is to color all "high" values one


color and all "low" values another color. In the exam scores to the right,
suppose you want to color all high scores green and all low scores red,
where a high score is greater than the value in the green cell and a low
Applying Some Simple Conditional Formatting
88
A typical use of conditional formatting is to color all "high" values one 77
color and all "low" values another color. In the exam scores to the right,
suppose you want to color all high scores green and all low scores red, 62
where a high score is greater than the value in the green cell and a low 94
score is less than the value in the red cell. To do so: 68
1. Select all exam scores in column K. 73
61
2. Click the Conditional Formatting dropdown, then Highlight Cell Rules,
and then Greater Than. 99
94
3. In the Greater Than dialog box, enter a cell reference to the green cell 88
and select a green format of your choice.
82
4. Repeat steps 2 and 3 in the obvious way for the low values. 87
65
Try it! Perform the above steps. Then change the values in the green and
red cells in column N to see how the formatting changes automatically. 82
70
To delete the formatting, click Conditional Formatting and then Clear 94
Rules.
80
To change the formatting rules, click Conditional Formatting and then 96
Manage Rules. You can experiment with the possible options.

Person
Other Built-in Conditional Formatting Possibilities 1
2
As you can see when you click the Conditional Formatting dropdown,
there are a lot of built-in choices that are very easy to apply. Try out some 3
of the following: 4
5
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 6
satisfy natural conditions. 7
8
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 9
the maximum number in a list by specifying the top 1 item. 10
11
The Data Bars, Color Scales, and Icon Sets are amazing -- and they can be
overdone. The point of all of them is to differentiate levels of values, such 12
as salaries or sales values. 13
Try it! Use any interesting formats you like to format the dates, text, or 14
numbers to the right. Remember that you can always modify the formats 15
or clear them. 16
17
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.

18
19
20
21
22
Scroll down for more below 23
24
25
26
27
28
29
30

Month
Building Your Own Conditional Formatting Rules with Formulas Jan-13
Feb-13
You can get even more control by building your own rules. You do this by Mar-13
clicking Conditional Formatting and then New Rule. The resulting dialog
box has more options than can be explained here, but the following Apr-13
explains one typical and useful possibility. May-13
Jun-13
The data set to the right contains monthly sales data for six regions.
Actually, they have been entered as random numbers with the Jul-13
RANDBETWEEN function, so if you press the F9 key, they will all change Aug-13
in a random way. (This makes the example even more impressive!)
Suppose you want to color the maximum sales value in each column Sep-13
green. One way is to do it separately for each column, formatting the top Oct-13
1 item as explained above. However, this would take too much time, Nov-13
especially if there were many more columns. Here is a better way.
Dec-13
1. Select all the dollar values, dragging from the top left cell. This makes
the top left cell the active cell, the one in white.

2. Choose New Rule from Conditional Formatting, and select "Use a


formula to determine which cells to format".

3. In the "Format values where this formula is true:" box, enter the
formula
=(L107=MAX(L$107:L$118)). Make sure you get the dollar signs right.
Then select a green format of your choice.

Try it! Apply the above steps to the sales data. Apply a similar formula to
format the minimum value in each column red. Then press the F9 key a
few times and watch how the green and red cells bounce around.

Once you understand how this formula works, you can do some amazing
conditional formatting. Remember that you selected the entire sales
range, but L107 is the active cell because you started the dragging from
it. The formula as written applies to cell L107. Specifically, if its value is
the maximum value in column L, it is formatted green. But because the
entire sales range is selected, the formula is applied, in a
relative/absolute sense, to each cell in the range. The rows in the MAX
function are absolute because the maximum is always over these rows,
but the columns in the MAX function are relative because you want this
formula to apply to all cells in all columns. And L107 is totally relative
because you want this rule to be applied to every cell in the range.
it. The formula as written applies to cell L107. Specifically, if its value is
the maximum value in column L, it is formatted green. But because the
entire sales range is selected, the formula is applied, in a
relative/absolute sense, to each cell in the range. The rows in the MAX
function are absolute because the maximum is always over these rows,
but the columns in the MAX function are relative because you want this
formula to apply to all cells in all columns. And L107 is totally relative
because you want this rule to be applied to every cell in the range.
Conditional Formatting button on Home ribbon

Conditional Formatting options Higlight Cell Rules options Top/Bottom Rules options

New Formatting Rule dialog box Manage Rules dialog box

Exam score Cutoffs for extremes


High 94
Low 66

Birthdate Gender State Children Salary


8/5/1959 Male Indiana 1 $65,400
10/15/1977 Female Michigan 2 $62,000
1/3/1981 Male Illinois 0 $63,200
5/5/1949 Male Wisconsin 2 $52,000
4/4/1987 Female Michigan 3 $81,400
6/30/1949 Female Wisconsin 3 $46,300
5/22/1949 Female Ohio 2 $49,600
10/30/1952 Male Ohio 1 $45,900
1/17/1957 Male Illinois 3 $47,700
9/18/1985 Female Indiana 1 $59,900
7/19/1953 Male Illinois 1 $48,100
12/10/1946 Female Michigan 0 $58,100
3/29/1986 Female Wisconsin 2 $56,000
12/12/1952 Female Illinois 2 $53,400
6/12/1977 Female Illinois 2 $39,000
11/19/1989 Male Ohio 1 $61,500
9/6/1957 Male Ohio 0 $37,700
9/30/1970 Female Michigan 2 $36,700
10/24/1973 Male Illinois 2 $45,200
6/8/1978 Male Ohio 0 $59,000
8/27/1990 Female Ohio 2 $54,300
2/9/1947 Male Illinois 1 $62,100
4/1/1989 Male Wisconsin 0 $78,000
3/12/1970 Male Ohio 0 $43,200
3/28/1970 Male Indiana 1 $44,500
5/6/1963 Male Michigan 1 $43,300
5/7/1959 Male Ohio 3 $45,400
3/6/1987 Male Indiana 2 $53,900
2/9/1958 Male Michigan 1 $44,100
8/4/1955 Female Indiana 2 $31,000

Region1 Region2 Region3 Region4 Region5 Region6


$1,946 $2,002 $4,733 $2,427 $3,953 $2,315
$3,274 $1,355 $1,723 $2,014 $1,730 $4,556
$1,480 $2,850 $1,860 $1,191 $1,859 $1,552
$3,611 $1,850 $2,603 $4,690 $4,066 $1,935
$4,943 $1,460 $4,642 $2,689 $4,941 $4,118
$1,437 $1,305 $4,909 $4,743 $1,405 $1,510
$2,802 $3,752 $3,724 $3,563 $3,458 $2,796
$4,494 $4,151 $3,510 $4,411 $2,224 $2,371
$1,525 $1,293 $2,896 $1,418 $1,746 $4,846
$1,320 $3,261 $1,882 $4,627 $2,201 $4,324
$4,074 $2,922 $3,152 $2,659 $4,461 $1,783
$3,054 $1,132 $1,885 $1,747 $4,568 $1,129
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Introduction to Data Validation

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 possibilities,
but only the most common are illustrated here. All of the options are found
from the Data Validation item on the Data ribbon shown to the right. This
leads to the fairly self-explanatory Data Validation dialog box also shown 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.

Applying a Simple Numeric Validation

To allow only values between two given values:

Choose Whole Number (if you want only integers) or Decimal in the Allow
dropdown list, choose Between from the resulting Data dropdown, and
enter values in the Min and Max boxes. You can also place cell references
in the Min and Max boxes. You can experiment with the other options in
the Data dropdown. They are all quite straightforward.

The Data Validation dialog box has two other tabs, Input Message and
Error Alert. The first allows you to create a message that the user sees
when the cell is selected. The second allows you to create a message that
appears if an incorrect value is entered in the cell.

Try it! Force the values in the gray cells in column K to have values
indicated by the labels to their right. Add your own input messages and
error alerts. Then try entering appropriate and inappropriate values in the
gray cells.

Validating from a List

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 in some column,
usually out of sight to the far right. Then from the Allow dropdown in the
Data Validation dialog box, select List, and in the Source box, provide a cell
reference to the list. That's all you need to do. When the user selects the
cell to be validated, a dropdown arrow automatically appears, 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 in a column out to the right that contains the
possible terms: 12, 24, 36, 48, and 60, and then create a data validation for
usually out of sight to the far right. Then from the Allow dropdown in the
Data Validation dialog box, select List, and in the Source box, provide a cell
reference to the list. That's all you need to do. When the user selects the
cell to be validated, a dropdown arrow automatically appears, 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 in a column out to the right 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 values. Check that it
works.

Validating a Date

Suppose you want to make sure the person enters a valid date in a cell.
This is a great place for data validation. By choosing the Date option from
the Allow dropdown list, you can force users 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 she 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 the gray cell to the right.
Then enter incorrect and correct entries to see how it works. (Can you
change it so that only dates that are at least a week ago are allowed? Just
change the formula slightly.)
List of Topics sheet

Data Validation button on Data ribbon

Data Validation dialog box

any integer between 1 and 10


any decimal number between 1 and 10
any positive integer
any negative decimal number
any integer between the two values below (use cell references for these values)
30 40

Amount financed $25,000


Interest rate 6.25%
Term
Monthy payment #NUM!

Date of loan
for these values)
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Protect options on Review


Protecting a Worksheet or Workbook

If you create 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 see the formulas. Maybe they are company
secrets. Excel gives you plenty of options for protecting, or unprotecting,
your work. Only a few of them are explained here. You can then Protect Sheet dialog box
experiment with others.

The key idea is locking cells. Right-click any cell on this worksheet, select
Format Cells, and click the Protection tab. You will see that the Locked
option is checked. By default, all cells are locked until you unlock them.
However, 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, as shown to the right.
For example, when you select Protect Sheet, you see the Protect Sheet
dialog box to the right. You clearly have a lot of options for what you
want to allow users to do. 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!
Protect options on Review ribbon

Protect Sheet dialog box


S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Developer Ribbon
Developer Ribbon

There is one built-in tab in Excel 2007 and later versions, the Developer
tab, that is not visible by default. It is primarily for developers, those who
create applications for others to use, usually with macros, but it has other
uses as well, so it is a good idea to make its tab visible.

To make the Developer tab visible (in Excel 2010 and later versions):
Checking the Developer ta
Right-click any ribbon and select Customize the Ribbon to display the
dialog box to the right. In the right pane, check the Developer option. If
there is no Developer item in the right pane, go to the left pane, select All
Tabs from the "Choose commands from" dropdown list, select the
Developer tab, and click the Add>> button to move it to the right pane.

One advantage of showing the Developer ribbon is that you can get to the
list of add-ins (either "regular" add-ins or COM add-ins) with a click of a
button. Without these buttons, the ones circled to the right, it takes four
clicks to get to either add-ins list.
Developer Ribbon

Checking the Developer tab in Customize view (in Excel 2010 and later)
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Creating a User Interface with Form Controls

When you fill out an online questionnaire, or when you work with almost
any Windows program, you continually see "controls" such as radio
buttons, check boxes, text boxes, buttons, dropdown lists, and others.
You probably don't even think about how these work because you see
them so often.

The good news it is that you can add these controls to Excel worksheets,
and it is remarkably easy, with no programming required. The first thing
you should do is make the Developer ribbon visible. To do so, right-click
any ribbon, select Customize the Ribbon, and check the Developer item
in the right pane of the resulting dialog box. Once the Developer ribbon
is visible, click the Insert dropdown to see the list of controls shown to
the right. There are two groups, the "easy" Form Controls and the
"advanced" ActiveX Controls. The latter require some programming, so
only the Form Controls are discussed here.

To insert any of these controls on a worksheet, click the control and then
drag it where you want it. The control comes alive knowing the behavior
it ought to have. For example, option buttons (also called radio buttons)
know that only one of them can be checked, whereas check boxes know
that any number of them can be checked.

An invoice application has already been created to the right, using the
following steps.

1. Create the frame at the top by clicking the Group Box form control and
dragging it to a desired location. Then change its label to Product
purchased.

2. Insert three option buttons inside the frame by clicking the Option
Button form control and then dragging them inside the frame. Then
change their labels to the product names.

3. Insert a check box (outside of the frame) for preferred customers, and
change its label.
4. At this point, the option buttons and the check box aren't yet
functional. To make them functional, right-click any one of the option
buttons and select Format Control. In the Cell link box under the Control
tab shown to the right, select a cell out of view, such as AA1. Then
depending on which option button is selected, cell AA1 will contain 1, 2,
or 3. Fortunately, you need to do this for only one of the radio buttons.
The others will automatically have the same cell link. Similarly, create a
cell link for the check box to a cell such as AA2. Depending on whether
the checkbox is checked, cell AA2 will contain TRUE or FALSE.

5. Create formulas in the gray cells. You can check that the first three of
these use the INDEX function and references to the cell links that act as
lookups.

Try it! Create your own version of this application, using the steps above.
Try it! Create your own version of this application, using the steps above.

The Combo Box

Here is another nice application. It uses the very handy Combo Box form
control circled to the right. Suppose you have a very large table that has
the driving distances between 75 locations. (See the large table to the
right, starting in column P.) You would like to look up the distance
between any given pair of "From" and "To" locations. To accomplish this,
you can add two combo box controls, one for the "From" location and
one for the "To" location.

The application has already been created to the right, using the following
steps.

1. Create the combo box for the "From" location by clicking the Combo
Box form control and dragging it so that it covers cell K68.

2. Right-click this combo box and select Format Control. For the Input
Range, select the gray column range to the right, and for the cell link,
select cell K68. This gives you a dropdown list where you can select from
Location 1 to Location 75, and the index of the one you select (1 to 75) is
stored out of sight under the combo box. (You could also store this index
way to the right on the worksheet, but letting it be covered up by the
combo box itself is a nice alternative.)

3. Create a similar combo box over cell L68 for the "To" location, this
time entering L68 as the cell link. Surprisingly, the Input Range for this
combo box should still be the gray column range, not the gray row range
to the right. Excel always wants the list to be a column, not a row.

4. You can now find the distance between the two selected locations
with the INDEX function in cell M68. For the example shown, it finds the
distance at the intersection of row 12, column 29 of the distance table.
(The INDEX function, a very handy function for exactly this type of
application, is described in the INDEX topic of this tutorial.)

Lining Up Controls

When you use controls, it is important to line them up so that they have a
professional look. If your controls are slightly out of alignment, this is
probably the first thing your users will notice, and because of it, they
Lining Up Controls

When you use controls, it is important to line them up so that they have a
professional look. If your controls are slightly out of alignment, this is
probably the first thing your users will notice, and because of it, they
might lose all faith in you.

For example, the left sides of the three option buttons in the first example
above should be left-aligned. This can be tricky (and time-consuming) to
do, but there is a nice "nudge" trick you can use. Right-click any control to
select it, and then press the Ctrl key and any of the Arrow keys to move
the control slightly in the direction of the arrow. More specifically, here
are Microsoft's own suggestions for moving any shape, including controls,
text boxes, lines, rectangles, and so on. (You can use any or all of these.)

1. Drag the object to its new location.

2. To constrain an object so that it moves


only horizontally or vertically, hold the Shift
key while you drag the object.

3. To move in small increments, press an


Arrow key.
P...
List of Topics sheet

Form Controls on Developer ribbon Invoice application

Flat-screen TV

Blu-ray disc player

Laptop computer

Preferred customer

Invoice
Format Control dialog box Product Laptop computer
Price $650
Discount $33
Net price $618
Location 1
Location 2
Location 3
Location 4
Location 5
Location 6
Combo Box control Location 7
Location 8
Location 9
Location 10
Location 11
Location 12
Location 13
Location 14
Location 15
Location 16
Location 17
Location 18
From To Distance Location 19
12 29 78 Location 20
Location 21
Format Control dialog box Location 22
Location 23
Location 24
Location 25
Location 26
Location 27
Location 28
Location 29
Location 30
Location 31
Location 32
Location 33
Location 34
Location 35
Location 36
Location 37
Location 38
Location 39
Location 40
Location 41
Location 42
Location 43
Location 44
Location 45
Location 46
Location 47
Location 48
Location 49
Location 50
Location 51
Location 52
Location 53
Location 54
Location 55
Location 56
Location 57
Location 58
Location 59
Location 60
Location 61
Location 62
Location 63
Location 64
Location 65
Location 66
Location 67
Location 68
Location 69
Location 70
Location 71
Location 72
Location 73
Location 74
Location 75
Inputs
Prices
Flat-screen TV $2,500
Blu-ray disc player $450
Laptop computer $650

Preferred discount 5%
Location 1 Location 2 Location 3 Location 4 Location 5 Location 6 Location 7
0 55 13 50 16 49 85
39 0 38 40 21 32 62
57 49 0 80 62 40 51
25 49 87 0 61 14 67
71 63 48 83 0 89 44
61 34 78 62 40 0 77
42 21 26 15 29 90 0
35 10 88 28 71 79 12
53 16 51 68 97 36 10
23 69 14 75 10 18 44
18 78 67 78 100 86 15
11 44 21 23 18 20 13
95 15 33 54 44 46 97
41 60 16 58 82 19 42
81 17 46 96 87 48 27
72 98 97 92 33 35 22
20 85 28 97 91 94 100
91 65 30 28 65 74 29
24 82 21 43 100 82 38
12 68 16 77 31 57 54
86 58 13 40 92 36 19
39 78 60 39 99 39 34
99 53 56 13 93 81 64
47 53 60 29 75 93 39
52 91 96 95 45 21 24
83 29 88 19 27 98 10
76 57 31 96 76 95 57
12 13 32 64 83 100 60
38 16 29 59 11 51 70
78 38 57 79 79 98 17
82 63 35 48 39 14 74
68 96 20 49 80 21 22
87 43 97 99 73 33 92
73 47 68 27 60 36 23
41 62 22 75 20 83 15
86 86 98 62 90 99 84
10 34 96 94 42 21 12
98 21 58 60 61 41 67
67 74 50 38 54 72 85
18 25 12 21 29 11 94
75 44 26 19 83 56 45
100 91 21 85 87 16 57
44 87 52 86 47 35 47
62 69 11 33 68 24 90
37 55 11 66 62 91 91
53 76 17 39 18 41 81
98 75 100 67 54 63 36
26 37 74 22 73 36 94
30 86 62 18 62 83 57
33 65 56 84 13 33 30
53 26 84 65 14 48 38
43 63 10 52 61 86 88
43 37 49 97 45 86 13
83 94 83 84 48 61 35
21 70 82 49 13 62 22
86 25 37 53 42 74 32
86 32 64 64 52 69 60
14 58 75 48 87 50 71
87 78 90 16 80 22 15
98 97 52 70 82 57 61
82 36 94 60 70 72 49
93 26 88 92 30 20 23
95 24 26 23 14 22 82
51 63 57 75 66 12 76
15 58 52 27 57 14 67
99 48 35 50 44 76 84
81 96 88 44 53 95 77
12 54 15 44 54 45 90
62 34 90 29 74 50 33
37 24 86 46 71 92 40
40 47 80 47 61 16 25
57 69 56 17 54 10 79
37 71 37 56 80 100 75
31 13 21 81 88 56 29
50 54 65 74 16 97 65
3
1
Location 8 Location 9 Location 10 Location 11 Location 12 Location 13 Location 14 Location 15
57 71 60 81 17 85 61 83
79 88 68 53 10 49 18 25
93 97 42 25 67 46 16 11
76 59 47 58 17 30 100 23
58 51 84 74 29 66 74 61
73 11 90 48 68 42 47 30
41 69 52 45 51 87 27 81
0 48 70 12 75 12 52 15
23 0 80 18 58 100 74 67
72 34 0 88 61 72 18 62
73 59 71 0 21 99 88 85
79 27 37 50 0 84 90 54
26 38 72 33 34 0 38 73
39 98 68 10 60 95 0 67
100 65 64 19 70 55 63 0
93 35 17 13 53 70 15 89
60 74 27 59 44 27 14 74
97 53 11 32 87 71 91 18
42 22 31 51 94 47 75 93
93 35 34 96 77 84 38 21
64 68 65 16 30 43 84 77
18 23 60 23 64 77 31 19
70 48 91 43 47 41 76 45
28 15 93 19 64 98 97 64
61 17 49 75 82 27 95 78
97 36 86 24 13 38 41 29
28 53 40 24 18 98 58 21
99 77 36 85 38 100 30 37
50 37 85 88 66 58 43 79
93 91 50 87 44 32 26 31
84 74 47 51 80 51 99 69
82 82 46 48 14 58 71 73
52 26 49 54 79 82 16 13
34 22 47 88 87 63 55 94
30 28 99 59 50 46 59 16
18 87 29 96 43 96 47 24
91 12 65 51 51 73 87 14
25 46 47 79 50 43 92 52
53 37 96 70 88 62 93 38
43 95 44 64 57 87 35 78
14 22 75 90 80 55 64 51
100 80 28 23 57 35 79 62
100 94 76 14 99 16 33 53
14 50 30 78 43 12 98 87
62 69 84 99 72 20 59 36
90 89 87 100 15 82 53 97
68 86 16 30 53 87 92 66
66 43 65 30 34 23 40 62
71 23 12 31 31 70 95 34
36 43 91 99 93 11 99 28
34 39 46 47 66 36 56 51
68 76 86 43 17 42 98 74
39 55 61 81 49 29 84 24
32 36 67 65 16 29 42 56
53 54 10 90 81 38 49 85
86 35 17 71 43 85 57 47
92 89 42 46 27 19 76 45
49 49 63 51 43 72 61 73
32 14 86 65 83 18 47 65
16 74 13 11 82 10 38 78
88 90 42 94 98 69 24 82
98 31 28 96 31 50 25 43
52 36 97 18 80 54 42 39
58 66 36 42 46 17 44 62
87 90 24 23 37 26 96 83
11 43 43 94 55 84 36 55
34 100 38 74 38 69 95 66
44 29 29 20 69 44 14 57
84 28 48 53 62 34 99 77
83 40 63 22 30 75 86 85
37 71 85 71 69 16 83 81
93 46 72 49 33 12 34 56
58 85 72 90 30 60 24 65
66 30 19 39 75 32 18 31
52 76 38 41 75 65 72 44
Location 16 Location 17 Location 18 Location 19 Location 20 Location 21 Location 22 Location 23
88 18 98 95 92 18 13 60
74 31 58 68 42 56 55 40
61 32 79 92 12 34 88 12
94 86 19 87 28 11 69 93
30 56 70 96 47 84 67 53
69 91 42 96 66 44 83 15
76 23 100 62 87 97 71 73
38 75 14 68 98 76 19 44
36 69 16 60 71 39 68 44
64 31 90 81 89 43 33 93
17 47 61 46 72 65 69 59
78 65 65 39 15 52 88 54
69 19 53 61 22 58 95 67
43 49 10 87 55 13 32 10
36 48 15 24 35 57 42 49
0 51 44 78 59 27 74 30
99 0 100 81 25 89 59 38
30 11 0 37 34 26 78 39
78 95 39 0 19 37 30 69
30 49 59 78 0 65 16 82
23 91 25 42 65 0 14 37
44 36 45 86 87 86 0 49
72 84 16 15 65 14 63 0
90 70 56 62 12 92 33 99
21 80 80 57 38 55 72 56
55 65 39 53 77 83 62 33
94 48 93 95 97 63 93 26
12 15 32 99 63 26 70 96
75 50 87 53 29 69 77 17
14 56 32 69 36 45 60 89
57 64 39 84 65 81 55 72
85 59 71 62 29 78 61 15
85 14 17 31 63 18 54 24
60 52 59 74 55 55 17 34
31 36 74 92 89 29 64 97
28 58 34 73 30 78 12 53
32 45 80 42 92 15 14 100
21 53 65 100 21 94 27 93
37 42 32 97 12 74 52 80
22 87 96 82 13 52 69 70
48 17 25 76 62 15 22 89
63 54 64 36 77 72 31 26
51 25 84 31 54 29 100 62
67 29 23 46 39 16 12 11
77 64 15 17 38 52 42 95
11 10 24 98 83 57 64 36
90 70 94 32 59 93 92 53
79 83 13 64 47 14 56 80
34 54 58 73 10 41 44 76
29 68 62 45 73 44 96 62
64 33 39 83 56 47 27 29
17 93 35 60 41 37 38 97
17 91 31 85 52 70 85 62
53 15 83 80 66 84 38 29
86 83 31 97 18 95 28 72
54 75 99 30 72 68 94 73
14 99 35 83 70 65 23 75
39 58 53 64 91 99 45 69
48 71 60 62 66 94 38 21
87 25 93 81 32 79 50 18
22 45 26 39 94 17 85 69
42 76 56 13 70 23 100 35
57 70 80 66 35 99 99 43
20 83 57 57 12 15 37 13
64 70 78 68 99 67 33 22
72 54 100 84 62 27 25 53
28 51 95 58 77 66 25 15
81 59 54 77 72 36 30 98
52 10 62 64 51 58 90 22
34 73 32 84 47 71 97 93
68 19 64 47 59 90 82 62
84 80 15 83 78 82 15 15
46 62 50 22 37 98 58 42
73 18 31 59 79 42 81 47
63 61 22 59 24 35 69 34
Location 24 Location 25 Location 26 Location 27 Location 28 Location 29 Location 30 Location 31
37 42 59 59 40 14 56 20
40 27 71 11 80 17 58 36
93 38 36 40 17 75 27 42
82 99 77 50 50 75 81 68
77 75 45 27 56 35 49 26
87 57 82 84 37 74 23 65
64 97 84 29 81 97 26 84
42 63 75 53 95 61 84 97
20 79 82 48 88 22 30 42
88 32 95 46 32 22 17 92
71 53 51 12 27 83 77 45
53 76 28 99 67 78 88 45
47 69 63 55 37 80 69 97
43 73 90 15 71 24 13 10
89 88 20 77 63 63 26 41
90 71 39 70 45 85 62 61
34 65 20 67 64 80 93 72
91 47 88 95 85 24 28 86
41 35 94 96 30 42 90 59
59 44 75 29 17 53 53 64
25 37 97 87 65 17 24 63
63 10 80 13 48 48 51 54
98 63 29 27 89 54 83 58
0 66 93 12 87 50 31 42
21 0 15 27 78 69 92 78
61 74 0 38 29 49 47 19
13 56 27 0 75 89 40 69
65 28 38 61 0 90 23 98
81 34 39 85 44 0 81 22
54 79 38 82 98 97 0 53
14 74 41 37 96 49 89 0
46 77 63 89 49 24 90 33
53 28 12 71 16 44 99 55
41 98 58 40 31 64 78 28
71 57 78 36 91 81 94 75
90 35 60 60 19 92 26 49
19 56 94 14 29 70 79 10
72 100 68 76 62 65 51 56
68 63 41 91 63 28 57 34
56 86 33 43 87 65 96 42
59 79 91 70 79 67 34 25
77 31 80 72 90 82 87 34
85 60 16 75 85 48 89 45
27 46 75 92 45 65 65 51
86 77 30 88 14 99 51 11
85 86 46 93 71 46 60 35
75 89 80 53 46 68 83 26
58 40 97 34 15 70 59 96
95 26 89 82 41 18 48 87
100 73 14 12 15 17 25 54
12 14 50 22 89 32 14 11
83 55 31 61 39 26 70 53
46 15 60 19 18 71 77 18
77 75 23 73 72 93 29 66
20 34 82 28 77 80 63 73
49 16 49 94 41 91 58 25
10 71 56 60 98 36 43 100
48 21 58 51 36 60 46 55
13 15 24 74 48 46 48 61
80 88 98 19 86 77 59 80
48 66 39 64 53 40 45 66
97 60 87 88 87 47 29 58
24 54 49 18 33 79 80 65
36 96 43 28 70 21 60 61
41 65 18 70 21 74 12 62
38 15 25 51 79 64 38 10
82 38 26 53 69 63 33 41
20 91 67 36 89 93 49 73
79 60 20 48 21 19 23 92
100 43 90 19 89 25 13 59
84 74 78 100 26 72 66 76
73 39 53 50 100 27 63 52
38 90 86 65 50 92 30 91
33 73 19 27 46 34 15 93
29 62 87 76 13 88 30 88
Location 32 Location 33 Location 34 Location 35 Location 36 Location 37 Location 38 Location 39
98 88 36 32 94 76 44 34
83 94 91 98 100 34 48 71
41 29 99 71 85 34 91 45
19 78 80 10 72 72 91 46
62 64 75 18 86 67 98 60
16 20 41 28 68 38 23 71
100 75 40 58 36 29 46 58
85 97 93 90 51 66 20 100
49 66 94 69 36 35 59 11
51 52 93 62 13 72 100 54
68 49 24 42 67 26 19 69
70 35 46 15 18 28 45 59
44 60 83 27 100 49 45 39
87 66 84 45 18 53 39 11
60 71 22 21 19 94 16 31
95 28 92 78 29 21 47 75
60 89 64 37 88 58 94 37
74 38 99 81 36 22 56 57
81 82 31 99 79 10 38 82
32 54 71 37 90 65 82 15
88 22 25 22 12 65 34 59
59 80 99 38 67 78 83 15
22 68 12 15 73 45 88 83
90 42 62 79 49 89 97 58
19 39 87 18 18 33 83 13
10 34 16 73 20 40 62 87
19 15 21 10 67 27 54 74
78 82 63 76 39 93 21 73
64 32 35 72 84 40 56 26
40 82 49 40 60 84 37 35
15 98 73 36 31 76 99 63
0 57 80 65 40 93 91 39
73 0 91 97 91 54 10 77
13 14 0 87 78 20 27 30
95 18 59 0 22 88 24 80
90 15 56 18 0 49 11 55
54 88 43 33 95 0 56 29
29 90 88 88 41 65 0 95
49 72 67 17 20 42 96 0
85 30 87 90 71 59 83 15
63 38 40 21 74 91 92 76
26 97 57 89 75 93 42 100
98 74 90 73 99 44 95 19
97 19 84 53 77 28 65 28
45 96 79 86 60 98 54 27
25 100 53 24 37 85 83 74
78 99 40 27 86 80 54 10
76 10 49 96 23 35 92 65
83 98 97 44 80 39 60 73
14 20 83 96 20 45 95 72
54 85 92 97 55 30 11 72
99 62 14 47 17 10 55 87
73 93 54 50 52 83 24 26
34 83 88 58 10 21 28 93
21 50 38 88 87 68 85 67
95 81 97 53 76 40 93 10
91 58 99 62 21 64 42 94
93 50 66 12 51 83 60 26
40 12 95 35 65 67 15 29
81 55 44 17 94 57 56 67
46 61 50 61 71 94 31 61
38 68 68 90 78 89 92 38
92 33 35 61 56 50 42 17
51 15 82 82 84 53 90 31
52 53 52 51 33 76 22 68
50 71 38 66 37 75 57 14
33 23 50 99 91 16 17 83
98 18 16 12 18 65 71 42
34 55 12 62 81 72 55 19
40 10 73 16 67 25 64 98
48 12 73 62 26 100 81 43
50 84 21 68 78 27 79 39
32 78 68 91 44 86 47 44
86 11 10 50 92 78 70 84
88 41 92 74 96 10 80 84
Location 40 Location 41 Location 42 Location 43 Location 44 Location 45 Location 46 Location 47
79 13 34 27 53 53 99 21
100 58 92 59 70 13 15 36
100 30 19 80 80 51 94 30
39 23 31 34 98 89 36 49
67 33 51 98 53 58 100 90
48 15 24 65 88 65 99 44
71 31 52 59 53 99 54 50
54 27 60 30 31 77 48 100
53 65 30 35 43 49 86 66
52 70 16 41 38 100 39 74
11 10 81 34 11 68 62 54
94 86 17 19 13 90 47 40
13 11 23 41 12 23 57 71
42 85 18 100 15 59 34 82
46 78 85 22 85 69 61 35
84 65 76 76 47 73 18 88
42 81 41 64 54 63 53 52
14 91 32 70 70 25 23 27
72 33 68 64 43 31 36 45
27 100 15 89 97 17 77 15
16 66 82 38 46 43 13 61
30 89 54 50 77 47 54 99
85 55 19 79 17 63 46 51
87 19 40 82 64 92 31 21
45 34 42 58 40 59 64 48
13 32 40 49 25 34 18 11
84 60 63 50 96 19 90 62
60 58 94 40 42 78 33 56
65 97 46 37 82 75 10 70
85 75 78 43 78 12 60 78
45 47 83 55 26 94 26 28
41 83 33 57 30 65 69 17
40 72 31 87 84 91 93 86
15 61 38 74 72 82 16 94
38 56 99 90 69 17 84 22
18 22 84 80 61 61 78 47
89 90 17 84 42 85 49 27
23 88 60 65 84 48 67 68
40 84 66 90 57 68 56 49
0 56 79 76 78 90 53 53
26 0 60 54 23 91 10 72
51 33 0 31 75 25 53 37
55 59 53 0 55 80 22 33
44 81 78 58 0 22 85 51
11 28 82 46 96 0 38 61
19 99 11 34 97 74 0 89
30 53 31 90 14 50 90 0
44 80 95 58 36 79 99 64
89 42 23 79 86 85 85 23
49 11 25 32 48 62 59 87
13 15 76 26 19 90 100 36
35 43 63 93 69 35 49 98
29 21 37 34 14 77 35 76
17 81 31 100 89 67 30 33
94 24 36 41 82 78 59 87
68 69 84 41 12 40 58 67
94 93 89 25 30 66 43 18
19 86 31 81 76 13 56 76
78 90 65 37 85 64 43 52
90 41 86 29 35 84 21 76
79 71 60 38 36 57 27 39
46 39 77 27 70 70 92 10
31 39 54 84 75 69 26 50
100 53 96 57 51 20 80 93
48 48 48 12 43 73 93 30
100 64 90 45 69 78 44 65
89 59 32 60 46 47 43 79
67 20 50 71 42 53 48 15
20 25 19 79 43 86 18 35
13 60 74 79 83 58 33 80
19 30 16 26 64 88 25 64
17 58 59 43 54 37 29 24
87 82 32 17 53 55 70 90
47 29 27 83 42 60 54 50
82 94 41 89 24 70 78 82
Location 48 Location 49 Location 50 Location 51 Location 52 Location 53 Location 54 Location 55
21 78 83 20 49 75 76 54
68 94 42 84 70 86 88 77
22 74 64 50 54 31 71 96
99 78 36 96 45 97 57 48
86 42 67 75 88 57 45 35
86 85 53 17 72 25 60 41
40 40 34 27 26 43 45 56
73 92 40 54 29 90 98 29
74 84 100 59 59 71 18 31
48 86 50 66 73 99 51 22
62 28 69 59 80 59 51 26
20 23 85 83 28 98 82 60
70 78 69 93 58 21 48 94
49 35 98 30 85 52 93 22
25 68 26 83 21 69 57 32
57 46 92 67 60 46 38 14
42 52 58 67 38 74 10 23
23 70 18 65 89 76 47 45
84 23 83 93 87 64 58 54
18 91 42 74 74 53 68 85
29 67 20 17 20 38 38 42
92 48 78 88 77 70 27 25
54 18 86 96 50 45 91 31
71 96 35 65 26 27 45 85
53 33 94 99 65 45 28 33
87 89 48 30 75 89 47 70
30 41 75 20 67 78 35 62
32 46 100 98 39 74 38 10
65 65 56 94 24 92 91 12
16 64 94 51 53 19 92 18
32 98 63 92 34 99 96 58
38 24 89 35 98 97 27 92
16 56 28 92 16 39 88 96
15 24 58 72 11 69 50 40
88 72 16 16 71 54 33 70
50 83 22 98 40 51 70 86
38 18 28 16 42 51 31 97
54 54 30 55 36 95 36 50
13 34 75 53 30 73 26 26
63 44 52 81 21 56 40 61
26 48 31 83 100 14 72 36
54 17 92 84 56 93 44 58
70 25 57 48 81 59 35 27
58 48 68 13 56 25 21 59
73 99 100 19 38 25 32 47
29 98 84 94 98 26 20 66
52 28 24 50 66 94 74 84
0 55 89 72 60 84 55 73
13 0 81 10 63 13 70 14
65 93 0 48 66 54 11 86
100 20 11 0 37 30 37 32
92 13 54 76 0 68 64 49
72 51 28 73 62 0 21 62
76 69 71 97 91 97 0 12
10 23 37 10 77 12 71 0
79 38 68 38 70 10 14 52
22 28 53 79 81 49 85 90
27 94 18 75 38 30 86 97
56 34 15 86 79 10 48 46
80 28 56 12 62 60 73 87
46 58 36 77 85 79 38 36
67 89 24 50 84 16 85 25
87 47 84 64 99 27 94 88
60 57 18 65 72 22 17 37
85 44 54 62 50 95 37 26
85 84 42 59 96 56 62 78
57 33 33 90 45 54 67 95
85 54 70 50 84 37 86 76
38 82 46 38 56 49 14 60
48 27 27 65 91 51 57 37
58 56 17 83 97 81 23 52
70 14 58 49 24 81 13 94
57 74 51 76 34 87 99 59
24 34 20 10 59 24 87 80
34 21 83 35 58 82 30 47
Location 56 Location 57 Location 58 Location 59 Location 60 Location 61 Location 62 Location 63
66 17 58 12 42 36 62 89
22 77 98 11 17 11 25 49
99 38 54 15 28 15 36 90
87 45 30 37 49 66 59 86
34 88 68 74 10 74 44 58
78 95 47 75 98 18 87 74
37 78 83 43 72 55 81 54
91 48 19 72 19 67 97 53
28 45 20 22 17 80 36 32
52 46 92 59 28 17 49 13
69 85 10 59 66 34 43 30
69 69 93 40 66 46 88 14
57 77 75 61 89 68 15 62
75 74 63 98 11 64 45 10
11 47 54 50 81 75 62 43
79 81 41 16 88 94 56 13
23 39 28 65 55 94 74 27
57 95 16 62 47 98 26 79
39 97 15 43 83 66 34 59
37 40 45 85 56 98 42 54
64 11 21 50 28 65 88 50
56 100 44 68 12 48 24 95
27 15 67 60 38 93 79 98
65 27 83 92 43 25 72 70
87 27 27 58 27 96 37 96
34 16 33 65 24 96 45 76
50 80 74 84 90 24 62 92
31 59 82 60 21 67 65 78
76 47 43 56 52 39 48 52
69 96 58 40 18 95 58 57
83 39 32 12 40 82 95 33
39 89 17 24 90 29 99 79
11 45 24 52 19 86 92 71
83 83 97 72 51 43 12 76
74 75 96 94 95 25 20 16
82 51 19 18 27 88 52 52
45 67 89 91 79 55 13 15
40 20 55 69 45 63 91 91
53 99 88 39 17 62 85 38
32 73 85 77 33 35 43 85
71 30 34 45 11 83 30 43
49 75 45 28 19 16 89 33
82 27 38 79 66 10 65 90
37 56 13 50 55 74 90 60
59 16 88 32 97 65 93 36
64 31 58 81 48 39 55 54
98 44 98 36 66 72 74 68
21 95 24 84 46 39 66 71
87 69 70 34 46 46 51 53
58 37 74 31 21 91 53 47
68 24 15 89 87 29 45 54
49 72 68 23 82 36 20 10
60 39 33 95 100 70 78 11
16 15 91 58 87 82 67 70
16 49 26 25 90 100 65 45
0 37 63 50 60 13 87 55
27 0 64 24 15 71 22 79
52 97 0 89 33 78 29 15
61 88 44 0 59 45 69 43
12 95 77 79 0 91 22 43
50 39 19 78 85 0 27 22
34 49 27 92 55 50 0 72
88 36 38 78 39 99 15 0
69 88 100 53 77 49 16 100
88 18 35 17 15 16 94 23
13 52 17 61 63 55 17 90
95 87 47 29 58 98 46 42
30 22 12 50 62 10 100 20
75 49 55 95 70 41 53 64
99 52 62 54 34 32 95 25
15 31 19 37 92 33 50 97
95 87 30 97 14 97 35 39
39 56 84 97 73 28 67 87
65 53 11 53 58 99 17 70
16 33 11 34 55 10 83 44
Location 64 Location 65 Location 66 Location 67 Location 68 Location 69 Location 70 Location 71
58 32 62 78 24 67 10 94
84 68 59 36 86 49 34 67
78 51 41 45 91 70 92 12
95 62 91 18 70 40 23 91
68 19 82 59 47 77 97 13
10 60 95 86 40 20 99 64
45 15 30 93 36 56 84 89
53 28 82 42 48 18 63 71
53 16 11 82 87 54 14 25
72 71 86 81 60 39 100 87
33 11 10 98 11 46 100 59
85 34 91 67 37 96 30 63
59 68 82 86 28 41 98 78
65 96 79 72 40 95 45 88
91 54 73 75 99 57 34 22
35 87 43 54 85 78 96 39
79 41 94 32 88 86 53 92
42 19 95 21 74 14 83 21
42 27 14 43 78 39 79 74
78 95 33 20 92 78 89 60
25 32 55 53 50 23 12 24
57 17 12 59 51 85 39 94
94 78 35 51 32 76 84 91
26 73 92 17 57 97 90 20
39 90 81 21 62 40 13 55
78 66 31 89 81 62 41 67
37 29 62 88 91 30 23 37
50 83 28 32 98 78 36 46
74 44 24 41 29 29 78 73
67 54 41 76 38 60 87 37
89 43 75 83 97 34 70 96
56 10 39 82 77 40 93 94
94 17 89 74 96 86 36 85
49 75 87 80 48 67 34 30
15 72 23 66 100 91 56 100
11 58 55 16 60 15 66 88
91 47 44 64 83 57 31 69
14 11 30 83 39 85 12 35
60 28 56 23 32 61 65 37
66 38 78 71 19 90 68 53
74 12 34 49 31 16 49 94
23 57 90 16 27 92 44 48
23 11 91 17 22 46 55 64
48 54 90 15 45 70 79 76
33 17 41 15 43 62 83 71
69 29 56 11 46 39 23 18
93 80 37 50 49 66 45 25
40 73 56 91 69 46 28 12
73 72 35 38 24 36 76 84
74 50 18 75 39 51 55 15
31 17 35 41 68 16 23 46
41 56 36 55 18 86 53 92
92 69 79 51 32 87 68 79
43 84 81 93 57 93 25 32
78 62 53 28 26 54 58 49
31 96 57 33 41 32 19 91
43 19 15 62 24 92 98 16
74 22 40 54 39 48 13 66
95 10 60 29 41 68 90 68
39 80 37 26 37 75 96 44
39 26 100 53 46 44 18 54
26 56 97 20 89 12 56 23
67 91 18 60 97 11 46 69
0 91 66 42 31 23 11 42
80 0 27 20 93 46 22 97
39 53 0 87 41 24 58 11
97 12 40 0 27 34 49 54
46 71 49 44 0 90 55 98
19 67 87 10 57 0 88 38
61 76 25 22 16 64 0 31
41 61 92 50 38 22 95 0
34 20 44 37 43 63 30 69
58 13 56 51 20 30 88 41
27 34 36 25 84 81 26 55
52 27 61 77 95 68 28 18
Location 72 Location 73 Location 74 Location 75
31 90 35 70
72 32 30 92
13 100 71 24
59 92 49 59
34 59 89 21
20 99 83 89
90 12 89 89
45 22 68 22
93 86 40 11
100 10 80 31
49 30 54 25
28 21 51 44
71 37 69 46
91 87 100 60
71 46 10 58
11 52 100 19
73 44 86 71
77 75 93 69
97 17 50 86
48 89 69 91
65 47 26 51
37 58 68 25
25 15 53 27
59 49 25 88
10 51 73 56
71 15 67 70
62 62 94 95
59 26 98 75
61 10 87 54
18 91 84 45
89 36 66 91
47 44 30 81
57 40 22 94
95 95 45 26
83 83 69 11
38 78 60 48
38 76 91 19
61 66 67 36
66 46 30 35
54 47 65 47
29 88 97 38
47 40 66 24
91 96 77 84
26 79 83 37
19 45 66 91
12 11 87 71
12 40 54 52
50 23 11 50
51 57 33 49
33 87 24 30
87 19 75 85
40 58 54 48
27 27 53 36
58 25 82 47
11 63 69 29
34 36 27 30
90 27 56 72
20 89 33 67
38 79 50 86
80 50 85 70
35 71 72 16
95 34 60 77
58 25 94 65
16 78 14 86
86 91 23 27
72 70 43 17
11 87 20 37
36 92 19 18
21 59 96 87
67 25 66 56
22 41 97 38
0 68 31 99
28 0 40 86
26 28 0 57
54 77 73 0
S. Christian Albright, 2011-2017, All Rights Reserved Return to List of Topics sheet

Developer ribbon
Background for Macros and VBA Programming in Excel

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, called 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 the
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 you Quick Access Toolbar (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, shown to the right, that you
should make visible. This has various buttons for working with macros. If
the Developer tab isn't visible, right-click any ribbon, select Customize
the Ribbon, and check the Developer item in the right pane of the
resulting dialog box.

2. Starting in Excel 2007, files that contain macros must have the .xlsm
extension ("m" for macro). You aren't allowed to save such a file as an
.xlsx file.

3. There is a special file, Personal.xlsb. This is called your Personal Macro


Workbook. This is where you will probably want to store your recorded
macros. 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 need to go to the Visual Basic 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.

Record Macro button in St


Recording a Macro

Now let's record a macro and then try it out. This will be a very simple Record Macro dialog box
macro that formats the selected cell(s) as integers, that is, as Number
with zero decimals.

1. Make the Developer ribbon visible, if necessary. Select any range such
as the numbers in the gray range to the right, and click the Record Macro
button on the Developer ribbon. This turns the recorder on. It will record
Recording a Macro

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, if necessary. Select any range such
as the numbers in the gray range to the right, and click 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. Note: There is also a
handy Record Macro/Stop Recording button at the left side of the Status
Bar. See the screenshot above to the right.

2. When you click the Record Macro button, you will see the dialog box
to the right. Fill it out as shown and click OK. You can give the macro a
meaningful name (no spaces), and you can specify where it should be
stored. The choice shown here is 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.

4. From the Developer ribbon (or the button on the Status Bar), click the
Stop Recording button. Macros list for QAT custom
5. 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 Visual Basic 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.

6. Now you have a nice macro, but you need a button to run it. To create
such a button, click the dropdown arrow next to the QAT, and then More
Commands to bring up the Customize dialog box shown to the right.
Under the "Choose commands from" dropdown, choose Macros. Select
your recorded macro from the resulting list, and click the Add>> button
to create a button for it on your QAT. The button will have a generic icon,
but if you click the Modify button near the bottom, you can choose a
more appealing icon.

7. Now that you have a nice button on your QAT, try it out. Select the
numeric cells in the red range to the right and click your button. They
should be reformatted.

Note that you were instructed 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 to format,
your macro would work only for that specific range.

Try it! Think of a simple task you perform frequently, like coloring the
background of a range green, changing the number format to currency
with zero decimals, or changing the print settings to your favorite
settings. Record a macro to perform any of these tasks, store it in your
Personal Macro Workbook, and assign it to a button on your QAT. You will
then be a click away from instant productivity!
Developer ribbon

Record Macro button in Status Bar

Record Macro dialog box Numbers to be formatted


2.0001 2.0001
30.9999 30.9999
-3.0002 -3.0002
50.0001 50.0001
0.9999 0.9999

Macros list for QAT customization

You might also like