1. Table of Contents
    2. Introduction
      1. What You Should Know Before Reading This Book



Microsoft
®
Excel
®
2010:
Data Analysis a
Business Modeli
Wayne L. Wi

PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2011 by Wayne L. Winston
All rights reserved. No part of the contents of this boo
means without the written permission of the publisher.
Library of Congress Control Number: 2010934987
ISBN: 978-0-7356-4336-9
4 5 6 7 8 9 10 11 12 M 7 6 5 4 3 2
Printed and bound in the United States of America.
Microsoft Press books are available through bookseller
mation
about international editions, contact your local Micr
International directly at fax (425) 936-7329. Visit our c
mspinput@microsoft.com.
Microsoft and the trademarks listed at http://www.micr
Trademarks/EN-US.aspx are trademarks of the Microsoft g
their respective owners.
The example companies, organizations, products, domain
events depicted herein are fctitious. No association wit
n
e-mail address, logo, person, place, or event is intend
This book expresses the author’s views and opinions. The
any express, statutory, or implied warranties. Neither
distributors will be held liable for any damages caused
this book.
Acquisitions
Rosemary
Editor:
Caperton
Developmental
Devon
Editor:
Musgrave
Project
Rosemary
Editor:
Caperton
Editorial and
John
Production:
Pierce and Waypoint Press
Technical
Mitch
Reviewer:
Tulloch; Technical Review services provi
a member of CM Group, Ltd.
Cover:
Twist
Body Part No. X17-37446
[2012-01-20]

 
iii
Table of Contents
Introduction
..............................
ix
.
1 What’s New in....................
Excel 2010
1
2 Range Names
........................
9
3 Lookup Functions
......................
21
4 The INDEX Function
......................
29
5 The MATCH Function
.....................
33
6 Text Functions
........................
39
7 Dates and Date
....................
Functions
49
8 Evaluating Investments by Using Net P
Criteria
..........................
57
9 Internal Rate
.....................
of Return
63
10More Excel Financial
..................
Functions
69
11Circular References
......................
81
12IF Statements
........................
87
13Time and Time....................
Functions
105
14The Paste Special
...................
Command
111
Microsoft is interested in hearing your feedback so we can continually improve our books and learning
resources for you. To participate in a brief online survey, please visit:
www.microsoft.com/learning/booksurvey/
What do you think of this book? We want to hear from you!

iv
Table of Contents
15Three-Dimensional
.................
Formulas
117
16The Auditing
.....................
Tool
121
17Sensitivity Analysis
...............
with Data
127 Tabl
18The Goal Seek..................
Command
137
19Using the Scenario Manager
... for
1
. 4. 3....
Sens
20The COUNTIF, COUNTIFS, COUNT, COUNT
COUNTBLANK Functions
...................
149
21The SUMIF, AVERAGEIF, SUMIFS, and A
Functions
........................
157
22The OFFSET ....................
Function
163
23The INDIRECT...................
Function
177
24Conditional ...................
Formatting
185
25Sorting in
......................
Excel
209
26Tables
.........................
217
27Spin Buttons, Scroll Bars, Option B
Combo Boxes, and Group
...............
List 229
Boxes
28An Introduction to Optimization
.... 2.41.....
wit
29Using Solver to Determine...
the
2. 45
....
Optim
30Using Solver to Schedule
.......25
Your. 5Workf
.....
31Using Solver to Solve Transportatio
Problems
........................
261
32Using Solver for ...............
Capital Budgeting
267
33Using Solver for ...............
Financial Planning
275
34Using Solver to Rate
...............
Sports 281
Teams

Table of Contents
v
35Warehouse Location and the GRG Multis
Evolutionary Solver
...................
Engines 287
36Penalties and the ........
Evolutionary
2. 9.7......
Solver
37The Traveling Salesperson
................
Problem
303
38Importing Data from a .....
Text File
3. 0. 7......
or Docu
39Importing Data from
.................
the Internet
313
40Validating
.......................
Data
319
41Summarizing Data by.......
Using Histograms
3
. 2. 7......
42Summarizing Data by Using
....
Descriptive
3. 3.5..... S
43Using PivotTables and Slicers
..... 3. 49
......
to Descr
44Sparklines
.........................
381
45Summarizing Data with Database
.. 3. 8.7..
Statis
46Filtering Data and .......
Removing 3
.Duplicate
9. 5......
47Consolidating
......................
Data
411
48Creating Subtotals
......................
417
49Estimating Straight
........
Line Relationships
4. 2.3......
50Modeling Exponential
..................
Growth 431
51The Power.......................
Curve
435
52Using Correlations to Summarize
..... 4. 41
......
Relat
53Introduction to Multiple
................
Regression
447
54Incorporating Qualitative Factors int
Regression
.........................
453
55Modeling Nonlinearities
.......
and 46
Interacti
. 3
......

vi
Table of Contents
56Analysis of Variance:
..............
One-Way
471ANOVA
57Randomized Blocks and
.......47
Two-Way. 7ANOVA
.....
58Using Moving Averages to...
Understand
4. 8. 7.... Ti
59Winters’s .....................
Method
491
60Ratio-to-Moving-Average
......
Forecast
4.97.....
Me
61Forecasting in the Presence
..... 5
. of
0. 1....
Spec
62An Introduction to..............
Random Variables
509
63The Binomial, Hypergeometric, and N
Random Variables
.....................
515
64The Poisson and Exponential
..... 5Random
. 23
..... V
65The Normal Random
.................
Variable
527
66Weibull and Beta Distributions: Mod
and Duration ..................
of a Project
535
67Making Probability Statements
..... 5. 41
.....
from F
68Using the Lognormal Random Variable t
Stock Prices
.......................
545
69Introduction to Monte
.............
Carlo 549
Simulat
70Calculating an..................
Optimal Bid
559
71Simulating Stock Prices and
.. 5Asset
. 6.5.. Al
72Fun and Games: Simulating Gambling a
Event Probabilities
.....................
575
73Using Resampling ...............
to Analyze 583
Data
74Pricing Stock
....................
Options
587
75Determining Customer
.................
Value
601

Table of Contents
vii
76The Economic Order Quantity
.....60
Inventory
. 7...... M
77Inventory Modeling with
......
Uncertain
6.13......
Dem
78Queuing Theory: The Mathematics
...619...of Wa
79Estimating a Demand
...................
Curve
625
80Pricing Products.................
by Using Tie-Ins
631
81Pricing Products by Using Subjectively D
Demand
..........................
635
82Nonlinear ......................
Pricing
639
83Array Formulas ..................
and Functions647
84PowerPivot
.........................
665
Index
...........................
675
Microsoft is interested in hearing your feedback so we can continually improve our books and learning
resources for you. To participate in a brief online survey, please visit:
www.microsoft.com/learning/booksurvey/
What do you think of this book? We want to hear from you!

 
ix
Introduction
Whether you work for a Fortune 500 corporation
or a not-for-proft organization, if you’re rea
Microsoft Excel in your daily work. Your job p
analyzing data. It might also involve building a
profts, reduce costs, or manage operations mor
Since 1999, I’ve taught thousands of analysts a
Squibb, Cisco Systems, Drugstore.com, eBay, El
Intel, Microsoft, NCR, Owens Corning, Pfzer, P
U.S. Department of Defense, and Verizon how to u
in their jobs. Students have often told me tha
have saved them hours of time each week -and pr
proaches for analyzing important business prob
or Excel 2007. With the added power of Excel 2
ever dreamed! To paraphrase Alicia
, Excel
Silverstone
2007 is si
years ago.
I’ve used the techniques described in this boo
business problems. For example, I use Excel to h
evaluate referees, players, and lineups.-Durin
ness modeling and data analysis classes to MBA s
of Business. (As proof of my teaching excellen
consecutive years, and have won the school’s o
like to also note that 95 percent of MBA stude
modeling class even though it is an elective.
The book you have in your hands is an attempt t
everyone. Here is why I think the book will he
The materials have been tested while teachi
Fortune 500 corporations and government age
I’ve written the book as though I am talkin
transfers the spirit of a successful classr
I teach by example, which makes concepts ea
constructed to have a real-world feel. Many o
sent to me by employees of Fortune 500 corp
For the most part, I lead you through the a
answer a wide range of data analysis and bu
my explanations by referring to the sample w

 
x
Introduction
However, I have also included template fles f
website. If you want to, you can use these te
complete each example on your own.
For the most part, the chapters are short and o
should be able to master the content of most c
By looking at the questions that begin each c
of problems you’ll be able to solve after mas
In addition to learning about Excel formulas, y
a fairly painless fashion. For example,
-
you’l
mization models, Monte Carlo simulation,
-
inve
ics of waiting in line. You will also learn a
thinking, such as real options, customer valu
At the end of each chapter, I’ve provided a g
total) that you can work through on your own. T
information in each chapter. Answers to all p
companion website. Many of these problems are b
business analysts at Fortune 500 companies.
Most of all, learning should be fun. If you r
U.S. presidential elections, how to set footb
probability of winning at craps, and how to d
winning an NCAA tournament. These examples ar
teach you a lot about solving business proble
To follow along with this book, you must have E
book can be used with Excel 2003 or Excel 200
What You Should Know Before Rea
To follow the examples in this book you do not n
key actions you should know how to do are the fo
Enter a formula
You should know that formulas must be
You should also know the basic mathematical o
that an asterisk (*) is used for multiplicati
the caret key (^) is used to raise a quantity t
Work with cell
You
references
should know that when you copy a f
contains a cell reference such as $A$4 (an ab
by including the dollar signs), the formula s
to. When you copy a formula that contains a c
address), the column remains fxed, but the row c
formula that contains a cell reference such a
and the column of the cells referenced in the f

                                                     
Introduction
xi
How to Use This Book
As you read along with the examples in this bo
You can open the template fle that correspo
and complete each step of the example as yo
how easy this process is and amazed with how m
approach I use in my corporate classes.
Instead of working in the template, you can f
fnal version of each sample fle.
Using the Companion Content
This book features a companion website that ma
use in the book’s examples (both the fnal Exce
work with on your own). The workbooks and temp
each chapter. The answers to all chapter-endin
the sample fles. Each answer fle is named so th
fle containing the answer to Problem 2 in Chap
To work through the examples in this book, you n
computer. These practice fles, and other infor
detail page, located at:
http://go.microsoft.com/fwlink/?Linkid=207235
Display the detail page in your Web browser, a
the fles.
Your Companion eBook
The eBook edition of this book allows you to:
Search the full text
Print
Copy and paste
To download your eBook, please see the instruc

xii
     
Introduction
Errata and Book Support
We’ve made every effort to ensure the accuracy o
you do fnd an error, please report it on our Mic
1.
Go to
http://microsoftpress.oreilly.com.
2.
In the
Search
box, enter the book’s ISBN or ti
3.
Select your book from the search results.
4.
On your book’s catalog page, under the cover i
5.
Click
View/Submit Errata.
You’ll fnd additional information and services f
additional support, please e-mail Microsoft
.
Pres
Please note that product support for Microsoft s
addresses above.
We Want to Hear from You
At Microsoft Press, your satisfaction is our top p
valuable asset. Please tell us what you think of thi
http://www.microsoft.com/learning/booksurvey.
The survey is short, and we read
every one
of yo
for your input!
Stay in Touch
Let’s keep the conversation going! We’re on Twit

                                                     
Introduction
xiii
Acknowledgments
I am eternally grateful to Jennifer Skoog and N
hired me to teach Excel classes for Microsoft
-
f
tal in helping design the content and style of th
Lange of Eli Lilly, Pat Keating and Doug Hoppe o
Army also helped me refne my thoughts on teachi
I was blessed to work with John Pierce again, w
Mitch Tulloch did a great job with the technic
managing the book’s production and to proofrea
Rosemary Caperton and Devon Musgrave helped sh
I am grateful to my many students at the organi
School of Business. Many of them have taught m
Alex Blanton, formerly of Microsoft Press, cha
vision of developing a user-friendly text desi
Finally, my lovely and talented wife, Vivian, a
put up with my long weekend hours at the keybo

1
Chapter 1
What’s New in Excel 2
Microsoft Excel 2010 contains many new feature
including these:
Customizable
Now
ribbon
you can completely customize th
ribbon.
Sparklines
Cool graphs that summarize lots of dat
Slicers
Dashboard controls that make “slicing aa
much easier.
PowerPivot
A free add-in that enables you to qui
100 million rows of data based on data from m
and websites).
Solver
An improved Solver allows you to fnd the “
problems for which previous versions of the S
File
The
tab
new File tab on the ribbon replaces th
access to the File and Print menus.
Updated statistical
The accuracy
functions
of Excel statisti
been improved, and several new functions (i
WORKDAY.INTL, and NETWORKDAYS.INTL) have bee
Equations
You can now edit equations in Excel by u
similar to the Microsoft Word equation edit
Data bars
Data bars have been improved.
Paste Special
Paste Special options now include a l
Let’s now examine each of these exciting new f
Customizable Ribbon
In Excel 2007, users were not able to customiz
ribbon. In Excel 2010, it is easy to customize th
selecting File in the upper-left portion of th
Customize Ribbon page shown in Figure 1-1.

2
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 1-1
How to customize the ribbon.
As an example, suppose you want to show the Deve
the list at the right, and click OK. You can cha
selecting a tab, and then using the Move Up and M
click the drop-down arrow by Main Tabs, you can d
the tabs that appear when a given object is sele
Chart Tools, when you select a Chart object, the D
New Tab button allows you to create a new tab, a
a group within a tab. Of course, you can use the
group or tab.
Don’t Forget About the Quick Acce
The Quick Access Toolbar is an old friend from E
You probably use some Excel commands much more o
between tabs to fnd the command you need might s
Toolbar (see Figure 1-2) allows you to collect y
default location of the Quick Access Toolbar is a
the Excel window.
Fig
URE 1-2
Quick Access Toolbar.

Chapter
What’s
1
New in Excel
3
2010
You can add a command to the Quick Access Tool
and choosing Add To Quick Access Toolbar. You c
the upper-left portion of the ribbon. Next cli
the Quick Access Toolbar page (shown in Figure 1
to add, select Add, and click OK. Of course, t
customize the order in which icons appear. You c
Access Toolbar by right-clicking the command, a
Toolbar. You can move the Quick Access Toolbar b
toolbar, and selecting Show Below The Ribbon.
Fig
URE 1-3
You can add, remove, and arrange commands on the Q
People sometimes have trouble fnding commands th
but seem to have disappeared from Excel 2010. F
method used to create PivotTables: the layout m
method, you can fnd it by clicking the drop-dow
and choosing Commands Not In The Ribbon. After s
times is probably quicker!), you will fnd the P
which you can then add to your Quick Access To

4
Microsoft Excel 2010: Data Analysis and Business Modeling
Sparklines
Sparklines are small charts or graphs that ft in a s
graphical summary of data next to the data. Figu
daily customer counts at bank branches.
Fig
URE 1-4
Example of sparklines.
The sparklines make it clear that each branch is b
discussed in Chapter 44, “Sparklines.”
Slicers
PivotTables are probably the single most used to
“slice and dice your data” and are discussed in C
Summarize Data.” Excel 2010 allows you to use sl
data. The Name and Product slicers in Figure 1-5 e
computed for only the rows of data in which Eric a
investment accounts. Slicers are also discussed i
Fig
URE 1-5
Example of slicers.

Chapter
What’s
1
New in Excel
5
2010
PowerPivot
Organizations often have to create reports bas
For example, a bank might have customer data f
database. The bank might then want to create a c
the data from the individual branches. In the p
from different data sources. PowerPivot is a f
easily create PivotTables based on data from d
Using PowerPivot, you can quickly create Pivot
of data! PowerPivot is discussed in Chapter 84
New Excel Solver
The Excel Solver is used to fnd the best way t
cheapest way to meet customer demand by shippi
Excel 2010 contains a much improved version
-
of th
portant functions (such as IF, MAX, MIN, and A
versions of Excel, use of these functions in a S
an incorrect solution. I discuss the Excel Sol
File Tab
Excel 2007 introduced the Offce button. In Exc
by the File tab. The File tab is located at th
are presented with the choices shown in Figure 1

6
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 1-6
File tab options.
You can see that the File tab combines the Print a
Excel. Also, selecting Options lets you perform a v
ribbon or the Quick Access Toolbar, or installin
customizing the ribbon) were performed after cli
New Excel Functions
Many new functions (mostly statistical functions th
functions in previous versions)
,
PERCENTILE.EXC
have been added.
impr
F
accuracy of the RANK function. Statistical functi
Data by Using Descriptive Statistics,” and Chapt
(see Chapter 12, “IF Statements”) enables calcul
contain errors! The new WORKDAY.INTL
(see
and
Chapter
NETWORK
7
“Dates and Date Functions”) recognize the fact t
than Saturday and Sunday off from work. The accu
Chapter 10, “More Excel Financial Functions”) ha

Chapter
What’s
1
New in Excel
7
2010
New Equation Editor
Many readers of this book are probably long-ti
editor. In Excel 2010 you can now create equati
ribbon, you can then click Equation at the far r
in Figure 1-7.
Fig
URE 1-7
Equation editor templates.
For example, if you want to type an equation i
Large Operator options.
Sometimes you want a well-known equation (such a
your spreadsheet. After choosing Insert, click th
to import an already completed equation (such a
choosing Insert you select Symbol, you can ins
letter µ) into a cell.
improved Data Bars
Excel 2007 introduced using data bars as a meth
2010 data bars have been improved in two ways:
You can choose either Solid Fill or Gradien
Data bars recognize negative numbers.
Figure 1-8 shows an example of how the new dat
shading, and rows 12–17 contain solid shading. Y
in Chapter 24, “Conditional Formatting.”

8
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 1-8
Example of Excel 2010 data bars.
Paste Special Live Preview
If you right-click a range of cells and select P
of the Paste Special command), Excel 2010 brings u
choices, as shown in Figure 1-9.
Fig
URE 1-9
Paste Special live preview.
Clicking an option lets you see a preview of how y
that option.

9
Chapter 2
Range Names
Questions answered in this chapter:
I want to total sales in Arizona, California
use a formula to compute total sales in a f
+
SUM(A21:A25)
and still get the right answer
What does a formula like
Average(A:A)
do?
What is the difference between a name with w
scope?
I really am getting to like range names. I h
of the workbooks I have developed at the of
show up in my formulas. How can I make rece
previously created formulas?
How can I paste a list of all range names (
worksheet?
I am computing projected annual revenues as a m
a way to have the formula? look like
(1+growth
For each day of the week we are given the h
compute total salary for each
? day with the f
You have probably worked with worksheets. that u
Then you have to fnd out what’s contained in c
contain sales in each U.S. state, wouldn’t the f
In this chapter, I’ll teach you how to name in
how to use range names in formulas.
How Can i Create Named Ranges?
There are three ways to create named ranges:
By entering a range name in the Name box.
By clicking Create From Selection in the De
By clicking Name Manager or Defne Name in th
Formulas tab.

10
Microsoft Excel 2010: Data Analysis and Business Modeling
Using the Name Box to Create a Ra
The Name box (shown in Figure 2-1) is located di
the Name box, you need to display the Formula ba
box, simply select the cell or range of cells th
then type the range name you want to use. Press E
Clicking the Name arrow displays the range names d
display all the range names in a workbook by pre
dialog box. When you select a range name from th
the cells corresponding to that range name. This e
cell or range that you intended to name. Range n
Fig
URE 2-1
You can create a range name by selecting the cell r
range name in the Name box.
For example, suppose you want .
toSee
name
Figure
cell 2-2
F3
ea
fle Eastwest.xlsx. Simply select cell F3, type
e
select cell F4, type
west
in the Name box, and p
another cell, you see
. This
=east
means
instead
that of
whenever
=F3
you s
east
in a formula, Excel will insert whatever is i
Fig
URE 2-2
Naming cell F3
east
and cell F4
west.
Suppose you want to assign a rectangular
.
range o
Simply select the cell range A1:B4, type
Data
in th
formula such as
=AVERAGE(Data)
would average the c
Data.xlsx and Figure 2-3.
Fig
URE 2-3
Naming range A1:B4
Data.

Chapter
Range
2
Names
11
Sometimes you want to name a range of
rectangula
cells ma
ranges. For example, in Figure 2-4 and the fle
name
Noncontig
to the range consisting of cell
name, select any one of the three rectangles m
the Ctrl key, and then select the other two ra
key, type the name
Noncontig
in the Name box, a
formula will now refer to the contents of
- cell
ing the formula
=AVERAGE(Noncontig)
in cell E1
range add up to 57 and 57/12=4.75).
Fig
URE 2-4
Naming a noncontiguous range of cells.
Creating Named Ranges by Using t
Option
The worksheet States.xlsx contains sales durin
Figure 2-5 shows a subset of this data. We wou
with the correct state abbreviation. To do thi
Selection in the Defned Names group on the For
Left Column check box, as indicated in Figure 2
Fig
URE 2-5
By naming the cells that contain state sales with s
rather than the cell’s column letter and row number wh

12
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 2-6
Select Create From Selection.
Fig
URE 2-7
Select the Left Column check box.
Excel now knows to associate the names in the fr
cells in the second column of the selected
, B7 range
is named
, and
AK
so on. Note that creating these rang
been incredibly tedious! Click the Name arrow to v
created.
Creating Range Names by Using the N
If you click Name Manager on the Formulas tab an
box shown in Figure 2-8 opens.
Fig
URE 2-8
The New Name dialog box before creating any range n
Suppose you want to assign the name
range1
(rang
cell range A2:B7. Simply type
range1
in the Name b
=A2:B7
in the Refers To area. The New Name dialo
OK, and you’re done.

Chapter
Range
2
Names
13
Fig
URE 2-9
New Name dialog box after creating a range name.
If you click the Scope arrow, you can select th
your workbook. I’ll discuss this decision late
Workbook. You can also add comments for any of y
The Name Manager
If you now click the Name arrow, the name
rang
appears in the Name box. In Excel 2010, there i
names. Simply open the Name Manager by selecti
Name Manager. You will now see a list of all r
xlsx, the Name Manager dialog box will look li
Fig
URE 2-10
Name Manager dialog box for States.xlsx.

14
Microsoft Excel 2010: Data Analysis and Business Modeling
To edit any range name, simply double-click the r
click Edit. Then you can change the name of the r
scope of the range.
To delete any subset of range names, frst select t
range names are listed consecutively, simply sel
want to delete, hold down the Shift key, and sel
range names are not listed consecutively, you ca
and then hold down the Ctrl key while you select th
press the Delete key to delete the selected rang
Now let’s look at some specifc examples of how t
Answers to This Chapter’s Quest
I want to total sales in Arizona, California,
. Can I
Mo
use a formula to compute total sales in a form s
SUM(A21:A25) and still get the right answer?
Let’s return to the fle States.xlsx, in which we a
name for the state’s sales. If you want to compu
Arkansas, you could clearly
. You
usecould
the formula
also point
SUM(
t
B8, and B9, and the formula would
. The be
latter
entered
formul
as
course, much easier to understand.
As another illustration of how to use range name
in Figure 2-11, which contains annual percentage r
rows are hidden in this fgure; the data ends in r
Fig
URE 2-11
Historical investment data.

Chapter
Range
2
Names
15
After selecting the cell range B7:D89 created
and choo
names in the top row of the range.
, theThe range
C8:C
B
T.Bills
, and the range
. Now
D8:D89
you
T.Bonds
no longer need to re
data is. For example, in
gE
cell
,
(
youB91,
can after
press typin
F3 an
Name dialog box appears, as shown in Figure 2-
Fig
URE 2-12
You can add a range name to a formula by using t
Then you can select Stocks in the Paste Name l
parenthesis, the formula,
=AVERAGE(Stocks),
co
percent). The beauty of this approach is that e
you can work with the stock return data anywhe
I would be remiss if I did not mention the exc
you begin typing
, Excel
=Average(T
shows you a list of range n
with T. Then you can simply double-click T.Bil
What does a formula like Average(A:A) do?
If you use a column name (in the form A:A,
entire
C:C
column as a named range. For example, entering th
all numbers in column A. Using a range name fo
frequently enter new data into a column. For e
of a product, as new sales data is entered eac
monthly sales average. I caution you, however, t
in column A, you will get a circular reference
-
m
ing the average formula depends on the cell co
resolve circular references in Chapter 11, “Ci
=AVERAGE(1:1)
will average all numbers in row 1
What is the difference between a name with wor
scope?
The fle Sheetnames.xlsx will help you understa
have workbook scope and range names that have w

16
Microsoft Excel 2010: Data Analysis and Business Modeling
with the Name box, the names have workbook scope
Name box to assign the name
sales
to the cell ra
the numbers 1, 2, and 4, respectively. Then if y
any worksheet, you obtain an answer of 7. This i
workbook scope, so anywhere in the workbook wher
workbook scope) the name refers to cells E4:E6 o
the formula
=SUM(sales),
you will obtain 7 becau
sales
to cells E4:E6 of Sheet3.
Now suppose that you type 4, 5, and 6 in cells E
of Sheet2. Next you go to the Name Manager, give th
and defne the scope of this name as Sheet1. Then y
Manager, and give the name
jam
to cells E4:E6, a
The Name Manager dialog box now looks like Figur
Fig
URE 2-13
Name Manager dialog box with worksheet and workboo
Now, what if you enter the formula
=SUM(jam)
in e
total cells E4:E6 of Sheet1. Because those cells c
=Sum(jam)
will total cells E4:E6
. In of
Sheet3,
Sheet2,
however
yiel
formula
=SUM(jam)
will yield a
#NAME?
error beca
in Sheet3. If you enter anywhere in Sheet3
-
the f
nize the worksheet-level name that represents ce
of
3 + 4
.
+
Thus,
5 =12
prefacing a worksheet-level name by i
exclamation point (!) allows you to refer to a w
the sheet in which the range is defned.

Chapter
Range
2
Names
17
I really am getting. Itohave
likestarted
range names
defining ran
the workbooks I have developed
. However, at the
range
office
name
in my formulas
. How can I make recently created -range n
ated formulas?
Let’s look at the fle Applynames.xlsx. See Fig
Fig
URE 2-14
How to apply range names to formulas.
I entered the price of a product in cell F3, a
The unit cost and fxed cost are entered in
-
cel
ed in cell F7 with the
. Iformula
used Formulas,
=F4*(F3–F5)–F6
Create F
chose the Left Row option
, celltoF4
, name
cell
demand
cell
F5
, cell
unit
F3 F6
pric
cos
f
cost
, and cell
. You
F7 would
proft
like these range names to s
formulas. To apply the range names, frst selec
applied (in this case, F4:F7). Now go to the D
the Defne Name arrow, and then click Apply Nam
and then click OK. Note that cell F4 now contai
contains the formula
=demand*(price–unitcost)–
, as you wanted.
By the way, if you want the range names to app
entire worksheet by clicking the Select All bu
headings.
How can I paste a list of all range names (and
Press F3 to display the Paste Name box, and th
Figure 2-12.) A list of range names and the ce
your
worksheet, beginning at the current cell l
I am computing projected annual revenues
. Is there
as a ma
way to have the formula look like (1+growth)*l
The fle Last year.xlsx contains the solution t
to compute revenues for 2012–2018 that grow at 1
million in 2011.

18
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 2-15
Creating a range name for
last year.
To begin, we use the Name. box
Now to
comes
namethe
cell
neat
B3 par
gr
the cursor to B7 and bring up the New Name dialo
Defned Names group on the Formulas tab. Then fll i
in Figure 2-16.
Fig
URE 2-16
In any cell, this name refers to the cell above the a
Because we are in cell B7, Excel interprets this r
the current cell. Of course, this would not work i
signs. Now if we enter
lastyear*(1+growth)
in cell
and
B7
copy
the formula
it down
=
to th
range B8:B13, each cell will contain the formula w
of the cell directly above the active cell.
For each day of the week we are given
. Canthe
we hourly w
compute total salary for each day with the formu
As shown in Figure 2-17 (see the fle Namedrows.x
row 13 contains hours worked each day.

Chapter
Range
2
Names
19
Fig
URE 2-17
In any cell, this name refers to the cell above t
You can simply select row 12 (by clicking on th
wage
. Then select row 13 and use the
. If
Name
youbox
nowte
in cell F14 the formula
wage*hours
and copy thi
that in each column Excel fnds the wage and ho
Remarks
Excel does not allow you to use the letters
If you use Create From Selection to create a
spaces, Excel inserts an underscore (_) to fl
Product 1
is created
.
as
Product_1
Range names cannot begin with numbers or lo
and
A4
are not allowed as range names. Beca
a range name such as
cat1
is not permitted b
name a cell
, Excel
CAT1
tells you the name is invali
name the cell cat1_.
The only symbols allowed in range names are p
Problems
1.
The fle Stock.xlsx contains monthly stock r
Name the ranges containing the monthly retu
average monthly return on each stock.
2.
Open a worksheet and name the range containi
.
3.
Given the latitude and longitude of any two c
the distance between the two cities. Defne r
of each city and ensure that these names sh
4.
The fle Sharedata.xlsx contains the numbers o
price of each stock. Compute the value of th
shares*price
.
5.
Create a range name that averages the last f
are listed in a single column.

21
Chapter 3
Lookup Functions
Questions answered in this chapter:
How do I write a formula to compute tax rat
Given a product ID, how can I look up the p
Suppose that a product’s price changes over ti
sold. How can I write a formula to compute th
Syntax of the Lookup Functions
Lookup functions enable you to “look up” value
2010 allows you to perform both vertical looku
horizontal lookups (by using the HLOOKUP functi
operation starts in the frst column of -a works
eration starts in the frst row of a worksheet r
lookup functions involve vertical lookups, I’l
VLOOKUP Syntax
The syntax of the VLOOKUP function is as follow
arguments.
VLOOKUP(lookup value,table range,column index,[range lookup])
Lookup value
is the value that you want to l
range.
Table range
is the range that contains the e
the frst column, in which you try and match th
in which you want to look up formula result
Column index
is the column number in the ta
lookup function is obtained.
Range lookup
is an optional argument. The p
specify an exact or approximate match.
- If th
ted, the frst column of the table range mus
range lookup
argument is
True
or omitted an

22
Microsoft Excel 2010: Data Analysis and Business Modeling
is found in the frst column of the table rang
the table in which the exact match is found. I
omitted and an exact match does not exist, Ex
in the frst column that is less than the look
False
and an exact match to the lookup value i
range, Excel bases the lookup on the row of th
found. If no exact match is obtained, Excel r
Note that a
range lookup
argument of
1
is equ
argument of
0
is equivalent to
False.
HLOOKUP Syntax
In an HLOOKUP function, Excel tries to locate th
column) of the table range. For an HLOOKUP functi
column
.to
row
Let’s explore some interesting examples of looku
Answers to This Chapter’s Quest
How do I write a formula to compute tax rates ba
The following example shows how a VLOOKUP functi
table range consists of numbers in ascending ord
income, as shown in the following table.
Income level Tax rate
$0–$9,999
15%
$10,000–$29,99390%
$30,000–$99,99394%
$100,000 and over
40%
To see an example of how to write a formula that c
open the fle Lookup.xlsx, shown in Figure 3-1.

Chapter
Lookup
3
Functions
23
Fig
URE 3-1
Using a lookup function to compute a tax rate. Th
range are sorted in ascending order.
I began by entering the relevant information (
I named the table. range
I recommend
D6:E9
lookup
that you always n
using as the table range. If you do so, you ne
table range, and when you copy any formula inv
will always be correct. To illustrate how the l
in the range D13:D17. By copying from E13:E17
, I
th
computed the tax rate for the income levels li
function worked in cells E13:E17. Note ,that
the be
answer always comes from the second column of th
In D13, the income of –$1,000 yields #N/A be
income level in the frst column of the tabl
associated with an income of –$1,000, simpl
–1,000 or smaller.
In D14, the income of $30,000 exactly match
range, so the function returns a tax rate o
In D15, the income level of $29,000 does not e
umn of the table range, which means the loo
less than $29,000 in the frst column of the r
returns the tax rate in column 2 of the tab
In D16, the income level of $98,000 does not y
of the table range. The lookup function sto
in the frst column of the table range. This r
range opposite $30,000—34 percent.

24
Microsoft Excel 2010: Data Analysis and Business Modeling
In D17, the income level of $104,000 does not y
of the table range. The lookup function stops a
in the frst column of the table range, which r
table range opposite $100,000—40 percent.
In F13:F17, I changed the value of the
range l
copied from F13 to F14:F17 the formula
. Cell F14
VLOOKU
sti
yields a 34 percent tax rate because the frst c
exact match to $30,000. All the other entries i
of the other incomes in D13:D17 have an exact m
table range.
Given a product ID, how can I look up the produc
Often, the frst column of a table range does not c
example, the frst column of the table range migh
In my experience teaching thousands of fnancial a
know how to deal with lookup functions when the fr
consist of numbers in ascending order. In these s
simple rule: use
False
as the value of the
range l
Here’s an example. In the fle Lookup.xlsx (see Fi
products, listed by their product ID code. How d
code and returns the product price?
Fig
URE 3-2
Looking up prices from product ID codes. When the t
enter
False
as the last argument in the lookup function f
Many people would enter the formula as
. I have in c
However, note that when you omit the fourth argu
value is assumed
. Because
to bethe
True
product IDs in the tab
are not listed in alphabetical order, an incorre
formula
VLOOKUP(H18,Lookup2,2,False)
the correct price
in cell
($5.20
I18
You would also use
False
in a formula designed t
employee’s last name or ID number.

Chapter
Lookup
3
Functions
25
By the way, you can see in Figure 3-2 that col
yob
uegin by selecting the columns you want to hi
In the Cells group, click Format, point to Hid
Hide Columns.
Suppose that a product’s. Iprice
know changes
the dateover
the
.
ti
p
How can I write a formula to compute the produ
Suppose the price of a product depends on the d
a lookup function in a formula that will pick u
suppose the price of a product is as shown in th
Date sold
Price
January–April 200$
598
May–July 2005
$105
August–December 2005
$112
Let’s write a formula to determine the correct p
product is sold in the year 2005. For variety, w
dates when the price changes in the frst row o
shown in Figure 3-3.
Fig
URE 3-3
Using an HLOOKUP function to determine a price th
I copied from C8 to C9:C11 the .formula
This formula
HLOOKUP
tr
to match the dates in column B with the frst r
1/1/05 and 4/30/05, the lookup function stops a
date between 5/01/05 and 7/31/05, the lookup s
and for any date later than 8/01/05, the looku

26
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
1.
The fle Hr.xlsx gives employee ID codes, sala
formula that takes a given ID code and yields th
formula that takes a given ID code and yields th
2.
The fle Assign.xlsx gives the assignment of w
each worker for each group (on a scale from 0 t
gives the suitability of each worker for the g
3.
You are thinking of advertising Microsoft pro
more ads, the price of each ad decreases as s
Number of ads
Price per ad
1–5
$12,000
6–10
$11,000
11–20
$10,000
21 and higher
$9,000
For example, if you buy 8 ads, you pay $11,00
$10,000 per ad. Write a formula that yields th
ads.
4.
You are thinking of advertising Microsoft pro
You pay one price for the frst group of ads, b
decreases as shown in the following table.
Ad number
Price per ad
1–5
$12,000
6–10
$11,000
11–20
$10,000
21 or higher
$9,000
For example, if you buy 8 ads, you pay $12,00
for each of the next 3 ads. If you buy 14 ads
ads, $11,000 for each of the next 5 ads, and $
formula that yields the total cost of purchas
need at least three columns in your table ran
lookup functions.

Chapter
Lookup
3
Functions
27
5.
The annual rate your bank charges you to bo
shown in the following table.
Duration of loanAnnual loan rate
1 year
6%
5 years
7%
10 years
9%
30 years
10%
If you borrow money from the bank for any d
listed in the table, your rate is found by i
table. For example, let’s say you borrow mo
quarter of the way between 10 years and 30 y
culated as follows:
+
=
4
1
(9)
4
3
(10)
9.75%
Write a formula that returns the annual int
1 and 30 years.
6.
The distance between any two U.S. cities (e
approximated by the formula
69 *
(lat1 - lat2)
2
+ (long1 - long2)
2
The fle Citydata.xlsx contains the latitude a
table that gives the distance between any t
7.
In the fle Pinevalley.xlsx, the frst worksh
at Pine Valley University, the second works
the third worksheet contains the years of e
contains the salary, age, and experience fo
8.
The fle Lookupmultiplecolumns.xlsx contains i
an electronics store. A salesperson’s name w
that can be copied from C17 to D17:F17 that w
to C17, TV sales to D17, printer sales to E1

28
Microsoft Excel 2010: Data Analysis and Business Modeling
9.
The fle Grades.xlsx contains student’s grades o
follows:
Score
Grade
Below 60
F
61–69
D
70–79
C
80–89
B
90 and aboveA
Use Excel to return each student’s letter gra
10.
The fle Employees.xlsx contains the ranking e
scale) to three jobs. The fle also gives the j
formula to compute each worker’s ranking for th
11.
Suppose one dollar can be converted to 1,000 y
spreadsheet where the user can enter an amoun
spreadsheet converts dollars to the entered c

29
Chapter 4
The INDEX Function
Questions answered in this chapter:
I have a list of distances between U.S. citi
distance between, for example, Seattle and Mia
Is there a way I can write a formula that r
distances between each city and Seattle?
Syntax NDEX
of the
Function
The INDEX function allows you to return the en
numbers. The most commonly used syntax for the I
INDEX(Array,Row Number,Column Number)
To illustrate, the formula
INDEX(A1:D12,2,3)
r
column of the array A1:D12. This entry is the o
Answers to This Chapter’s Ques
I have a list of S..distances
cities
. How dobetween
I writeU a functio
distance between, for example, Seattle and Mia
The fle Index.xlsx (see Figure 4-1) contains th
C10:J17, which contains the
.
distances, is name
Fig
URE 4-1
You can use the INDEX function to calculate the d

30
Microsoft Excel 2010: Data Analysis and Business Modeling
Suppose that you want to enter the distance betw
distances from Boston are listed in
, and
the
- dis
frst row o
tances to Denver are listed in the fourth column o
is
INDEX(distances,1,4)
. The results show that Boston and Den
Similarly, to fnd the (much longer) distance bet
formula
INDEX(distances,6,8)
. Seattle and Miami are 3,389 miles a
Imagine that the Seattle Seahawks NFL team is em
games in Phoenix, Los Angeles (an exhibition agai
At the conclusion of the road trip, the Seahawks r
how many miles they travel on the trip? As you c
cities the
8-7-5-4-3-2-8
Seahawks
) in
visit
the (
order they are visited
in Seattle, and copy from D21 to D26
. The
the formula
in D21 computes the distance between Seattle and P
D22
computes the distance between Phoenix and Los A
travel a total of 7,112 miles on their road trip
that the Miami Heat travel more miles during the N
Fig
URE 4-2
Distances for a Seattle Seahawks road trip.
Is there a way I can write a formula that
- refere
tances between each city and Seattle?
The INDEX function makes it easy to reference an e
the row number to 0, the INDEX function referenc
number to 0, the INDEX function references the l
to total the distances from each listed city to S
formulas:
SUM(INDEX(distances,8,0))
SUM(INDEX(distances,0,8))
The frst formula totals the numbers in the eighth r
second formula totals the numbers in the eighth c
either case, you fnd that the total distance fro
you can see in Figure 4-1.

Chapter
The4 INDEX Function
31
Problems
1.
Use the INDEX function to compute the dista
and the distance between Denver and Miami.
2.
Use the INDEX function to compute the total d
3.
Jerry Jones and the Dallas Cowboys are emba
Chicago, Denver, Los Angeles (an exhibition a
many miles will they travel on this road tr?
4.
The fle Product.xlsx contains monthly sales f
to compute the sales of Product 2 in March. U
sales during April.
5.
The fle Nbadistances.xlsx shows the distanc
you begin in Atlanta, visit the arenas in th
How far would you travel?
6.
Use the INDEX function to solve problem 10 o

33
Chapter 5
The MATCH Function
Questions answered in this chapter:
Given monthly sales for several products, h
sales of a product during a specifc month? F
sell during June?
Given a list of baseball players’ salaries, h
with the highest salary? How about the play
Given the annual cash flows from an investme
returns the number of years required to pay b
Suppose you have a worksheet with fve thousand r
need to fnd the
, name
which
John
you
Doe
know appears somewhe
the list. Wouldn’t you like to know of a formu
name John Doe is located? The MATCH function e
frst occurrence of a match to a given text
- str
tion instead of a lookup function in situation
a range rather than the value in a particular c
Match(lookup value,lookup range,[match type])
In the explanation that follows, we’ll assume th
the same column. In this syntax:
Lookup value
is the value you’re trying to m
Lookup range
is the range you’re examining f
lookup range must be a row or column.
Match type=1
requires the lookup range to c
order. The MATCH function then returns the r
to the top of the lookup range) that contai
than or equal to the lookup value.
Match type=–1
requires the lookup range to c
order. The MATCH function returns the row lo
top of the lookup range) that contains the l
equal to the lookup value.
Match type=0
returns the row location in th
exact match to the lookup value. (I discuss h
Chapter 20, “COUNTIF, COUNTIFS, COUNT, COUNT

34
Microsoft Excel 2010: Data Analysis and Business Modeling
When no exact match exists
, Exceland
returns
match
the
type=0
error m
Most MATCH function applications
, but if
match
use
match
type ty
is n
match type=1
is assumed. Thus, use
match type
range are unsorted. This is the situation you u
The fle Matchex.xlsx, shown in Figure 5-1, contai
syntax.
Fig
URE 5-1
Using the MATCH function to locate the position of a v
In cell B13, the formula
MATCH(“Boston”,B4:B11,0
range B4:B11 contains
. Text
the
values must
Boston
be enclosed i
(
)
. In cell B14, the formula
MATCH(“Phoenix”,B4:
seventh cell in B4:B11) is the frst cell in the r
formula
MATCH(0,E4:E11,1)
returns 4 because the l
in the range E4:E11 is in cell E7 (the fourth ce
MATCH(–4,G4:G11,–1
) returns 7 because the last number th
in the range G4:G11 is contained in cell G10 (th
The MATCH function can also work with an inexact m
MATCH(“Pho*”,B4:B11,0)
returns 7. The asterisk i
Excel searches for the frst text string
. Incidentally
in the r
this same technique can be used with a lookup fu
exercise in Chapter 3, “Lookup Functions,”
) would the f
return the price of product X212 ($4.80).
If the lookup range is contained in a single row
match in the lookup range, moving from left to r
the MATCH function is often very useful when it i
as VLOOKUP, INDEX, or MAX.

Chapter
The5 MATCH Function
35
Answers to This Chapter’s Ques
Given monthly sales for several products, how d
of a product during a specific month? For-examp
ing June?
The fle Productlookup.xlsx (shown in Figure 5-
from January through June. How can you write a f
product during a specifc month? The trick is t
which the given product is located, and anothe
the given month is located. You can then use th
for the month.
Fig
URE 5-2
The MATCH function can be used in combination wit
I named the range B4:G7, which contains
. I entered
sales
th d
product I want to know about in cell A10
- and th
mula
MATCH(A10,A4:A7,0)
to determine which row n
sales fgures for the Kobe doll. Then, in cell D
determine which column number in the range
Sal
the row and column numbers that contain the sa
INDEX(Sales,C10,D10)
in cell E10 to yield the p
information on the INDEX function, see Chapter 4
Given a list of baseball players’ salaries, ho
with the highest salary? How about the player w
The fle Baseball.xlsx (see Figure 5-3) lists th
players during the 2001 season. The data- is not s
mula that returns the name of the player with th
with the ffth-highest salary.
To fnd the name of the player with the highest s
Use the MAX function to determine the value o
Use the MATCH function to determine the row th
highest salary.

36
Microsoft Excel 2010: Data Analysis and Business Modeling
Use a VLOOKUP function (keying off the data r
look up the player’s name.
I named the range C12:C412, which .includes
I named the p
range used in our VLOOKUP function
.
(range A12:C4
Fig
URE 5-3
This example uses the MAX, MATCH, and VLOOKUP funct
value in a list.
In cell C9, I fnd the highest player salary
. Next,($22 mi
in cell C8, I use the formula
MATCH(C9,Salaries,
player with the highest salary. I used
match typ
either ascending or descending order. Player num
cell C6, I use the function
VLOOKUP(C8,Lookup,2)
column of the lookup range. Not surprisingly, we fn
paid player in 2001.
To fnd the name of the player with the ffth-high
the ffth-largest number in an array. The LARGE f
LARGE function is.
LARGE(cell
When the LARGE
range,k)
function
-
is en
turns the
k
t
-
h
largest number in a cell range. Thus, the f
yields the ffth-largest salary ($12.6 million). P
is the player with the ffth-highest salary. (The
beginning of the season, Jeter was on the disabl
return the ffth-lowest salary.
Given the annual cash flows from an investment pr
returns the number of years required to pay back t

Chapter
The5 MATCH Function
37
The fle Payback.xlsx, shown in Figure 5-4, show
project over the next 15 years. We assume that i
of $100 million. During Year 1, the project ge
cash flows to grow at 10 percent per year. How m
back its investment?
The number of years required for a project to p
period.
In high-tech industries, the payback p
learn in Chapter 8, “Evaluating Investments
-
by U
back is flawed as a measure of investment quali
time.) For now, let’s concentrate on how to de
investment model.
Fig
URE 5-4
Using the MATCH function to calculate an investme
To determine the payback period for the projec
In column B, compute the cash flows for each y
In column C, compute the cumulative cash flow
Now you can use the MATCH )function
to determine
(with the
match
row
t
n
the frst year in which cumulative cash flow is p
period.
I gave the cells in B1:B3 the range names
-
list
ment) is entered in cell B5. Year 1 cash flow (
to B8:B20 the formula
B6*(1+Growth)
computes th

38
Microsoft Excel 2010: Data Analysis and Business Modeling
To compute the Year 0 cumulative cash flow, I use
you can calculate cumulative cash flow by using a f
flow=Year t–1 cumulative
.
cash
To implement
flow+Year
this
cash
relati
flow
copy from C6 to C7:C20
.
the formula
=C5+B6
To compute the payback period, use)the
to compute
MATCH fun
the last row of the range C5:C20 containing a va
you the payback period. For example, if the last r
0 is the sixth row in the range, that means the s
for the frst year the project is paid back. Beca
during Year 6. Therefore, the ,formula
yields in
the
- cell
payba
E2,
riod (6 years). If any cash flows after Year 0 ar
of cumulative cash flows would not be listed in a
Problems
1.
Using the distances between U.S. cities given i
using the MATCH function to determine (based o
between any two of the cities.
2.
The fle Matchtype1.xlsx lists in chronologica
transactions. Write a formula that yields the fr
date exceeds $10,000.
3.
The fle Matchthemax.xlsx gives the product ID c
Use the MATCH function in a formula that yiel
with the largest unit sales.
4.
The fle Buslist.xlsx gives the amount of time b
Street and Park Avenue in New York City. Writ
the frst bus, gives the amount of time you ha
arrive 12.4 minutes from now, and buses arriv
you wait
21–12.4=8.6
minutes for a bus.
5.
The fle Salesdata.xlsx contains the number of c
Create a formula that returns the units sold by a g
6.
Suppose the VLOOKUP function was removed from E
“get along” by using the MATCH and INDEX func

39
Chapter 6
Text Functions
Questions answered in this chapter:
I have a worksheet in which each cell contai
a product price. How can I put all the prod
IDs in column B, and all the prices in colu
Every day I receive data about total U.S. s
East, North, and South regional sales. How c
separate cells?
At the end of each school semester, my stud
a scale from 1 to 7. I know how many student
can I easily create a bar graph of my teachi
When someone sends you data or you download da
the way you want. For example, in sales data y
be in the same cell, but you need them to be i
data so that it appears in the format you need
Microsoft Excel text functions. In this chapte
text functions to magically manipulate your da
LEFT
RIGHT
MID
TRIM
LEN
FIND
SEARCH
REPT
CONCATENATE
REPLACE
VALUE
UPPER
LOWER
CHAR

40
Microsoft Excel 2010: Data Analysis and Business Modeling
Text Function Syntax
The fle Reggie.xlsx, shown in Figure 6-1, includ
to apply these functions to a specifc problem la
what each of the text functions does. Then we’ll c
fairly complex manipulations of data.
Fig
URE 6-1
Examples of text functions.
The LEFT Function
The function
text,k)
LEFT(
returns the frst
k
characters in a
contains the formula
. Excel
LEFT(A3,4)
returns
.
Regg
The RIGHT Function
The function
RIGHT(text,k)
returns the last
k
ch
cell C4, the formula
.
RIGHT(A3,4)
returns
ller
The MID Function
The function
MID(text,k,m)
begins at character
k
characters. For example, the formula
MID(A3,2,5)
cell A3, the .
result being
eggie
The TRIM Function
The function
TRIM(text)
removes all spaces from a te
between words. For example, in cell C5 the formu
spaces between Reggie and .Miller
The TRIM
and function
yields
-
Regg
al
moves spaces at the beginning and end of the cel

Chapter
Text
6 Functions
41
The LEN Function
The function
LEN(text)
returns the number of c
For example, in cell C6, the formula
LEN(A3)
-
r
ters. In cell C7, the formula
LEN(C5)
returns 1
spaces removed, cell C5 contains two fewer cha
The FIND and SEARCH Functions
The function
text FIND(
to fnd,actual text,k)
returns th
the frst character of
. FIND
text
is
to
case
fnd
in
sensitive.
actual te
S
syntax as FIND, but it is not case sensitive. F
returns 15, the location of the frst
. (The
lowercase
upper
R
is ignored because FIND is case sensitive.) E
1 because SEARCH matches
r
to either a lowerca
Entering
FIND(“ “,A3,1)
in cell C9 returns 7 b
is the seventh character.
The REPT Function
The REPT function allows you to repeat a text s
is
REPT(text,
number of
. For
times)
example
REPT(“|”,3)
produce
The CONCATENATE and & Functions
The function
CONCATENATE(text1,text2, ...,te
into a single string. The & operator can be us
entering in cell&
&
C12
B“1
returns
the formula
.
Reggie
Entering
A1 Miller
in cell D
formula
CONCATENATE(A1,” “,B1)
yields the same r
The REPLACE Function
The function
oldREPLACE(
text,k,m,new text)
begins at cha
next
m
characters
. For
with
example,
new text
in cell C13, the f
replaces the third
gg
and
) infourth
cell
. A3
This
characters
with
formula
nn
(yiel
Miller
.

42
Microsoft Excel 2010: Data Analysis and Business Modeling
The VALUE Function
The function
text)
VALUE(
converts a text string that repre
example, entering in cell B15 the formula
VALUE(
to the numerical value 31. You can identify the v
justifed. Similarly, you can identify the value 3
justifed.
The UPPER and LOWER Functions
The function
UPPER(text)
changes
text
to all upp
UPPER(A1)
.yields
Similarly,
JAN
the function
LOWER(text)
contains
,
LOWER(A1)
JAN
. yields
jan
The CHAR Function
The function
number)
CHAR(
yields (for a number between 1 a
with that number. For example,
CHAR(65)
yields A
Answers to This Chapter’s Quest
You can see the power of text functions by using th
were sent to me by former students working for F
solving problems is to combine multiple text fun
I have a worksheet in which each cell contains a p
product . price
How can I put all the product descriptio
in column B, and all the prices in column C?
In this example, the product ID is always defned by th
always indicated in the last 8 characters (with t
The solution, contained in the fle Lenora.xlsx a
MID, VALUE, TRIM, and LEN functions.
It’s always a good idea to begin by trimming exc
from B4 to B5:B12 .the
Theformula
only excess
TRIM(A4)
spaces in co
the two spaces inserted after each price. To see thi
edit the cell. If you move to the end of the cel
using the TRIM function are shown in Figure 6-2. T
the two extra spaces at the end of cell A4, you c
to show that cell A4 contains 52 characters and c

Chapter
Text
6 Functions
43
Fig
URE 6-2
Using the TRIM function to trim away excess space
To capture the product ID, you need to extract th
do this, copy from C4 to .C5:C12
This formula
the formula
-extrac
LE
most characters from the text in cell B4 and th
you can see in Figure 6-3.
Fig
URE 6-3
Using text functions to extract the product ID, p
To extract the product price, we know that the p
so we need to extract the rightmost six charac
D5:D12 the formula.
VALUE(RIGHT(B4,6))
used the VALUE function t
into a numerical value. If you don’t convert t
mathematical operations on the prices.
Extracting the product description is much tri
we begin our extraction with the thirteenth ch
from the end of the cell, we can get the
- data w
mula
MID(B4,13,LEN(B4)–6–12)
does the job.
LEN
in the trimmed text. This formula (MID for Mid
then extracts the number of characters equal t
the beginning (the product ID) and the 6 chara
only the product description.
Now suppose you are given the data with the pr
and the product description in column E. Can y
original text?
Text can easily be combined by using the CONCA
F5:F12 the formula
CONCATENATE(C4,E4,D4)
recov
can see in Figure 6-3.

44
Microsoft Excel 2010: Data Analysis and Business Modeling
The concatenation formula starts with the produc
description from cell E4. Finally, you add the p
entire text describing each computer! Concatenati
sign. You could recover the original product ID, p
with the formula
. Note
C4&E4&D4
that cell E4 contains- a spac
tion and a space after the product description. I
could use the formula
C4&” “&E4&” “&D4
to insert th
between each pair of quotation marks results in th
If the product IDs did not always contain 12 cha
information would fail. You could, however,
-
extr
tion to discover the location of the frst space. T
the LEFT function to extract all characters to th
next section shows how this approach works.
If the price did not always contain precisely si
little tricky. See Problem 15 for an example of h
Every day I receive
S.. sales,
data about
which
total
is computed
U
in a c
East, North, and South
. How can
regional
I extract
salesEast, North
separate cells?
This problem was sent to me by an employee in th
received a worksheet each day containing
, formula
and so on. She needed to extract each number int
she wanted to extract the frst number (East
-
sale
ber (North sales) to column D, and the third num
this problem challenging is that we don’t know th
the second and third numbers start in each cell. I
character. In cell A4, North sales begin with th
The data for this example is in the fle Salesstr
identify the locations of the different regions’ s
East sales are represented by every character t
North sales are represented by every characte
South sales are represented by every characte
By combining the FIND, LEFT, LEN, and MID functi
follows:
Use the Edit, Replace command to replace each e
the equal signs, select the range A3:A6. Then

Chapter
Text
6 Functions
45
click Find & Select, and then click Replace
and insert a space in the Replace With feld
formula into text by replacing the equal si
Use the FIND function to locate the two plu
Fig
URE 6-4
Extracting East, North, and South sales with a co
functions.
Begin by fnding the location of the frst plus s
to B4:B6 the formula
, you
FIND(“+”,A3,1)
can locate the frst plus s
fnd the second plus sign, begin one character a
C4:C6 the formula.
FIND(“+”,A3,B3+1)
To fnd East sales, you can use the LEFT functi
frst plus sign, copying from D3
. To
to extract
D4:D6 the
Norf
use the MID function to extract all the charac
character after the frst plus sign and extract th
2nd plus sign)–(Position
. If you
of
leave
1st plus
out
sign
the
)
–1,
1
y
sign. (Go ahead and check this.) So, to get No
MID(A3,B3+1,C3–B3–1)
.
To extract South sales, you use the RIGHT func
right of the second plus sign. South sales wil
(Total
characters in cell)
.
You
(Position
compute
of
the
2nd
total
plus
n
s
characters in each cell by copying
. Finally,
from F3 you
to Fc
obtain South sales by copying from .G3 to G4:G6 th
Extracting Data by Using the Tex
There is an easy way to extract East, North, a
without using text functions. Simply select
-
ce
bon, in the Data Tools group, click Text To Co
in the dialog box as shown in Figure 6-5.

46
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 6-5
Convert Text To Columns Wizard.
Entering the plus sign in the Delimiters area di
breaking at each occurrence of the plus sign. Not
data at tabs, semicolons, commas, or spaces. Now c
your destination range (in the example, I chose c
in Figure 6-6.
Fig
URE 6-6
Results of Convert Text To Columns Wizard.
At the end of each school semester, my students e
scale from
. I 1know
to 7how many students gave
. How
me can
each p
I easily create a bar graph of my teaching evalu
The fle Repeatedhisto.xlsx contains my teaching e
7). Two people gave me scores of 1, three people g
REPT function, you can easily create a graph to s
to D5:D10 the formula
. This
=REPT(“|”,C4)
formula places
|
characters
in column D a
as the entry in column C. Figure 6-7 makes clear th
7s) and the relative rarity of poor scores (1s a
you to easily mimic a bar graph or histogram. Se
Histograms,” for further discussion of how to cr

Chapter
Text
6 Functions
47
Fig
URE 6-7
Using the REPT function to create a frequency gra
Problems
1.
Cells B2:B5 of the workbook Showbiz.xlsx co
our favorite people. Use text functions to e
and each person’s street address to another
2.
The workbook IDprice.xlsx contains the prod
text functions to put the product IDs and p
To Columns command on the Data tab on the ri
3.
The workbook Quarterlygnpdata.xlsx contains q
(in billions of 1996 dollars). Extract this d
column contains the year, the second column c
third column contains the GNP value.
4.
The fle Textstylesdata.xlsx contains inform
variety of shirts. For example, the frst shi
colon and the hyphen). Its color is 65, and i
style, color, and size of each shirt.
5.
The fle Emailproblem.xlsx gives frst
employees.
and las
To create an e-mail address for each employe
the employee’s frst name by the employee’s l
end. Use text functions to effciently creat
6.
The fle Lineupdata.xlsx gives the number
-
of mi
tions (lineups). (Lineup 1 played 10.4 minut
data into a form suitable for numerical cal
the number 10.4.
7.
The fle Reversenames.xlsx gives the frst na
names of several people. Transform these na
followed by a comma, followed by the frst a
Gregory William Winston into Winston, Grego
8.
The fle Incomefrequency.xlsx contains the d
graduates of Faber College. Summarize this d

48
Microsoft Excel 2010: Data Analysis and Business Modeling
9.
Recall that
CHAR(65)
yields the letter A,
CHA
these facts to effciently populate cells B1:B
through Z.
10.
The fle Capitalizefrstletter.xlsx contains va
rain in Spain falls mainly in the plain.” Ens
capitalized.
11.
The fle Ageofmachine.xlsx contains data in th
S/N: 160768, vib roller,84” smooth drum,canopy A
Alabama
Each row refers to a machine purchase. Determi
12.
When downloading corporate data from the Secu
EDGAR site, you often obtain data for a compa
Cash and Cash Equivalents
$31,848
$ 3
How would you effciently extract the Cash and C
13.
The fle Lookuptwocolumns.xlsx gives the model
cars. Set up formulas that enable you to ente
its price.
14.
The fle Moviedata.xlsx contains the names of s
of copies of the movie DVD purchased by a loc
movie from this data.
15.
The fle Moviedata.xlsx contains the names of s
of copies of the movie DVD purchased by a loc
the number of copies purchased from this data
SUBSTITUTE function. The syntax of the SUBSTI
text,new_text,[instance_num])
. If _
instance
num
is omitted, every occur
in
text
is replaced
. If _
instance
num
by is
new_text
given, then only tha
old_text
is
new_text
replaced
. For example,
SUBSTITUTE(A4,1,2)
by
would
in cell A4 with a 2, but
SUBSTITUTE(A4,1,2,3)
a 1 in cell A4 with a 2.
16.
The fle Problem16data.xlsx contains the numbe
marketing questionnaire (1 = Very unlikely to b
product). Summarize this data graphically by u
summary look more appealing, you can go to th
Orientation in the Alignment group and make th
number, and increase the row height. Finally, i
so that you make the text of your graph verti
17.
The fle Problem17data.xlsx contains people’s n
functions to extract each person’s title and f

49
Chapter 7
Dates and Date Func
Questions answered in this chapter:
When I enter dates in Excel, I often see a n
as 1/4/2003. What does this number mean, an
Can I use a formula to automatically displa
How do I determine a date that is 50 workda
exclude holidays?
How do I determine the number of workdays b
I have 500 different dates entered in an Ex
extract from each date the month, year, day o
I am given the year, month, and day of the m
recover the actual date?
My business has purchased and sold machines
was purchased and the date the machine was s
months we kept these machines?
To illustrate the most commonly used month-day
suppose today is January 4, 2004. You can ente
1/4/2004
4-Jan-2004
January 4, 2004
1/4/04
If you enter only two digits to represent a ye
the digits represent years in the twentieth
-
ce
sumes they represent years in the twenty-frst c
January 1, 2029, but 1/1/30 is treated as Janu
in the twenty-frst century increases by one.
Answers to This Chapter’s Ques
When I enter dates into Excel, I often see a n
as 1/4/2003 . What does this number mean, and h

50
Microsoft Excel 2010: Data Analysis and Business Modeling
The way Excel treats calendar dates is sometimes c
understanding that Excel can display a date in a v
can display a date
. A date
in
serial
in serial format, such a
integer that represents the number of days betwe
Both the current date and January 1, 1900
- are in
plays January 3, 1900, in serial format as the n
between January 1, 1900, and January 3, 1900 (in
Not
Excel assumes that 1900 was a leap year containin
contained only 365 days. For some fascinating inform
www.
joelonsoftware.com/items/2006/06/16.html
Figure 7-1 shows the worksheet named
Serial Form
given the dates shown in cells D5:D14 in serial f
D5 indicates a date that is 37,622 days after Ja
and day 37,622). To display these serial dates i
Select the cell range E5:E14, right-click the se
by the way, you can bring up the Format Cells dia
date format you want from the list shown in Figu
in date format, as you can see in Figure 7-1. If y
format, select E5:E14, right-click the selection
Fig
URE 7-1
Use the Format Cells command to change dates from s
format.
Simply changing the date format of a cell to Gen
Another way to obtain the date in serial
- format i
close the date in quotation marks. For example, i
Dates.xlsx, cell I5 contains. the
Excel
formula
yields
DATEVAL
37625
the serial format for January 4, 2003.

Chapter
Dates
7
and Date Functions
51
Fig
URE 7-2
Reformatting a serial number to month-day-year fo
Can I use a formula to automatically display t
Displaying today’s date with a formula is easy
Date Format
worksheet shown in Figure 7-3. Ent
display today’s date. I created this screenshot o
Fig
URE 7-3
Examples of date functions.
How do I determine a date that is 50 workdays a
exclude holidays?
The function
start_date
WORKDAY(
,#days,[holidays])
displays the d
of workdays (a workday is a nonweekend day) in
Holidays
is an optional argument for the functi
lation any dates that are listed in a cell ran
in cell D14 of the
Date Format
worksheet tells u
01/03/2003. If we believe that the only two ho
and Independence Day, we can change .
the
With
formul
thi
addition, Excel does not count 01/20/2003 in i

52
Microsoft Excel 2010: Data Analysis and Business Modeling
workday after 01/03/2003. Note that instead of r
can enter them directly in the WORKDAY formula w
enclosed in { }. For example,
WORKDAY(38500,10,{3
workday after the date with serial number 38500, i
Christmas of 2005.
Excel 2010 contains a new function, WORKDAY.INTL
defnition
workday.”
of a “ The syntax is
days,weekend,
WORKDAY.INTL(star
[holida
The third argument lets you specify the defnitio
codes to specify the defnition of a day off.
1 or omitted
Saturday, Sunday
2
Sunday, Monday
3
Monday, Tuesday
4
Tuesday, Wednesday
5
Wednesday, Thursday
6
Thursday, Friday
7
Friday, Saturday
11
Sunday only
12
Monday only
13
Tuesday only
14
Wednesday only
15
Thursday only
16
Friday only
17
Saturday only
For example, in sheet
Date Format
of the fle Dat
7-4) the date 100 workdays after 3/14/2011, with S
formula
WORKDAY.INTL(C23,100,2)
In cell C28 I computed the dat
3/14/2011 when only Sunday is a day off .
by using th
You can also enter
days
the
off”
defnition
with a of
string
of seven o
a one indicates a day off and the frst entry in th
and so on. Thus, in cells D26 and D27 I duplicat
WORKDAY.INTL(C23,100,”1000001”)
and
,
WORKDAY.INTL
respectively
How do I determine the number of workdays betwee
The key to solving this problem is to use the NE
function is
NETWORKDAYS(
start_date,end_date,[holidays])
where
holidays
is an o
argument identifying a cell range that lists the d
NETWORKDAYS function returns the number of worki
end_date
excluding weekends and any listed holid
NETWORKDAYS function, look at cell C18 in the
Da

Chapter
Dates
7
and Date Functions
53
the formula
NETWORKDAYS(C14,C15)
. This formula yields the
-
num
tween 1/3/2003 and 8/4/2003, which is 152. The f
in cell C17 yields the number of workdays betw
Luther King Day and Independence
.
Day. The answ
Excel 2010 includes a new function, NETWORKDAY
function, allows you to customize the defnitio
the worksheet
Date Format
of the fle Dates.xls
between 3/14/2011 and 8/16/2012, when Sunday a
NETWORKDAYS.INTL(C23,C24,2)
(See Figure 7-4.) In cell D31 I c
with the formula
NETWORKDAYS.INTL(C23,C24,”100
Fig
URE 7-4
Examples of international date functions.
I have 500 different dates . entered
How do Iinwrite
an Excel
for w
will extract from each date the month, year, d
The
Date Format
worksheet of the fle Dates.xls
cell range B5:B10. In B5 and B7:B9, I used fou
In columns D:G, I extracted the year, month, da
date. By copying from D5 to
, ID6:D10
extracted
the formula
the ye
By copying from E5 to E6:E10
, I extracted
the formula
the
MONTH
month (
2=February, and so on) portion of each date. B
DAY(B5)
, I extracted the day of the month for eac
G6:G10 the formula
, I
WEEKDAY(B5,1)
extracted the day of the w
When the last argument of the WEEKDAY function i
so on. When the last argument is 2, then 1=Mon
argument is 3, then 0=Monday, 1=Tuesday, and s
I am given the year, month, and
. Is day
there
of an
theeasy
mon w
recover the actual date?
The DATE function, whose arguments
, returns
arethe
DATE(ye
date w
given year, month, and day of the month. In th
H5 to cells H6:H10 the formula
DATE(D5,E5,F5)
r

54
Microsoft Excel 2010: Data Analysis and Business Modeling
My business has purchased
. Forand
some,
sold
I have
machines
the date t
purchased and the date. Can
the Imachine
easily was
determine
sold
ho
we kept these machines?
The DATEDIF function can easily determine the nu
or days between two dates. In fle Datedif.xlsx
-
(
chine was bought on 10/15/2006 and was sold on 4
years, months, or days was the machine kept? The s
DATEDIF(
startdate,enddate,time unit).
If the unit is w
complete years between the start and end dates; i
number of complete months between the start and e
“d,” you get the number of complete days between th
DATEDIF(D4,D5,”y”)
in cell D6 shows that the mac
formula
DATEDIF(D4,D5,”m”)
in cell D7 shows the m
Entering the formula
DATEDIF(D4,D5,”d”)
in cell D
complete days.
Fig
URE 7-5
Using the DATEDIF function.
Problems
1.
What is the serial format for January 25, 200
2.
What is the serial format for February 14, 19
3.
To what actual date does a serial format of 4
4.
To what actual date does a serial format of 4
5.
Determine the day that occurs 74 workdays aft
6.
Determine the day that occurs 74 workdays aft
excluding the current year’s Christmas, New Y
7.
How many workdays (including holidays) are th
15, 2006?
8.
How many workdays (including holidays but exc
Independence Day) are there between July 10, 2

Chapter
Dates
7
and Date Functions
55
Not
The fle Datep.xlsx contains several hundred d
problems.
9.
Determine the month, year, day of the month
10.
Express each date in serial format.
11.
A project begins on December 4, 2005. The p
1, 2, and 3. Activity 2 can start the day a
day after Activity 2 fnishes. Set up a work
days) of the three activities and outputs b
activity is completed.
12.
We bought a stock on July 29, 2005, and
-
sol
change is closed on Labor Day, Christmas, a
when the stock market was open during the ti
13.
The fle Machinedates.xlsx contains dates on w
sold. Determine how many months and years e
14.
Given any date, fnd a way to have Excel comp
the date’s month.
15.
Given any date, fnd a way to have Excel comp
DATE(2005,13,1)
surprisingly, returns 1/1/2006.
16.
Given any date, how can you compute which d? F
day of the year will 4/15/2020 be? Hint: The f
serial number for day 0 of January 2020, an
17.
In the country of Fredonia, employees have T
200 workdays after 5/3/2013?
18.
In the country of Lower Ampere, employees h
Valentine’s Day is a holiday. How many workd
5/31/2015?
19.
Suppose the frst quarter of each year is Ja
June, and so on. Write a formula that retur
quarter.
20.
Using the defnitions of quarters given in P
for any given date the last day of the prev
21.
Set up a spreadsheet in which a person can e
spreadsheet returns the person’s actual age

57
Chapter 8
Evaluating Investme
Present Value Crite
Questions answered in this chapter:
What is net present value (NPV)?
How do I use the Excel NPV function?
How can I compute NPV when cash flows are re
the middle of a year?
How can I compute NPV when cash flows are re
Consider the following two investments, whose c
shown in Figure 8-1.
Investment 1 requires a cash outflow of $10,
now. One year from now, this investment will y
Investment 2 requires a cash outflow of $6,0
One year from now, this investment will yie
Which is the better investment? Investment 1 y
2 yields a total cash flow of $1,000. At frst g
wait a minute. Most of the cash outflow for Inv
most of the cash outflow for Investment 2 occur
doesn’t seem as costly as spending $1 today, s
appears. To determine which investment is bett
flows received at different points in time. Tha
proves useful.
Fig
URE 8-1
To determine which investment is better, you need t

58
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
What is net present value?
The net present value (NPV) of a stream of cash fl
simply the value
measured
. Suppose
in today’s
you have
dollars
$1 today a
dollar at an annual interest ratedollars
of
r
percent.
in the fr
T
year,
2
dollars
(1+r)
in two years, and so on. You can s
$(1+r)
a year from now and
$(1+r)
2
two years from now. In general, y
is equal to
$(1+r)
n
n
years from now. As an equation, this c
follows:
$1 now=$(1+r)
n
received n years from now
If you divide both sides of this equation by
(1+
n
, you get the following im
1/(1+r)
n
now=$1 received n years from now
This result tells you how to compute (in today’s d
flows. You can convert any cash flow to today’s do
n
years from
n
cannow
be (
a fraction) by
1/(1+r)
n
.
You then add up the value of the cash flows (in t
Let’s assume
r
is equal to 0.2. You could calcul
considering as follows:
24,000
(1 + 0.20)
1
= $277.78
–14,000
(1 + 0.20)
2
= Investment1NPV = –10,000 +
+
8,000
(1 + 0.20)
1
= $–27.78
–1,000
(1 + 0.20)
2
= Investment2NPV = –6,000 +
+
On the basis of NPV, Investment 1 is superior to I
for Investment 2 exceeds total cash flow for Inve
because a greater proportion of Investment 1’s n
NPV criterion gives less weight to cash flows tha
r
, Investment 2 has a larger NPV because- when
r
i
counted as much, and NPV returns results similar t
according to total cash flow.

Chapter
Evaluating
8
Investments by Using
59
Net Present Value Criteria
Not
I
e
randomly chose the
, skirting
interestthe
rate
issue
r=0.2
of how t
appropriate
. You
value
need
of to
r
study fnance for at least a y
involved in determining
. The
an
appropriate valuefor
of
r
NPV is often called the company’s
cost of capital.
an annual cost of capital between 0.1 (10 percent) a
is chosen according to accepted fnance practices, p
company, projects with NPV<0 decrease the value of a
the value of a company unchanged. A company should (
invest in every available investment having positi
To determine the NPV of Investment 1 in -Excel, I f
terest rate (located in cell C3). I then copie
the NPV for Investment 1’s Year 1 and Year
-
2 c
mula
D5/(1+r_)^D$4
. The caret symbol (^), located over th
a number to a power. In cell A5, I computed th
each year’s cash flow with
. Tothe
determine
formulathe
SUM(C7:E
NPV f
copied the formulas from C7:E7 to C8:E8 and fr
How do I use the Excel NPV function?
The Excel NPV function uses .the
This
syntax
function
NPV(rat
de
NPV for the given rate of the cash flows-in the r
sumes that the frst cash flow is one period fro
NPV(r_,C5:E5)
will not determine the NPV for I
in cell C14) computes the NPV of the following s
from now, $24,000 two years from now, and –$14
Investment 1 (End of Year). The NPV of Investm
the actual cash NPV of Investment 1, I entered th
formula does not discount the Time 0 cash flow a
flow is already in today’s dollars), but frst m
multiplies the cash flow in E5 by
1/1.2
2
.
The formula in cell C11 yields the correct NPV o
How can I compute NPV when cash flows are recei
middle of a year?
To use the NPV function to compute the net pre
ways occur at the beginning of a year, you can u
NPV of Investment 1: separate out the Year 1 c
remaining cash flows. Alternatively,
$1 received
observe
at th

60
Microsoft Excel 2010: Data Analysis and Business Modeling
of year
n
is equivalent
r
) received to
at .$(1+
the
Remember
end of that
year in on
dollar will grow
). Thus,
by a factor
if you (1+
multiply the
- resul
tion
r
by
), (1+
you can convert the NPV of a sequence of y
sequence of cash flows received at the beginning o
of Investment 1 in cell D11
. Ofwith
course,
the formula
you again
(1+
o
of $277.78.
Now suppose the cash flows for an investment
-
occu
nization that receives monthly subscription reve
revenues received during a given year as a lump s
can you use the NPV function to determine the NP
For any, Year
n
$
1 + r
received at the end of Year
n
is equivalent to $
half a year $1 will grow by a factor of
1 + r
If you assume the cash flows for Investment 1 occ
the mid-year version of Investment 1. in
Youcell
obtain
C17 w
a value of $253.58.
How can I compute NPV when cash flows are receive
Cash flows often occur at irregular intervals, whi
of return (IRR) of these cash flows more diffcult
computing the NPV of irregularly timed cash flows a s
The XNPV function uses
rate,values,dates)
the. syntax
The frst
XNPV(
date listed m
the earliest, but other dates need not be listed i
computes the NPV of the given cash flows assuming th
sequence. For example, if the frst listed date i
dollars.
To illustrate the use of the XNPV function, look a
worksheet in the fle XNPV.xlsx, which is shown i
you paid out $900. Later you receive the followi
$300 on August 15, 2013
$400 on January 15, 2014
$200 on June 25, 2014
$100 on July 3, 2015

Chapter
Evaluating
8
Investments by Using
61
Net Present Value Criteria
If the annual interest rate is 10 percent, wha
the dates (in Excel date format) in D3:D7 and th
XNPV(A9,E3:E7,D3:D7)
in cell D11 computes the p
that is the frst date listed. This project wou
Fig
URE 8-2
Using the XNPV function.
The computations performed by the XNPV functio
1.
Compute the number of years after April 8, 2
column F.) For example, August 15 is 0.3534 y
2.
Discount cash flows at the rate
1/(1+rate)
years
.
after
For example, the August 15, 2013 cash flow i
1
(1 + 0.1)
3534
= 0.967
3.
Sum up in cell E11 overall cash. flows:
(cash fl
Suppose that today’s date is actually July 11, 2
investment in today’s dollars? Simply add a row w
this row in the range for the XNPV function. (
NPV of the project in today’s dollars is $15.8
Fig
URE 8-3
NPV converted to today’s dollars.
I’ll close by noting that if a cash flow is lef
flow and the
.
Ifperiod
a cash flow is left blank, the XN

62
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
1.
An NBA player is to receive a $1,000,000 signi
two years, and three years from now. Assuming
would he be better off receiving $6,000,000 t
2.
A project has the following cash flows:
Now
One year from
Two now
years from
Threenow
years from now
–$4 million
$4 million $4 million –$3 million
If the company’s cost of capital is 15 percen
3.
Beginning one month from now, a customer will p
month for the next fve years. Assuming all re
of a year, estimate the NPV
.
of these revenues
4.
Beginning one month from now, a customer will p
provider for the next fve years. Assuming all r
middle of a year, use the XNPV function to ob
r=0.15
5.
Consider the following set of cash flows over a f
these cash flows if
r=0.15
and cash flows occur a
Year
1
2
3
4
-$600
$550
-$680
$1,000
6.
Solve Problem 5 assuming cash flows occur at th
7.
Consider the following cash flows:
Date
Cash flow
12/15/01
–$1,000
1/11/02
$300
4/07/03
$600
7/15/04
$925
If today is November
, what
1, 2001,
is the
and
NPV
r=0.15
of these c
8.
After earning an MBA, a student will begin wo
September 1, 2005. She expects to receive a 5 p
on September 1, 2035. If the cost of capital i
present value of her before-tax earnings.
9.
Consider a 30-year bond that pays $50 at the e
of Year 30. If the appropriate discount rate i
this bond?

63
Chapter 9
Internal Rate of Re
Questions answered in this chapter:
How can I fnd the IRR of cash flows?
Does a project always have a unique IRR?
Are there conditions that guarantee a proje
If two projects each have a single IRR, how d
How can I fnd the IRR of irregularly spaced c
What is the MIRR and how do I compute it?
The net present
NPV) of
value
sequence
(
of cash flows
r
)
depe
used. For example, if you consider cash flows f
the fle IRR.xlsx, shown in ,Figure
Project
9-1),
2 has
youa fn
la
for
r=0.01
, Project 1 has a larger NPV. When you use N
can depend on the interest rate. It is the nat
in life down to a single number.
IRR) ofThe
a project
internal
isrs
interest rate that makes the NPV of the projec
IRR has a nice interpretation. For example, if a p
an annual rate of return of 15 percent on
- the c
ples, you’ll fnd that Project 1 has an IRR of 4
at Time 1 is yielding an annual rate of return o
might have more than one IRR or even no IRR. I
IRR is useless.
Fig
URE 9-1
Example of the IRR function.

64
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
How can I find the IRR of cash flows?
The IRR function calculates internal rate of ret
IRR(range of cash
, where
flows,[guess])
is an optional argum
guess for a project’s IRR, Excel begins its calc
10 percent and then varies the estimate of the I
the project’s NPV equal 0 (the project’s IRR). I
the project’s NPV equal 0, Excel returns #NUM. I
compute Project 1’s IRR. Excel returns 47.5 perc
47.5 percent, Project 1 will have an NPV of 0. S
of 80.1 percent.
Even if the IRR function fnds an IRR, a project mi
whether a project has more than one IRR, you can v
(for example, from –90 percent to 90 percent).
-
I v
ing from B8 to B9:B17 the
. Because
formulaall
IRR($C$2:$I$2,
the guesses f
IRR yield 47.5 percent, I can be fairly confdent th
Similarly, I can be fairly confdent that Project 2 h
Does a project always have a unique IRR?
In the worksheet
Multiple IRR
in the fle IRR.xls
(cash flows of –20, 82, –60, 2) has two IRRs. I v
percent to 90 percent by copying from. C8 to C9:C
Fig
URE 9-2
Project with more than one IRR.
Note that when a guess is 30 percent or less, th
IRR is 216.1 percent. For both these interest ra

Chapter
Internal
9
Rate
65
of Return
In the worksheet
No IRR
in the fle IRR.xlsx
matter (s
what guess you use for Project 4’s IRR, you re
indicates that Project 4 has no IRR.
When a project has multiple IRRs or no IRR, th
Despite this problem, however, many companies s
investments.
Fig
URE 9-3
Project with no IRR.
Are there conditions that guarantee a project w
If a project’s sequence of cash flows contains e
guaranteed to have a unique IRR. For, example,
the sign fo
the cash flow sequence is – + + + + +. There is o
Time 2), so Project 2 must have a unique
, the
IRR. F
signs of the cash flows are – + – +. Because th
a unique IRR is not guaranteed., For
the Project
signs of4 th
i
flows are + – +. Because the signs of the -cash fl
teed in this case either. Most capital investm
a negative cash flow followed by a sequence of p
investment projects do have a unique IRR.
If two projects each have a single IRR, how do I u
If a project has a unique IRR, you can state th
company
if and only if
the project’s IRR excee
cost of capital for a company is 15 percent, b
value of the company.

66
Microsoft Excel 2010: Data Analysis and Business Modeling
Suppose two projects are under consideration
-
(both h
take at most one project. It’s tempting to belie
larger IRR. To illustrate that this belief can l
the
Which Project
worksheet in IRR.xlsx. Project 5 h
an IRR of 50 percent. If you rank projects based o
would choose Project 6. Remember, however, that a p
value the project adds to the company. Clearly, P
have a larger NPV than Project 6. Therefore, if o
it. IRR is problematic because it ignores the sc
than Project 5 on a per-dollar-invested basis,
-
t
able to the company than Project 6. IRR does not r
does.
Fig
URE 9-4
IRR can lead to an incorrect choice of which projec
How can I find the IRR of irregularly spaced cash fl
Cash flows occur on actual dates, notfunction
just at the s
has the syntax
XIRR(cash flow, dates, [guess]).
T
sequence of cash flows that occur on any set of i
function,
guess
is an optional argument. For an e
look at Figure 9-5 and worksheet
XIRR
of the fle I
Fig
URE 9-5
Example of the XIRR function.
The formula
XIRR(F4:F7,E4:E7)
in cell D9 shows th
What is the MIRR and how do I compute it?
In many situations the rate at which a company b
at which the company reinvests funds. IRR comput
which a company borrows and reinvests funds is e
at which we borrow money and the rate at which w
internal rate
MIRR)
offunction
return (computes a discount rat

Chapter
Internal
9
Rate
67
of Return
our cash flows (including paying back our loan a
rates) equal to 0. The syntax of MIRR is
MIRR(
rate).
A nice thing about MIRR is that it is a
fle IRR.xls contains an example of MIRR. Suppo
the following cash flows: Year 1: $39,000, Year 2
Year 5: $46,000. Assume you can borrow at 10 p
12percent per year.
After entering these values in cells E7:E12 of w
D15 with the formula
MIRR(E7:E12,E3,E4).
Thus, t
cell D16 I computed the actual IRR of 13.07 pe
Fig
URE 9-6
Example of the MIRR function.
I’ll close by noting that if a cash flow is lef
and the period.
If a cash flow is left blank, t
Problems
1.
Compute all IRRs for the following sequence o
Year Y
1ear Y
2ear Y
3ear Y
4ear Y
5ear Y
6ear 7
–$10,000
$8,00$
01,500
–$1,500
2.
Consider a project with the following cash fl
annual cost of capital is 20 percent, would y
Year 1
Year 2
Year 3
–$4,000 $2,000
$4,000

68
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
Find all IRRs for the following project:
Year 1
Year 2
Year 3
$100
–$300
$250
4.
Find all IRRs for a project having the given c
1/10/2003
7/10/2003
5/25/2004
7/18/2004
3/20/2005
4/1/2005
1/10/2006
–$1,000
$900
$800
$700
$500
$500
$350
5.
Consider the following two projects, and
-
assu
cent. Find the IRR and NPV of each project. W
If the company can choose only a single proje
Year 1 Year 2 Year 3 Year 4
Project–$40
1
$130
$19
$26
Project–$80
2
$36
$36
$36
6.
Twenty-fve-year-old Meg Prior is going to inv
the beginning of each of the next 40 years. A
years Meg will earn 15 percent on her investm
she retires, her investments will earn 5 perc
investments and her fnal retirement position. H
IRR? How would you interpret the unique IRR?
7.
Give an intuitive explanation of why Project 6 (
fle IRR.xlsx) has an IRR of 50 percent.
8.
Consider a project having the following cash fl
Year 1
Year 2
Year 3
–$70,000 $12,000
$15,000
Try to fnd the IRR of this project without si
is the IRR of this project? Does the project h
9.
For the cash flows in Problem 1, assume you ca
invest profts at 15 percent per year. Compute th
10.
Suppose today that you paid $1,000 for the bo
“Evaluating Investments by Using Net Present V
bond’s IRR? A bond’s IRR is often called the

69
Chapter 10
More Excel Financia
Questions answered in this chapter:
You are buying a copier. Would you rather pa
years?
If at the end of each of the next 40 years I i
and earn 8 percent a year on my investments
I am borrowing $10,000 for 10 months with a
are my monthly payments? How much principal a
I want to borrow $80,000 and make monthly p
monthly payment I can afford is $1,000. Wha
afford?
If I borrow $100,000 at 8 percent interest a
many years will it take me to pay back the l
When we borrow money to buy a car or house, we a
deal. When we save for retirement, we are curi
retire. In our daily work and personal lives, f
Knowledge of the Excel PV, FV, PMT, PPMT, IPMT
functions makes it easy to answer these types o
Answers to This Chapter’s Ques
You are buying
. Would
a copier
you rather pay $11,000 toda
five years?
The key to answering this question is being ab
year. Assume the cost of capital is 12 percent p
answer this question, but the Excel PV functio
stream of cash flows that involves the same amo
is called. an
Assuming
annuity
that each period’s interest r
value an annuity by using the Excel PV functio
dollars of a series of future payments, under th
and a constant interest rate. The syntax
, of th
where,
pmt
fv,
and
type
are optional arguments.

70
Microsoft Excel 2010: Data Analysis and Business Modeling
Not
When working with Microsoft Excel fnancial functi
the signs of
pmt
future
(payment)
value):
and money
fv
( received has a p
paid out has a negative sign.
Rate
is the interest rate per period.
percent
For exa
per year and the period
. If
is the
a year,
period
then
is
rate=
mon
rate=0.06/12=0.005
#per
is the number of periods in the
. Ifannuity. F
payments on the copier are made each
. Your
month
ratefo
must, of course, be
. That
consistent
is, if with
#per #per
implies a p
you must use a monthly interest rate; if
#per
annual interest rate.
Pmt
is the payment made each period.A For our c
payment has a negative sign, whereas money re
of
pmt
or
fv
must be included.
Fv
is the cash balance (or future value) you wa
For our copier
. For example,
fv=0
if you want to hav
after the last payment,
. If youthen
want
fv=$500
to make an addi
at the end
m
of
fv=–$500
a. proble
If
fv
is omitted, it is assu
Type
is either 0 or 1 and indicates when paym
equal to 0, payments are made at, the
payments
end ofare
made at the beginning of each period. Note th
and False instead of 0 in all functions discu
Figure 10-1 (see the worksheet
PV
of fle the Exc
copier problem.
Fig
URE 10-1
Example of the PV function.

Chapter
More
10 Excel Financial
71
Functions
In cell B3 I computed the present value of pay
years with a 12 percent cost of capital by usi
returns an NPV of $10,814.33. By omitting the l
answer with the formula
=PV(0.12,5,–3000).
Thu
end of the year than to pay out $11,000 today.
If you make payments on the copier of $3,000 a
the NPV of the payments is computed in cell B4 w
Note that changing the last argument from a 0 t
year to beginning of year. You can see that th
Therefore, it’s better to pay $11,000 today th
Suppose you pay $3,000 at the end of each year a
at the end of Year 5. You can now fnd the
- pres
cluding a future value of $500 with the formul
and $500 cash flows have negative signs because y
value of all these payments is equal to $11,09
If at the end of each of the next 40 years I i
earn 8 percent a year on my investments, how m
In this situation we want to know the value of a
from now) and not today’s dollars. This is a j
FV function gives the future value of an inves
with a constant interest rate. The syntax
,
of th
where,
pmt
pv,
and
type
are
.
optional arguments
Rate
is the interest rate per
.
period. In ou
#Per
is the number of periods in the future a
computed.
#Per
is also the number of period
received. In our case,
#per
equals =40.
Pmt
is the payment made each period. In our c
sign indicates we are paying money into an a
included.
Pv
is the amount of money (in today’s dolla
$0. If today we owe someone $10,000, then
p
us $10,000 and we received it. If today we h
–$10,000 because we must have paid $10,000 i
is assumed to equal 0.
Type
is a 0 or 1 and indicates when payment
equals 0 or is omitted, then money is depos
type
is 0 or omitted.
,
then If
payments
type
equals
are made
1
or m
the beginning of the period.

72
Microsoft Excel 2010: Data Analysis and Business Modeling
In worksheet
FV
of fle Excelfnfunctions.xlsx (se
=FV(0.08,40,–2000)
to fnd that in 40 years our n
that I entered a negative value for the annual p
into our account. You could obtain the same answ
arguments with the formula
FV(0.08,40,–2000,0,0)
If deposits were made at the beginning of each y
B4)
=FV(0.08,40,–2000,0,1)
would yield the value i
Fig
URE 10-2
Example of FV function.
Finally, suppose that in addition to investing $
years you initially have $30,000 to invest. If y
how much money will you have when you
question
retire in 4
bysetting
pv
equal to –$30,000 in the FV functio
you have deposited, or paid, $30,000 into your a
=FV(0.08,40,–2000,–30000,0)
yields a future val
I am borrowing $10,000 for 10 months with
. Whatan
are
ann
my monthly payments? How much principal and inte
The Excel PMT function computes the periodic pay
constant payments and a constant interest rate. T
PMT(rate,#per,pv,[fv],[type])
where
fv
and
type
are optional arg
Rate
is the per-period interest rate of the l
a period, so
rate
equals
.
0.08/12=0.006666667
#Per
is the number of payments made. In this c

Chapter
More
10 Excel Financial
73
Functions
Pv
is the present value of all the payments
case,
pv
equals $10,000.
Pv
is positive bec
Fv
indicates the fnal loan balance you want t
our case
fv
equals 0. If
fv
is omitted, Exc
taken out a balloon loan for which you make p
at the conclusion of the loan you pay off th
payment. Then
fv
equals –$1,000. The $1,000 i
Type
is a 0 or 1 and indicates when-payment
ted, then payments are made at the end of th
payments, so type is 0 or omitted. If
type
is deposited at the beginning of the period
In cell worksheet
G1 of
PMT
the
of the fle Excelfnfunctions.xl
computed
the monthly payment on a 10-month loan for
-
$10
est rate and end-of-month
=–PMT(0.08/12,10,10000
payments with the fo
monthly payment is $1,037.03. The PMT function by i
we are making payments to the company giving u
If you want to, you can use the Excel IPMT and P
interest paid each month toward the loan and th
month. (This is called the payment on the prin
Fig
URE 10-3
Examples of PMT, PPMT, CUMPRINC, CUMIPMT, and IP
To determine the interest paid each month, use th
function is
IPMT(rate,per,#per,pv,[fv],[type])
where
fv
and
type
are opti
per
argument indicates the period number for w

74
Microsoft Excel 2010: Data Analysis and Business Modeling
arguments mean the same as they do for the PMT f
amount paid toward the principal eachsyntax
month you c
of the PPMT function is
PPMT(rate,per,#per,pv,[f
. The meaning of each a
the same as it is for the IPMT function. By copy
=–PPMT(0.08/12,C6,10,10000,0,0),
you can compute th
that is applied to the principal. For example, d
the principal. As expected, the amount paid towa
The minus sign is needed because the principal i
and PPMT will return a negative number. By copyi
=–IPMT(0.08/12,C6,10,10000,0,0)
you can compute the amount of i
For example, in Month 1 you pay $66.67 in intere
each month decreases.
Note that each month
(Interest Paid)+(Payment
.
To
Sometimes the total is off by a penny due to rou
You can also create the ending balances for each m
relationship
(Ending Month t Balance)=(Beginning M
toward Principal).
Note that in Month 1,
Beginnin
created each month’s beginning balance
)
(Beginning
by using th
Month t Balance)=(Ending
. Of
Month
course,
t–1
Ending
Balance)
Month 10 B
$0
,
as it should.
Interest each month can be computed as
(Month t I
Month t
.
Balance)
For example, the Month 3 interest paym
=(0.0066667)*($8,052.80)
which equals $53.69.
Of course, the NPV of all payments is exactly $1
formula
NPV(0.08/12,E6:E15)
(See Figure 10-3.)
If the payments are made at the beginning of eac
is computed in cell D19 with the formula
=–PMT(0
argument to 1 changes each payment to the beginni
is getting her money earlier, monthly payments a
pays at the beginning of the month, the monthly p
Finally, suppose that you want to make a balloon p
months. If you make your monthly payments at the e
=–PMT(0.08/12,10,10000,–1000,0)
in cell D20 comp
monthly payment turns out to be $940. Because $1
with monthly payments, it makes sense that your n
original end-of-month payment of $1,037.03.

Chapter
More
10 Excel Financial
75
Functions
CUMPRINC and CUMIPMT Functions
You’ll often want to accumulate the interest o
CUMPRINC and CUMIPMT functions make this a sna
The CUMPRINC function computes the principal p
syntax of the CUMPRINC function is
CUMPRINC(ra
.
Rate
,
#per
, ,
pv
and
type
have the same meanings as des
The CUMIPMT function computes the interest pai
syntax of the CUMIPMT function is
CUMIPMT(rate
.
Rate
,
#per
, ,
pv
and
type
have the same meanings as des
cell F19 on the
PMT
worksheet, I computed the i
4 ($161.01) by using the formula
=CUMIPMT(0.08
-
puted the principal paid off in months 2 throu
=CUMPRINC(0.08/12,10,10000,2,4,0)
I want to borrow $80,000 and make
. The
monthly
maximum
paym
monthly payment I can
. What
afford
is the
is maximum
$1,000
intere
Given a borrowed amount, the length of a loan, a
function tells you the rate of the loan. The s
,[fv],[type],[guess])
where
,
type
,
fv
and
guess
are optional
,
pmt
, ,
pv
,
fv
and
argumen
type
have the same meanings as previously desc
loan rate is. Usually
guess
can be omitted. En
Excelfnfunctions.xlsx) the formula
=RATE(120,–
monthly rate. I am assuming end-of-month payme
Fig
URE 10-4
Example of RATE function.
In cell D15 I verifed the RATE function calcul
yields $80,000.08. This shows that payments of $
months have a present value of $80,000.08.

76
Microsoft Excel 2010: Data Analysis and Business Modeling
If you could pay back $10,000 during month 120, t
be given by the formula
=RATE(120,–1000,80000,–1
. In cell D12, this f
a monthly rate of 0.818 percent.
If I borrow $100,000 at 8 percent interest and m
many years will it take me to pay back the loan?
Given the size of a loan, the payments each peri
tells you how many periods it takes to pay back a l
NPER(rate,pmt,pv,[fv],[type])
where
fv
and
type
are optional arg
Assuming end-of-year payments, the formula
=NPER
worksheet
Nper
(in the fle Excelfnfunctions.xlsx
20 years of payments will not quite pay back the l
To verify the calculation, in cells D10 and D11 I u
$10,000 per year for 20 years pays back $98,181.
pays back $100,168.03.
Suppose that you are planning to pay back $40,00
How many years will it take to pay back the loan
=NPER(0.08,–10000,100000,–40000,0)
shows that i
loan. Thus, 15 years of payments will not quite p
slightly overpay the loan.
Fig
URE 10-5
Example of NPER function.

Chapter
More
10 Excel Financial
77
Functions
Problems
Unless otherwise mentioned, all payments are m
1.
You have just won the lottery. At the end of e
a payment of $50,000. If the cost of capita
value of your lottery winnings?
2.
A
perpetuity
is an annuity that is received f
beginning of each year I receive $14,000, w
an annual 10 percent cost of capital. (Hint
periods be many!)
3.
I now have $250,000 in the bank. At the end o
$15,000. If I earn 8 percent per year on my i
20 years?
4.
I deposit $2,000 per month (at the end
- of e
vestments earn 0.8 percent per month. I wou
much money should I deposit now?
5.
An NBA player is receiving $15 million at th
can earn 6 percent per year on his investme
revenues?
6.
At the end of each of the next 20 years I w
Years
Amounts
1–5
$200
6–10
$300
11–20
$400
Use the PV function to fnd the present valu
10 percent. Hint: Begin by computing the va
and then subtract the value of receiving $1
7.
You are borrowing $200,000 on a 30-year mor
percent. Assuming end-of-month payments, de
payment each month, and amount paid toward p
8.
Answer each question in Problem 7 assuming b
9.
Use the FV function to determine the value t
you are earning 7 percent per year.
10.
You have a liability of $1,000,000 due in 1
year. What amount of money do you need to s
10 years to meet this liability?

78
Microsoft Excel 2010: Data Analysis and Business Modeling
11.
You are going to buy a new car. The cost of th
two payment plans:
A 10 percent discount on the sales price of th
payments fnanced at 9 percent per year.
No discount on the sales price of the car, f
fnanced at 2 percent per year.
If you believe your annual cost of capital is 9 p
deal? Assume all payments occur at the end of th
12.
I presently have $10,000 in the bank. At the b
am going to invest $4,000, and I expect to ea
How much money will I have in 20 years?
13.
A
balloon mortgage
requires you to pay off pa
period and then make a lump sum payment to pa
loan. Suppose you borrow $400,000 on a 20-yea
rate is .5 percent per month. Your end-of-mon
are required to pay off $300,000 of your loan
remaining $100,000. Determine your monthly pa
14.
An adjustable rate mortgage (ARM) ties monthl
U.S. T-Bill rate). Suppose you borrow $60,000 o
payments). The frst 12 payments are governed by th
In years 2–5, monthly payments are set at the y
percent. Suppose the T-Bill rates at the begi
Beginning ofT-Bill
year rate
2
10 percent
3
13 percent
4
15 percent
5
10 percent
Determine monthly payments during years 1–5 a
15.
Suppose you have borrowed money at a 14.4 per
monthly payments. If you have missed four con
should next month’s payment be to catch up?
16.
You want to replace a machine in 10 years and e
can earn 8 percent annually on your investmen
aside at the end of each year to cover the co

Chapter
More
10 Excel Financial
79
Functions
17.
You are buying a motorcycle. You pay $1,500 t
years. If the annual rate of interest is 18 p
motorcycle?
18.
Suppose the annual rate of interest is 10 p
$300 a month for a year, and $400 for two y
payments?
19.
You can invest $500 at the end of each six-m
to have $6,000 after fve years, what is the a
investments?
20.
I borrow $2,000 and make quarterly payments f
is 24 percent. What is the size of each pay
21.
I have borrowed $15,000. I am making 48 mon
interest is 9 percent. What is the total in
22.
I am borrowing $5,000 and plan to pay back th
annual rate of interest is 16.5 percent. Af
the period of the loan to two years total. W
second year of the loan?
23.
With an adjustable rate mortgage, you make m
interest rates at the beginning of each yeao
ARM. For the frst year, monthly payments ar
9 percent. In years 2–5, monthly payments w
rates +2 percent.
Year 2: 10 percent
Year 3: 13 percent
Year 4: 15 percent
Year 5: 10 percent
The catch is that the ARM contains a clause th
increase a maximum of 7.5 percent from one y
er for this provision, the borrower adjusts th
each year based on the difference between w
he should have paid. Determine monthly paym
24.
You have a choice of receiving $8,000 each y
you die, or receiving $10,000 each year beg
If you think you can earn an 8 percent annu
net the largest amount?

80
Microsoft Excel 2010: Data Analysis and Business Modeling
25.
You have just won the lottery and will receiv
interest would make these payments the equiva
26.
A bond pays a $50 coupon at the end of each o
value in 30 years. If you discount cash flows a
be a fair price for the bond?
27.
You have borrowed $100,000 on a 40-year mortg
annual interest rate is 16 percent. How much w
With four years left on the loan, how much wi
28.
I need to borrow $12,000. I can afford paymen
rate of interest is 4.5 percent. How many mon
29.
You are considering borrowing $50,000 on a 18
on the loan depends on your credit score in th
Write a formula that gives your monthly payme
30.
You are going to borrow $40,000 for a new car
payments and total interest paid for the foll
48 month loan, 6.85% annual rate.
60 month loan, 6.59% annual rate.

81
Chapter 11
Circular References
Questions answered in this chapter:
I often get a circular reference message fr
How can I resolve circular references?
When Microsoft Excel 2010 displays a message th
reference, it means there is a loop, or- depend
sheet. For example, a circular reference occur
D3, the value in cell D3 influences the value i
value in cell A1. Figure 11-1 illustrates the p
Fig
URE 11-1
A loop causing a circular reference.
As you’ll soon see, you can resolve circular r
and then clicking Options. Choose Formulas, an
check box.
Answers to This Chapter’s Ques
I often get a circular reference
. Does this
message
mean I’ve
frommE
A circular reference usually arises from a log
cells exhibit a looping relationship similar t
simple example of a problem that cannot easily b
reference.
A small company earns $1,500 in revenues and i
percent of their after-tax profts to charity. T
should they give to charity? The solution to thi
Circular.xlsx, shown in Figure 11-2.

82
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 11-2
A circular reference can occur when you’re calculat
I began by naming the cells in D3:D8 with the co
entered the frm’s revenue, tax rate, and- costs i
ity as 10 percent of after-tax proft, .I Then
entered i
I determined before-tax proft in cell D7
- by subtr
tion from revenues. The formula
. Finally,
cell D7
I is
compu
Re
after-tax proft in cell D8 as
(1–tax_rate)*befor
Excel indicates a circular reference in cell D8 (
What’s going on?
1.
Charity (cell D6) influences before-tax proft (
2.
Before-tax proft (cell D7) influences after-ta
3.
After-tax proft (cell D8) influences charity.
Thus, we have a loop of the form D6-D7-D8-D6 (in
Figure 11-2), which causes the circular referenc
we have done nothing wrong. Still, you can see f
incorrect answer for charitable contributions.
How can I resolve circular references?
Resolving a circular reference is easy. Simply c
and then click Options to open the Excel Options d
pane, and then select the Enable Iterative Calcu
section, as shown in Figure 11-3.

Chapter
Circular
11
References
83
Fig
URE 11-3
Use the Enable Iterative Calculation option to r
When you activate the Enable Iterative Calcula
reference has generated the following system o
Charity=0.1*(AfterTax Profit) BeforeTax Profit=Revenue–Charity–Costs AfterTax Profit=
(1–Tax rate)*(BeforeTax Profit)
The three unknowns
,
BeforeTax
are,
Charity
and
Proft
AfterTax
. When
Proft
you activ
Enable Iterative Calculation option, Excel
-
ite
erences, 100 iterations should be used) to see
circular reference. From one iteration to the n
by a complex mathematical
Gauss-Seidel
procedure
Iteration).
(
Exce
change in any worksheet cell from one iteratio
Change value (0.001 by default). You can reduc
number, such as 0.000001. If you do not reduce th
number, you might fnd Excel assigning a value o
equal 5, and this is annoying. Also, some comp
iterations
converging”
before “ to a resolution of the cir
circularity is almost instantly resolved, and y

84
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 11-4
Excel runs the calculations to resolve the circula
Note that the charitable contribution of $28.30 i
$283.01. All other cells in the worksheet are now c
Not
Excel’s iteration procedure is only guaranteed to w
equations. In other situations, convergence to a sol
example, resolving the circular references requires s
know Excel will fnd the correct answer.
Here’s one more example of a circular reference. I
entire column or row by name. For example, the f
column B. The formula
=AVERAGE(1:1)
averages all ce
you’re continually dumping new data (such
- as mon
mula always computes average sales, and you do n
is, of course, that if you enter this formula in th
a circular reference. By activating the Enable I
such as these are resolved quickly.
Problems
1.
Before paying employee bonuses and state and f
of $60,000. The company pays employees- a bonu
its. State tax is 5 percent of profts (after b
profts (after bonuses and state tax are paid)
state tax, and federal tax.
2.
On January 1, 2002, I have $500. At the end o
Each month’s interest is based on the average o
balances. How much money will I have after 12 m
3.
My airplane is flying the following route: Hou
Houston. On each leg of the journey, the plan
lon) is
40–.02*(average
Here,
average
fuel en fuel
route)
en route

Chapter
Circular
11
References
85
fuel en route+fnal
. My
fuel
plane
en
begins
route)
in Houston w
The distance flown on each leg of the journe
Leg
Miles
Houston to Los Angeles
1,200
Los Angeles to Seattle
1,100
Seattle to Minneapolis
1,500
Minneapolis to Houston
1,400
How many gallons of fuel remain when I retu
4.
A common method used to allocate costs to s
cost allocation
. This method can easily be-implem
erences. To illustrate, suppose Widgetco ha
and Consulting. Widgetco also has two produ
Widgetco has decided to allocate $600,000 o
department and $116,000 of the cost of oper
two divisions. The fraction of accounting a
company is as follows:
Accounting
Consulting
Division
1
2
Percentage of accounting
work done for other parts
of the company
0%
20%
30%
50%
Percentage of consulting
work done for other parts
of the company
10%
0%
80%
10%
How much of the accounting and consulting co
the company? You need to determine two
- quan
ing and total cost allocated to consulting. T
$600,000+.1*(total cost allocated to consult
work was done for the Accounting department
the total cost allocated to consulting. You s
allocation of both accounting and consultin
5.
We start a year with $200 and receive $100 d
interest at the end of the year with the in
case we end the year with $320. Determine th
accrues on the average of
.
our starting and e

87
Chapter 12
IF Statements
Questions answered in this chapter:
If I order up to 500 units of a product, I p
1,200 units, I pay $2.70 per unit. If I ord
per unit. If I order more than 2,000 -units, I p
mula that expresses the purchase cost as a f
I just purchased 100 shares of stock at a c
the stock might decline in value, I purchas
option has an exercise price of $45 and cos
indicates the six-month percentage return o
future prices?
Many stock market analysts believe that mov
the market. A commonly suggested moving-ave
when the stock’s price moves above the aver
stock when the stock’s price moves below th
would this trading rule have performed agai
(S&P)?
In the game of craps, two dice are tossed. I
or 12, you lose. If the total of the dice o
game keeps going. How can I write a formula t
the frst roll?
In most pro forma fnancial statements, cash i
liabilities balance. I know that using debt a
set up a pro forma statement having debt as th
When I copy a VLOOKUP formula to determine s
a lot of #NA errors. Then when I average
-
th
cal answer because of the #NA errors. Can I e
space so I can compute average salary?
My worksheet contains quarterly revenues fo
revenue for each year and place it in the r
year?
IF statements can get rather large. How man
the maximum number of characters allowed in a

88
Microsoft Excel 2010: Data Analysis and Business Modeling
The situations listed above seem to have little, i
up Microsoft Excel 2010 models for each -of these s
ment. I believe that the IF formula is the singl
you conduct conditional tests on values and form
conditional logic provided by computing language
An IF formula begins with
. If
a the condition
suchis
astru
A1
returns the frst value listed in the formula; oth
repeat the process. The easiest way to show you th
them to help answer each of this chapter’s questi
Answers to This Chapter’s Quest
If I order up to 500 units
00 perof
. If
unit
a Iproduct,
order from
I pay
501$ t
1200 units,
7.0 I
per
pay
. If
unit
$2
I order from 1201 3
through
. 0 per
200
unit
. If I order more than
0. 0 per
2000
. How
units,
can I Iwrite
pay $2
a fo
expresses the purchase cost as a function of the n
You can fnd the solution to this question on the
Ifstatement.xlsx. The worksheet is shown in Figu
Fig
URE 12-1
You can use an IF formula to model quantity discoun
Suppose cell A9 contains our order quantity. You c
of the order quantity by implementing the follow
If A9 is less than or .equal to 500, the cost i
If A9 is from 501 through
.
1,200, the cost is
If A9 is from 1,201 through
.
2,000, the cost i
If A9 is more than. 2,000, the cost is
2*A9

Chapter
IF12
Statements
89
Begin by linking the range names in A2:A4 to c
D2:D5 to cells C2:C5. Then you can implement t
IF(A9<=_cut1,price1*A9,IF(A9<=_cut2,price2*A9,IF(A9<=_cut3,price3*A9,price4*A9)))
To understand how Excel computes a value from thi
evaluated from left to right. If the
cut1
),order
the cos
qua
given by.
price1*A9
If the order quantity is not less th
to see whether the order quantity is less than o
quantity is from 501 through 1,200, .
and
Next,
the th
fo
formula checks whether the order quantity is l
order quantity is from 1,201 through 2,000,
.
an
Finally, if the order cost has not yet been co
price4*A9
. In each case, the IF formula returns the c
three other order quantities in cells A10:A12 a
each order quantity, the formula returns the c
An IF formula containing more than one
.
IF stat
I just purchased 100 shares of
. Tostock
hedgeatthe
a cost
ris o
stock might decline in value, I purchased
. Each opti
60 s
has an exercise price
. How
of can
$45 Iand
develop
costs a$5worksh
the six-month percentage return on my portfoli
Before tackling this problem, I want to review s
fnance. A European put option allows you to se
six months) a share of a stock for the exercis
six months is $45 or higher, the option has no v
stock in 6 months is below $45. Then you- can m
ately reselling the stock for $45. For example
can make a proft of $45–$37, or $8 per share, by b
put to resell the share for $45. You can see th
moves in a stock price. In this case, whenever th
puts start kicking in some value. This cushion
shares it owns. Note also that the percentage r
are paid by the stocks in the portfolio) is co
value
fnal
(
portfolio
initial
value
portfolio
) and dividing
value
that numbe
initial value.
With this background, let’s look at how the si
consisting of 60 puts and 100 shares of stock, v
and $65. You can fnd this solution on the
Hedg
worksheet is shown in Figure 12-2.

90
Microsoft Excel 2010: Data Analysis and Business Modeling
The labels in A2:A7 are linked to cells B2:B7. T
100($55)+60($5)
=$5,800, shown in cell B7. By copying fro
IF(A9<exprice,exprice–A9,0)*Nputs
compute the fnal value of the p
price is less than the exercise price, you
.
can v
Otherwise, each put will in six months have a va
the formula,
Nshares*A9
I compute the fnal value of the shar
D10:D18 the formula
((C9+B9)–startvalue)/startva
the hedged portfolio. Copying from E9 to E10:E18 th
(Nshares*pricenow)
computes the percentage retur
(that is, buy no puts).
Fig
URE 12-2
Hedging example that uses IF statements.
In Figure 12-2, you can see that if the stock pr
a larger expected return than the unhedged portf
not decrease, the unhedged portfolio has a large
of puts is often referred
.
to as
portfolio insura
Many stock market analysts believe that moving-a
the market
. A commonly suggested moving-average tradi
the stock’s price moves above the average of the p
when the stock’s price moves below the. How
average o
would this trading rule have performed against t
In this example, I’ll compare the performance of th
absence of transaction costs for buying and sell
strength of a moving-average trading rule
- is tha
ing-average trading rule lets you ride up with a b
destroys you.

Chapter
IF12
Statements
91
The data set contains the monthly value of the S
1871 through October, 2002. To track the perfo
strategy, I need to track the following inform
What is the average of the S&P 500 Index ov
Do I own stock at the beginning of each mon
Do I buy stock during the month?
Do I sell stock during the month?
What is the cash flow for the month (positiv
0 otherwise)?
The worksheet for this situation requires you t
columns A and B, as well as the headings in row 8
the fle Matradingrule.xlsx, move the cursor to c
click Freeze Panes in the Windows group. This p
Fig
URE 12-3
Freeze Panes options.
Here you choose the Freeze Panes option, which
as you scroll through the worksheet. The Freez
row visible while scrolling through the rest o
row is row 6, you see row 6 no matter how far d
Column option, you always see the leftmost col
Selecting Unfreeze Panes from the menu returns y
The fle Matradingrule.xlsx, shown in Figure 12
effectiveness of a moving-average strategy.
-
Ta
mulas, and some of the IF formulas require an
during a month if and only if I don’t own the s
current month’s price is higher than the 15-mo
frst month for which I can compute a 15-month m
calculations in row 24.

92
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 12-4
Moving-average trading rule beats buy and hold.
Let’s assume I frst owned the stock in April 187
By copying from D24 to D25:D1590
, I compute
the formula
the
A
15-month moving average for each month.
Not
A
e
n easy way to copy the formula from D24 to D25:D
corner of cell D24 (the pointer appears as- a crossha
ton. Double-clicking copies the formula to all the c
to the left. This trick can also be used to copy for
By copying from E24 to E25:E1590 the formula
,
"
I determine for each month whether the S&P sh
Remember that I purchase the share only if I d
of the month and the current value of the S&P e
Notice the AND portion of the formula. It con
allowed) separated by a comma. If both conditi
Yes
; otherwise,
. For
it returns
an IF formula
No
to recognize
quotation marks (“ “) around the text.
By copying from F24 to F25:F1590 the formula
, I
"
determine for each month whether the S&P shar
I owned the S&P share at the beginning of the m
share is below the 15-month moving average. A
sell our S&P stock.

Chapter
IF12
Statements
93
During any month before October 2002, if I b
the cash flow is negative the value of the S
during the month, the cash flow equals the v. O
0. During October, 2002, I sell any S&P sha
by copying from G24 to G25:G1589 the formula
,
I record the cash flow for all months before O
formula
IF(C1590="yes",B1590,0)
gives me cr
beginning of the last month.
In cell G6, I compute total proft from the m
formula
SUM(G24:G1590)
. You can see that the 15-month m
earns a proft of $1,319.75.
The proft from buying and holding shares is s
the April, 1872 S&P value. I compute the pr
G7 with the formula
.
B1590–B24
As you can see, the buy and hold proft of $849
moving-average trading rule. Of course, this s
in buying and selling stocks. If transaction c
profts earned by the moving-average trading str
In the game of craps,
. Iftwo
thedice
total
areoftossed
the dice o
or 12, you
. If lose
the total of the dice on
. Otherwise,
first r
t
game keeps. How
going
can I write a formula to determi
the first roll?
The fact that you lose in craps if you throw a 2, 3
placing an OR formula within an IF formula. In c
Ifstatement.xlsx, shown in Figure 12-5, I ente
”lose”,IF(OR(A5=7,A5=11),”win”,”keep
. This formula is
going”))
then cop
The formula displays
lose
if a 2, 3, or -
12 is e
tered, and it displays
keep going
for any othe
Fig
URE 12-5
Using IF statements to model the frst roll in cr
In most pro forma financial statements, cash is u
liabilities
. I know
balance
that using debt as the
. Howplug
can w
I
set up a pro forma statement having debt as th

94
Microsoft Excel 2010: Data Analysis and Business Modeling
A pro forma is basically a prediction of a compa
construction of a company’s future balance sheet
provides a snapshot of the company’s assets and l
statement tells you how the company’s fnancial s
forma statements can help a company determine it
parts of models that stock analysts use to deter
the fle Proforma.xlsx, I generated the free cash fl
years. Figure 12-6 shows the balance sheet, and Fi
Fig
URE 12-6
Pro forma assumptions and balance sheet.
Fig
URE 12-7
Pro forma income statement.
Column D contains information about the company’
assumptions are as follows:
Sales growth (SG) is 2 percent per year.
Initial sales are $1,000.
Interest rate on debt is 10 percent.

Chapter
IF12
Statements
95
Dividend payout is 5 percent of net income.
The tax rate is 53 percent.
Cost of goods sold (COGS) is 75 percent of s
Depreciation is 10 percent of gross fxed as
Liquid assets earn 9 percent.
Current assets are 15 percent of sales.
Current liabilities are 7 percent of sales.
I assigned the names in the cell range C3:C10 t
each ,Year
basic
t
fnance and accounting imply the f
implemented in a series of formulas:
Formula 12.1:
Year t+1
.
sales=(Year
I computed sales
t sales)*
dur
copying from E28 to F28:H28
.
the formula
D28*
Formula 12.2:
Year t
.
COGS=COGS*(Year
Each year’s COGS
t sales
are c
copying from E29 to F29:H29
.
the formula
COG
Formula 12.3: If
Year
, Year
t assets>Year
debt must
liabil
be se
Year
total assets–Year t current
. Otherwise,
liabilities–Y
Year
t
d
0. I computed each year’s debt in E21:H21 wi
E24,0)
. If Year
t
total assets are greater than Y
t
debt to
Year t total assets–Year
. This equalizes
t current l
ances, assets and liabilities. Otherwise, y
cash and marketable securities are used to b
Formula 12.4:
Year t current liabilities=(CL
. In E20:H20, I u
the formula
$H$4*E28
to compute current lia
from E20 to F20:H20).
Formula 12.5:
Year t equity=Year
. In
t
E24:H24,
stock+Yea
I c
equity by copying from E24 to. F24:H24 the fo
Formula 12.6: If Year
t
debt is greater than 0
equals 0. Otherwise, Year
t
cash and
total
market
liabilities–Year t current
. In
assets–Year
E13:H13, I compu
t net f
and marketable securities for each year by c
IF(E21>0,0,MAX(0,E25–E14–E17))
. If Year
t
debt is greater th
t
cash and marketable securities to balance a
cash and marketable securities equal to 0. O
securities equal to
Year t total
.
assets–Year
This bala
t c
assets and liabilities if Year
t
assets (wi
than Year
t
liabilities. If debt does not ba
assets as the plug that does balance assets a

96
Microsoft Excel 2010: Data Analysis and Business Modeling
Formula 12.7:
Year t interest
. In E33,
expense=(Year
I compute in
t de
expense by using ,the
copying
formula
this
IRD*E21
formula again t
Formula 12.8:
Year t interest income=(Year
.
t c
In E32:H32, I compute interest income by copy
LAIR*E13
.
Formula 12.9:
Year t operating income=Year
. In
t s
E31:H31, operating income is computed by copy
E28–E29–E30
.
Formula 12.10:
Year t dividends=(Year
. In E39:H39,
t
I
net
copy
in
f
F39:H39 the formula
E36*DIV
to compute divide
Formula 12.11:
Year t+1 beginning retained
.
ear
I compute beginning retained earnings each ye
G38:H38 the.formula
E40
Formula 12.12:
Year t end of year retained eaY
earnings+Year t net
.
income–Year
In E40:H40,
t
I
dividends
compute ea
retained earnings by copying from .E40 to F40:
Formula 12.13:
Year t income before taxes=Year t o
expense+Year
.
t
I
cash
compute income before taxes by c
F34:H34 the formula
.
E31–E33+E32
Formula 12.14:
Year t taxes=(Year
. I compute
income
each yea
bef
in E35:H35 by copying from E35
.
to F35:H35 the f
Formula 12.15:
Year t net income after
.
taxes=
In E36:H36, I compute each year’s net income by c
formula .
E34–E35
Formula 12.16:
Year t gross fxed assets=Year t n
depreciation
. In cells E15:H15, I compute gross fxed a
formula .
E17+E16
Formula 12.17:
Year t depreciation=(Year
. For each year,
t net
I u
f
formula
DEP*E15
to compute depreciation, copy
Formula
Year
12.18:
t accumulated depreciation=Year t–
t depreciation
. For each year, I use the formula
D16+E
depreciation by copying the formula from E16 t
Formula 12.19:
Year t net fxed assets=Year t g
depreciation
. In row 17, to compute net fxed assets, I c
formula .
E15–E16

Chapter
IF12
Statements
97
Formula 12.20:
Year t total assets=Year t liq
and marketable
. By
securities
adding liquid assets, curre
compute total assets by copying from .
E18 to F
Formula 12.21:
Year t total liabilities=Year
equity
.
t c
By copying from E25 to F25:H25
, I the
compute
formula
tota
S
liabilities for each period. Each year will b
statements.
Formulas 12.3 and 12.6 require the use of IF s
circular references. (For more information abo
“Circular References.”) For example, the follow
Year
t
cash affects Year
t
total assets.
Year
t
total assets affect Year
t
debt.
Year
t
debt affects Year
t
cash.
Because the worksheet contains circular refere
Options, choose Formulas, and select the Enabl
explained in Chapter 11, this enables Excel to r
Year
, total assets in row 18 equal total liabili
formulas combined with circular references.
When I copy a VLOOKUP formula to determine sal
a lot of #N/A
. Then
errors
when I average the employee
-
sa
cal answer because . of
Canthe
I easily
#N/A errors
replace the #N
space so I can compute average salary?
The fle Errortrap.xlsx (see Figure 12-8) contai
cell range D3:E7. In D11:D15 I have a list
-
of f
ing from E11 to E12:E15 the formula
. Unfortunately
=VLOOKUP(D
cells E13 and E14 Excel displays an #N/A error
#N/A error value when a formula cannot return a
have no listed salary, VLOOKUP cannot return a s
average salary in E16 with, the
I get
formula
an #N/A
=AVERAG
erro
I have taught go through and manually replace
-
th
erage formula will calculate properly (by igno
replacing errors with a character (such as a s
IFERROR(value,value_if_error)
.
The frst argument is the formula you want calc
value to insert in the cell if your formula re
are #DIV/0, #NAME, #NUM, #REF, #VALUE; more on th
copying from F11 to F12:F15 the formula
IFERRO
computes salary correctly for each actual empl

98
Microsoft Excel 2010: Data Analysis and Business Modeling
who are not actual employees. The formula
=AVERA
average salary for all listed employees.
Fig
URE 12-8
Error trapping formulas.
Excel 2010 contains a new function, the AGGREGAT
calculations and ignore rows that contain errors
AGGREGATE(
function number,
.
Function
option, number
array)
is a code b
that gives the function involved in your calcula
9 = SUM. See the Help topic on this function (ob
the Function Wizard) for a complete list of avai
that should be ignored in your calculations. (Se
error values are ignored.
Array
is simply the ra
in cell E18, the formula
AGGREGATE(1,6,E11:E15)
c
the listed salaries.
Option Behavior
0 or omitted
Ignore nested SUBTOTAL and AGGREGATE function
1
Ignore hidden rows and nested SUBTOTAL and AG
2
Ignore error values and nested SUBTOTAL and A
3
Ignore hidden rows, error values, and nested S
4
Ignore nothing
5
Ignore hidden rows
6
Ignore error values
7
Ignore hidden rows and error values

Chapter
IF12
Statements
99
The fle Errortypes.xlsx, shown in Figure 12-9, c
values.
Fig
URE 12-9
Examples of Excel error values.
In cell D3, the formula
=C3/B3
yields a #DI/
In cell D6, the formula
=C6+D6
yields a #VAL
appropriate type of data for the entered fo
In cell D7, the formula
=SUM(Sales)
returns a
name
Sales
referred to in the formula is not d
In cell D8, the formula
=SQRT(–1)
results in a
when you enter an unacceptable argument in a f
not have square roots, Excel displays the #
In cell C9, I entered the formula
SUM(A1:A3
a #REF! error because the cells that are re
longer in the worksheet.
The IFERROR function can be used to replace an
string.
My worksheet contains quarterly
. Can Irevenues
easily- compu
for W
enue for each year and place it in the row con
The fle Walmartrev.xlsx contains quarterly rev
Figure 12-10.) Rows 6, 10, 14, and so on contai
year. In each of these rows, I would like to c
In other rows, column E should be blank. I cou
and copy this formula to E10, then E14, then E
way. Using an IF statementROW
with
andtwo
)
,MOD
gives
neat me
Excel
an f
easy way to enter my formula once and then
-
copy th
ence)
yields the row of
ROW(A6)
reference.
yieldsThe
a 6;
functio
if yo
=ROW()
function would also yield a 6. The
- func
der when
number
is
. For
divided
example,
by
divisor
MOD(9,4)
yield

100
Microsoft Excel 2010: Data Analysis and Business Modeling
yields 0. Note that I want my formula to work on
divided by 4. Therefore, copying from E6 to E7:E
2,SUM(D6:D9),” “)
ensures that I add up revenues f
a remainder of 2 when divided by 4. This means th
frst quarter of each year, which is the goal.
Fig
URE 12-10
Summarizing Wal-Mart annual revenues.
IF statements can. How
get many
rather
IF large
statements can I n
the maximum number of characters allowed in an E
In Excel 2010, you can nest up to 64 IF statemen
you could nest a maximum of seven IF statements. I
contain up to 32,000 characters. Previous versio
a cell.
Problems
1.
Suppose the price of a product will change at da
Date
Price
On or before February 15, 2004
$8
From February 16, 2004, through
$9 April 10, 2005
From April 11, 2005, through $10
January 15, 2006
After January 15, 2006
$11
Write a formula that computes the price of th
is sold.

Chapter
IF12
Statements
101
2.
The Blue Yonder Airline flight from Seattle t
The airline sold 270 tickets for the -
flight at a p
refundable. The variable cost of flying a pa
is $30 per passenger. If more than 250- peop
booked and Blue Yonder must pay overbooking c
each overbooked passenger. Develop a worksh
based on the number of customers who show u
3.
A major drug company is trying to determine th
A unit of annual capacity can be built for a c
$12 and incurs variable costs of $2. The
-
dr
sheet that computes the company’s 10-year p
level and the annual demand for the drug. A
each year. You can ignore the time value of m
4.
The drug company is producing a new drug. T
assumptions:
During Year 1, 100,000 units will be sold
Sales will grow for three years and then d
During the growth period, sales will grow a
the decline, sales will drop at a rate of 1
Develop a worksheet that takes values for Y
the length of the decline cycle, the growth r
decrease during the decline cycle and compu
5.
You are bidding on a construction project. T
the project cost at $10,000. Four companies a
prepare the bid. Write a formula that (give
bid) computes your proft.
6.
We are bidding on a valuable painting. The hi
the painting’s value at $10,000. Four compani
prepare the bid. Write a formula that (give
bid) determines whether we get the painting
7.
A drug company believes its new drug will s
two competitors to enter the market. The ye
company expects to lose 30 percent of its m
competitor enters, the company expects to l
of the market is growing at 10 percent per y
two competitors enter, develop a worksheet th
years 2004–2013.

102
Microsoft Excel 2010: Data Analysis and Business Modeling
8.
A clothing store has ordered 100,000 swimsuit
They plan to sell them until August 31 at a p
to $30. Given values for demand through Augus
worksheet to compute the proft from this orde
9.
In a game of craps, on each roll of the dice a
the game has not ended and the current roll m
If the game has not ended and the current rol
continues. Develop a worksheet that tells you (
the status of the game after four dice rolls.
10.
On the S&P moving-average example, suppose we s
exceeds the 15-month moving average, but we s
5-month moving average. Is this strategy more p
price is less than the 15-month moving averag
11.
A European call option gives you the right to b
stock for a given exercise price. A
butterfly s
a low exercise price, buying one call option w
call options with an exercise price midway be
Here is an example of a butterfly spread: The c
six-month European call option for $9, buy a $
$4, and sell two $60 European call options fo
dollars, not percentage) for this transaction a
ranging from $40–$80. When a trader purchases a b
movement in the stock price during the next s
12.
Suppose a stock is currently selling for $32. Y
with an exercise price of $30 for $2.50 and s
an exercise price of $35 for $1. Compute
-
the p
tion of a six-month stock price ranging from $
spread
? How would you modify this?strategy to cr
13.
Let’s reconsider our pro forma example. Suppo
on our fnancial well-being. More specifcally,
-
s
est and taxes (EBIT) are negative, our intere
expense is more than 10 percent of EBIT and E
13 percent. Otherwise, our interest rate is 1
for this variable interest rate.
14.
Do this problem independently of Problem 13. S
equity ratio of 50 percent during each year. H
Hint: You must keep each year’s stock nonnega
marketable securities to balance assets and l

Chapter
IF12
Statements
103
15.
Martin Luther King Day occurs on the third M
computes (given the year) the date of Marti
day of the week for January 1 of the given y
16.
Thanksgiving occurs on the fourth Thursday i
computes (given the year) the date of Thank
week for November 1 of the given year.
17.
The frst quarter of the year is January–Mar
quarter, July–September; and the fourth qua
that returns (for any given date) the quart.
18.
Write a formula that returns a person’s age
19.
Labor Day is the frst Monday in September. W
of Labor Day for a given year.
20.
The fle Nancybonds.xlsx gives the bond rati
future month. You want to effciently count h
Unfortunately, each company is listed in mo
the data on the company name, how would you d
bonds?
21.
The fle Addresses.xlsx gives people’s names o
next line, and their city, state, and ZIP c
each person’s information on one line?
22.
The fle FormattingDDAnum.xlsx gives a bunch o
DDA1250045, and so on. A cell is properly f
DDA and the last seven characters are a num
cells are properly formatted.
23.
Suppose the number of Group 1 members is li
members is listed in cell B2, and the numbe
The total number of group members is always
-
1
bers, Group 2 has 30 members, and Group 3 h
each Group 1 member in column D, a 2 for ea
for each Group 3 member in column D. Thus, c
1 in D1:D50, a 2 in D51:D80 and a 3 in D81:D
24.
The fle Dividebyprice.xlsx contains units s
want to determine the average price for eac
there is no average price. Error-trap the fl
ucts with zero sales yield the message “No s

104
Microsoft Excel 2010: Data Analysis and Business Modeling
25.
The School of Fine Art has 100 lockers number
open. We begin by closing every locker whose n
“toggle” (toggling means opening a closed loc
locker whose number is divisible by 4; then w
divisible by 5,…, and fnally we toggle each l
How many lockers are now open?
26.
The fle Matchlist.xlsx contains a list of peo
and a list of people who bought it in March. D
customers purchased your product in March.
27.
Set up a “calendar worksheet” that takes a gi
the day of the week on which each day of the m
28.
Some rows of column C of fle Problem28data.xl
Create
formulas in column D that place an X in a row o
that row contains
.
the word
and
29.
Suppose you toss two 20-sided dice. The 400 p
(20,20). Use IF statements to systematically g

105
Chapter 13
Time and Time Funct
Questions answered in this chapter:
How do I enter times in Excel?
How do I enter a time and date in the same c
How does Excel do computations with times?
How can I have my worksheet always display th
How can I use the TIME function to create ti
How can I use the TIMEVALUE function to con
How do I extract the hour, minute, or secon
Given work starting and ending times, how d
employee worked?
I added up the total time an employee worke
What did I do wrong?
How can I easily create a sequence of regul
Recall from Chapter 7, “Dates and Date Functio
January 1, 1900, the serial number 1, January 2, 1
also assigns serial numbers to times (as a fra
midnight, so 3:00 A.M. has a serial number of .
has a serial number of .75, and so on. If you c
number is the number of days after January 1, 1
the given time. Thus, entering January 1, 2007
a serial number of 39083, whereas January 1, 2
39083.25.
Answers to This Chapter’s Ques
How do I enter times in Excel?
To indicate times, you enter a colon (:) after th
For example, in fle Time.xlsx (see Figure
- 13-1
ply 8:30 or as 8:30 A.M. In cell C3, I entered 8
also have entered 8:30 P.M. with 24-hour milit
PM. This represents 30 seconds after 3:10 P.M.

106
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 13-1
Examples of time formats.
How do I enter a time and date in the same cell?
Simply put a space after the date and enter the
entered January 1, 2007 5:35. Of course, this re
immediately reformatted this to 1/1/2007 5:35.
How does Excel do computations with times?
When Excel computes differences in times, the re
in the cell. Figure 13-2 displays the various Ex
Fig
URE 13-2
Excel time formats.
In the fle Time.xlsx (see Figure 13-2), I took th
in cells F5 and H5 with the formula
=C3–C2.
If y
these times are 12 hours apart and enters 12:00 P
want Excel to portray these times as .5 days apa
time difference to hours.) To make Excel show .5 i
In cell F7, I tried to subtract an earlier
.
time f
Because I did not reformat the cell, Excel displ
simply change the cell containing the formula to th
obtain the correct time difference, –.5 days.
Cells B17 and C17 give the start times for
-
two j
ish times for the jobs. (See Figure 13-3.) If yo

Chapter
Time
13 and Time Functions
107
complete each job, simply copy from B19 to C19 th
as Number. Thus, the frst job took 29.18 days, a
Fig
URE 13-3
Determining time needed to complete jobs.
How can I have my worksheet always display the c
The Excel formula
=NOW()
gives today’s date an
(see Figure 13-4) of fle Time.xlsx, entering
-
=
ated the screen capture at 21:50 P.M. on July 1
enter in cell H2 or I2 .the
Cell
formula
H2 is
=NOW()–TODA
formatted t
P.M.), whereas cell I2 is formatted to show a n
9:50 P.M. is 91 percent of the way between mid
day.
Fig
URE 13-4
Using the
Now()
and
Today()
functions.
How can I use the TIME function to create time
The TIME function has the .
syntax
Given
TIME(hour,min
an hour, min
seconds, the TIME function returns a time of d
exceeding 24 hours.
In cell A2 (see Figure 13-1), the formula
=TIM
=TIME(20,30,0)
yields 8:30 P.M. In cell A4, th
Finally, note that in cell A5 the formula
=TIM
yields 1:10:30 A.M.
Of course, if the number of seconds does not s
displays seconds.
How can I use the TIMEVALUE function to conver
The function TIMEVALUE has the syntax
=TIMEVAL
string that gives a time in a valid format. Th
between 0 and 1. (This means that the TIMEVALU
.) For
example, in cell A7 (see Figure 13-1), the for
because 8:30 A.M. is 35.4 percent of the way b
the next day.

108
Microsoft Excel 2010: Data Analysis and Business Modeling
How do I extract the hour, minute, or second fro
The Excel HOUR, MINUTE, and SECOND functions extr
a cell containing time. For example (as
- shown in Fi
mula
=HOUR(A4)
yields 15 (3:00 PM is 15:00 milit
=Minute(A4)
yields 10, whereas entering
=SECOND(
Given work starting and ending times, how do I d
employee worked?
In cells C10:D11 (see Figure 13-5), I entered th
ended work. We want to fgure out how long each o
is that Jane fnished work the day after she star
give the actual number of hours she worked. Copy
=IF(D10>C10,24*(D10–C10),24+24*(D10–C10))
yields th
formatted these cells as Number. If the fnish ti
start time from the fnish time and multiplying by 2
is before the start time, then
24*(fnish time–st
but adding 24 hours fxes things, assuming the en
worked 9 hours and Jack worked 8.5 hours.
Fig
URE 13-5
Computing length of time worked by employees.
I added up the total time an employee worked,
. What
an
did I do wrong?
In cells C31:D35 in Figure 13-6, I give the numb
worked on each day of her workweek. In cell D36, t
compute the total number of hours worked during th
wrong! With the format h:mm, Excel never yields a v
chose a format (38:48:00) that allows for more th
worked each day yields the correct number of hou
Fig
URE 13-6
Determining total hours worked during the week.

Chapter
Time
13 and Time Functions
109
How can I easily create a sequence of regularl
Suppose a doctor takes appointments from 8:00 A
How can I enter in different rows the list of p
great AutoFill feature. (See Figure 13-7.) Ent
in cells L15:L16. Now select cells L15:L16 and m
cell L16 until you see the black cross. Drag th
appointment time). From cells L15:L16, Excel h
times that are 20 minutes apart. Of course, en
using AutoFill will yield the sequence Monday, T
at Monday. Entering 1/1/2007 in one cell, 2/1/
and using AutoFill yields a sequence of dates, l
Fig
URE 13-7
Entering a sequence of times.
Problems
1.
Write a formula that will return a time 18 h
2.
The fle Marathon.xlsx gives marathon race ti
C refer to this data. Compute the average ti
a.
How much faster was John than Jill?
b.
How many total minutes did each runner ta
c.
How many total seconds did each runner ta
3.
The fle Jobshop.xlsx gives the start time a
required to complete each job. Determine th

111
Chapter 14
The Paste Special C
Questions answered in this chapter:
How can I move the results of calculations (
worksheet?
I have a list of names in a column. How can I m
column?
I’ve downloaded U.S. T-Bill interest rates f
5 when the interest rate is 5 percent, 8 wh
How can I easily divide my results by 100 s
is displayed as .05?
With the Paste Special command in Microsoft Ex
worksheet data. In this chapter, I’ll show how y
perform the following types of operations:
Paste only the values in cells (not the for) t
Transpose data in columns to rows and vice v
Transform a range of numbers by adding, sub
number in the range by a given constant.
Answers to This Chapter’s Ques
How can I move the results of calculations (no
worksheet?
In the
Paste Special Value
worksheet contains
the fl
the names, games, total points, and points per g
players from Bloomington, Indiana. In the cell r
to compute each child’s points per game, as sh
copy this data and the calculated points per g
calculations—to a different cell range (E13:H1
E4:H9, press Ctrl+C, and then move to the uppe
to copy the data (cell E13 in this example). N
target range, click Paste Special, and then fl
Figure 14-2. After clicking OK, the range E13:
the cell range E4:H9. You can check this by go
the formula that was used to compute Gregory’s a

112
Microsoft Excel 2010: Data Analysis and Business Modeling
use the Paste Special command, select Values, an
from which you copied the data, your formulas di
Fig
URE 14-1
Using the Paste Special command to paste only value
Fig
URE 14-2
The Paste Special dialog box with Values selected. S
any formulas.
I have a list of. names
How can
inIamake
column
the list appear i
column?
To realign data from a row to a column (or vice v
Special command with Transpose selected. Essentia
Special dialog box “flips” selected cells- around s
comes the frst column of the range you paste dat
at the
Paste Special Transpose
worksheet in the fl
Suppose that you want to list the players’ names i
select the range E5:E9, and then press Ctrl+C to c
Paste Special, and select Transpose in the Paste S
transposes the players’ names into one row.

Chapter
The
14Paste Special
113
Command
Fig
URE 14-3
Use the Transpose option in the Paste Special di
column or a column of data into a row.
Suppose you want to transpose the spreadsheet c
cell E17. Begin by selecting the range E4:H9. N
corner of the range where you want to put the tr
choose Paste Special, select Transpose, and th
is transposed (turned on its side), as shown i
smart enough to adjust the points-per-game for
now computed from data in the same column inst
Not
When you select Paste Special and click Paste L
linked to the original cells, and changes you make t
By changing the ,value
the value
in cell
in F5
cell
to F18
7
becomes 7 a
display Dan’s average as 4 points per game.
I’ve downloaded
S.. T-Bill
U interest rates
. The
from
data websit
displ
5 when the interest rate is 5 percent, 8.
when t
How can I easily divide my results by 100 so t
displayed
05? as
.
The
Paste Special Divide Before
worksheet in th
contains the annual rate of interest paid by th
January 1970 and February 1987. In January 197
was 8.01 percent. Suppose you want to earn ann
T-Bill rate. The formula to calculate
. It would
theberate
eas i
compute earned interest if the column of annua
The Operations area of the Paste Special dialo
each number in a range by a given number,
-
prov
est rate by 100. Here we want to divide each n

114
Microsoft Excel 2010: Data Analysis and Business Modeling
divisor (100). You can enter it anywhere in the w
F5 selected, press Ctrl+C. You will see the “mov
range of numbers you want to modify. To select a
press Ctrl+Shift and then the Down Arrow key. Thi
“tall” cell range. (To select a “wide” set of da
and then press Ctrl+Shift and the Right Arrow ke
and then select Divide in the Paste Special dial
Fig
URE 14-4
Data for using the Divide option in the Paste Spec
by a constant.
Fig
URE 14-5
You can apply an option in the Operation area of th
range of cells.
After you click OK, Excel divides each selected n
shown in Figure 14-6. If you had selected Add, D
Subtract, D10 would display –91.99; and if you h

Chapter
The
14Paste Special
115
Command
Fig
URE 14-6
Results of using the Divide option in the Paste S
Problems
1.
The fle Mavs.xlsx contains statistics for th
basketball team. Player names are listed in c
row 3, and statistical results are listed i
player names are listed in the same row and a
same column.
2.
Field goal percentage, free throw percentag
decimals. For example, Steve Nash made 91.9 p
as .919. Change the worksheet so that all s
from 1 through 100.
3.
The fle Productpaste.xlsx contains data on q
data to another range so that quarterly sal
copied data to the original data so that yo
data range will reflect changes entered in r
4.
The fle Productsalespaste.xlsx contains sal
of units). Convert this sales data to sales i
the Ctrl key (as explained in Chapter 2, “Ra
range of cells.

117
Chapter 15
Three-Dimensional F
Questions answered in this chapter:
Is there an easy way to setup a multiple-wo
worksheet
has a similar structure? Can I easily creat
worksheets?
In many business situations you have to set u
a similar format or structure. Here are som
You want to track your company’s sales in ea
worksheet and then summarize total sales in a s
You want to track your company’s sales for e
then summarize year-to-date sales in a summ
In this chapter, you will learn how to set up w
have a similar structure. In this chapter I al
you to easily write formulas to perform calcul
Answers to This Chapter’s Ques
Is there an easy way to setup a multiple-works
worksheet
has a similar structure? Can I easily create f
worksheets?
Let’s suppose you want to set up a workbook th
sales in each region (East, South, Midwest
-
and W
rize total sales in a summary worksheet. In ea
uct’s price, unit cost, and units sold as well a
worksheet you want to track just total proft a
worksheets to look like Figure 15-1.
Fig
URE 15-1
Sales in the East.

118
Microsoft Excel 2010: Data Analysis and Business Modeling
To set up this structure, you enter in cell C3 o
the unit cost, in cell C5 the units sold, and in c
compute the East region proft
. Of
with
course,
the formula
you wan
(
same structure in the worksheets for the other r
headings and formula in only one worksheet, and th
the other region’s worksheets.
To begin, open a blank workbook, which
clicking
by defaul
the Insert Worksheet icon to the right of the la
Shift+F11), insert two new worksheets so that yo
the frst four worksheets East, South, Midwest, a
All sales will be totaled in the Summary workshe
File tab and then choose General, you can change th
workbook by default.)
To set up the regional worksheets, select the fr
Shift key and select the last individual workshe
worksheet is duplicated in the other regional wo
Unit Cost
in cell B4,
Units Sold
in cell B5,
Fix
enter the formula
(C3-C4)*C5-C6
in cell C7. Now c
procedure. You will see that each regional works
the correct Proft formula in cell C7.
You are now ready to use three-dimensional formu
In cell C5, you will compute total units sold. R
region in cell C5. Move your cursor to cell C5 o
to compute total units sold. Type
=SUM(
and then m
want to total (cell C5 of sheet East). Next, hol
want to total (cell C5 of worksheet West). Lastl
and you will see entered in cell C5 of .the
This
Summa
formula is an example of a three-dimensional for
dimensions (rows and columns.) A three-dimension
across worksheets. This formula tells Excel to s
East worksheet and ending with the West workshee
have simply typed this formula in cell C5 of the S
and pasting it to cell C7 of the Summary workshe
(See Figure 15-2.)
In Chapter 47, “Consolidating Data,” you will le
can be used to summarize data from multiple work

Chapter
Three-Dimensional
15
119
Formulas
Fig
URE 15-2
Summarizing unit sales and proft.
Problems
1.
You own six local coffee shops. The revenue
are given in the following table.
Shop
Revenues
Customer Count
1
$8,000
1,950
2
$7,000
1,800
3
$9,000
2,200
4
$8,400
2,000
5
$5,900
1,400
6
$10,100
2,500
Set up a workbook that makes it easy to ent
store and create a summary worksheet (using th
computes total weekly revenue and customer c

121
Chapter 16
The Auditing Tool
Questions answered in this chapter:
I’ve just been handed a fve thousand–row wo
value (NPV) of a new car. In the worksheet, m
about the annual percentage of the growth i
worksheet are affected by this assumption?
I think my fnancial analyst made an error c
cells in the worksheet model were used for thi
How does the auditing tool work when I’m wo
worksheet or workbook?
When we hear the
, we
word
often
structure
think about the stru
structure of a worksheet model refers to the wa
price, and unit cost) are used to compute outp
Microsoft Excel 2010 auditing tool provides an e
of a worksheet, which makes understanding the l
easier. To view the auditing options in Excel, d
view the Formula Auditing group. (See Figure 1
Fig
URE 16-1
The Formula Auditing toolbar.
In this chapter, I discuss the Trace Precedent
commands. I discuss the Evaluate Formula comma
Clicking Show Formulas serves as a switch that t
the display of the values that result from the f
between showing formulas in cells and showing th
By using the Watch Window you can select a cel
in the workbook, you will see how the value of th
selecting the Watch Window you can select Add W
Sheet 1). Now even if you are working in a dif
you how cell C3 of Sheet 1 changes.
Trace Precedents and Trace Dependents locate a
for worksheet cells or formulas. A
precedent
i

122
Microsoft Excel 2010: Data Analysis and Business Modeling
a selected formula’s value. For example, if you w
would make assumptions about the number of lette
mailing. Then you could compute the number
. Inof re
this case, the response rate and total letters m
formula used to compute total responses. A
depen
values can’t be computed without knowledge of a s
the cell containing the total number of response
response rate. Excel marks precedents and depend
Auditing tool. The Remove Arrows button clears th
Let’s apply the Auditing tool to some practical p
Answers to This Chapter’s Quest
I’ve just been handed a five thousand–row workshe
value (NPV) of
. Inathe
newworksheet,
car
my financial analy
about the annual percentage of . the
Which
growth
cells inthe p
worksheet are affected by this assumption?
The
Original Model
worksheet in the fle NPVaudit
the NPV of after-tax profts for a car expected t
years. (See Figure 16-2.) Price and cost- are in th
sumed for the analysis are given in cells C1:C8 (
B1:B8). I’ve assumed that the price of the produ
Which cells in the worksheet are dependents of thi
Fig
URE 16-2
You can use the Auditing tool to trace formulas in c
To answer this question, select cell C8 (the cel
growth), and then click the Trace Dependents but

Chapter
The
16Auditing
123
Tool
Formulas tab. Excel displays the set of arrows s
cells.
By clicking the Trace Dependents button
depend
once, E
on the price growth assumption. In Figure 16-3
Years 2–5 depend directly on this assumption. C
all formulas whose calculation requires the va
Figure 16-4.
Fig
URE 16-3
Tracing dependent cells.
Fig
URE 16-4
Clicking Trace Dependents repeatedly shows all t
assumption.
You can see that in addition to unit price in Y
Years 2–5 revenue, before-tax profts, tax paid
the arrows by clicking the Remove Arrows butto

124
Microsoft Excel 2010: Data Analysis and Business Modeling
I think my financial analyst made an error
. Which
in com
cells in the worksheet model were used for this c
Now we want to fnd the precedents for cell B15. T
compute Year 1 before-tax proft. Select cell B15
once. You’ll see the arrows shown in Figure 16-5
Fig
URE 16-5
Direct precedents for Year 1 before-tax proft.
As you can see, the cells directly needed to com
revenues and Year 1 cost. (Before-tax Year 1 pro
Repeatedly clicking the Trace Precedents button y
proft, as shown in Figure 16-6.
Fig
URE 16-6
Click Trace Precedents repeatedly to show all prec
Here the only input assumptions that influence Ye
Year 1 price, and Year 1 cost.

Chapter
The
16Auditing
125
Tool
How does the auditing tool work when I’m worki
worksheet or workbook?
Consider the simple worksheet model in the wor
in Figure 16-7. The formula in the
Proft
unit
works
sales*(price
variable
fxed
cost)
from information contained i
Fig
URE 16-7
Data for using the Auditing tool on multiple wor
Suppose you want to know the precedents of the p
worksheet, and then click Trace Precedents in th
tab. You’ll see a dotted line, an arrow, and th
Fig
URE 16-8
Results of tracing precedents with data on multi
The worksheet icon indicates that the preceden
worksheet. Double-clicking the dotted line dis
Figure 16-9.
Fig
URE 16-9
With the Go To dialog box, you can audit data in m
Now you can click any of the listed precedents (
will send you to the precedent you selected.

126
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
In the car NPV example, determine the followi
The direct dependents and all dependents of th
The direct dependents and all dependents of th
The direct precedents and all precedents fo
The direct precedents and all precedents fo

127
Chapter 17
Sensitivity Analysi
Questions answered in this chapter:
I’m thinking of starting a store in the loc
opening the store, I’m curious about how my p
depend on the price I charge and the unit c
I am going to build a new house. The amount o
15-year repayment period) depends on the pr
I’m also unsure about the annual interest r
how my monthly payments will depend on the a
interest rate?
A major Internet company is thinking of pur
retailer’s current annual revenues are $100 mi
Current projections indicate that the retai
year and its expenses are growing at 5 perc
be in error, however, and would like to know
revenue and expense growth, the number of y
Most worksheet models contain assumptions abou
model. In our lemonade example, the inputs inc
The price for which a glass of lemonade is s
The unit cost of producing a glass of lemon
The sensitivity of demand for lemonade to p
The annual fxed cost of running a lemonade s
Based on input assumptions, you can compute ou
example, the outputs of interest might include
Annual proft
Annual revenue
Annual variable cost
Despite best intentions, assumptions about inp
best guess about the variable cost of producin
possible that your assumption is in error.
Sen
outputs vary in response to changes to its inp
a change in product price affects yearly proft
Microsoft Excel 2010 lets you easily vary one o

128
Microsoft Excel 2010: Data Analysis and Business Modeling
With a
one-way
data table, you can determine how c
of outputs. With a
two-way
data table, you can d
a single output. This chapter’s three examples w
obtain meaningful sensitivity results.
Answers to This Chapter’s Quest
I’m thinking of starting a store in. Before
the local ma
opening the store, I’m curious about how my profi
depend on the price I charge
.
and the unit cost
The work required for this analysis is in the fl
17-4.) The input assumptions are given in the ra
lemonade (see the formula in. cell
(Chapter
D2) equals
79, “Esti
650
Demand Curve,” contains a discussion of how to e
names in C1:C7 to correspond to cells D1:D7.
I computed annual revenue in cell
. InD5
cell
with
D6,
theI fo
co
the annual variable cost with
. Finally,
the formula
in cell
unit_c
D7, I c
proft by using the formula .
revenue–fxed_cost–var
Fig
URE 17-1
The inputs that change the proftability of a lemona
Suppose that I want to know how changes in price (
in $0.25 increments) affect annual proft,
changing
revenu
only one input, a one-way data table will solve th
Figure 17-2.

Chapter
Sensitivity
17
Analysis
129
with Data Tables
Fig
URE 17-2
One-way data table with varying prices.
To set up a one-way data table, begin by listi
interest (ranging from $1.00 through $4.00 in $0
I moved over one column and up one row from th
formulas I want the data table to calculate. I e
formula for revenue in cell E10, and the formu
Now select the table range (C10:F23). The tabl
its last row is the row containing the last in
the column containing the inputs; its last col
After selecting the table range, display the Da
click What-If Analysis, and then click Data Ta
shown in Figure 17-3.
Fig
URE 17-3
Creating a data table.
For the column input cell, you use the cell in w
values listed in the frst column of the data t
inputs are prices, I chose D1 as the column in
one-way data table shown in Figure 17-4.

130
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 17-4
One-way data table with varying prices.
In the range D11:F11, proft, revenue, and variab
In cells D12:F12, proft, revenue, and variable c
through the range of prices. The proft-maximizin
price of $3.75 would produce an annual proft of $
and an annual variable cost of $14,062.50.
Suppose I want to determine how annual proft var
$5.00 (in $0.25 increments) and unit cost
-
varies f
ments). Because here I’m changing two inputs, I n
I list the values for one input down the frst co
H11:H25 for the price values) and the values for th
range. (In this example, the range I10:O10 holds th
table can have only one output cell, and the for
upper-left corner of the table range. Therefore, I p
Fig
URE 17-5
A two-way data table showing proft as a function of p

Chapter
Sensitivity
17
Analysis
131
with Data Tables
I select the table range (cells H10:O25) and d
click What-If Analysis and then click Data Tab
cell D3 (unit variable cost) is the row input c
frst column of the table range are used as pri
range are used as unit variable costs. After c
in Figure 17-5. As an example, in cell K19, wh
is $0.40, the annual proft equals $58,850.00. F
maximizing price. Note that as the unit cost i
as some of the cost increase is passed on to c
the proft-maximizing price in the data table i
price. When you learn about the Excel Solver i
the penny) the exact proft-maximizing price.
Here are some other notes on this problem:
As you change input values in a worksheet, t
change, too. For example, if you increased f
the data table would be reduced by $10,000.
You can’t delete or edit a portion of a dat
data table, select the table range, copy th
Special. Then choose Values from the -Paste S
ever, changes to your worksheet inputs no l
update.
When setting up a two-way data table, be ca
input cells. A mix-up will cause nonsensica
Most people set their worksheet calculation m
change in your worksheet will cause all you
you want this, but if your data tables
-
are l
credibly slow. If the constant recalculatio
click the File tab on the ribbon, click Opti
select Automatic Except For Data Tables. Wh
selected, all your data tables recalculate o
Alternatively, you can click the Calculatio
the Formulas tab) and then click Automatic E
I am going to build
. The aamount
new house
of money I need to b
repayment period) depends on the price
. I’m for
alsowhi
u
about the annual interest . rate
Can II’ll
determine
receivehow
wh m
payments will depend on the amount borrowed an
The real power of data tables becomes evident w
the Excel functions. In this example, we’ll us
amount borrowed and the annual interest rate) t

132
Microsoft Excel 2010: Data Analysis and Business Modeling
how the monthly payment varies as these inputs c
detail in Chapter 10, “More Excel Financial Func
Mortgagedt.xlst, shown in Figure 17-6.
Suppose you’re borrowing money on a 15-year mort
made at the end of each month. I’ve input the am
months in the mortgage (180) in D3, and annual i
names in cells C2:C4 with the cells D2:D4.
-
Based o
ment in D5 with the formula
-PMT(Annual_int_rate
.
Fig
URE 17-6
You can use a data table to determine how mortgage p
and the interest rate change.
You think that the amount borrowed will range (d
your current house) between $300,000 and $650,00
range between 5 percent and 8 percent. In prepar
the amounts borrowed in the range C8:C15 and pos
D7:J7. Cell C7 contains the output you want to r
Therefore, I set cell C7 equal to cell D5. Next I s
Analysis on the Data tab, and then click Data Ta
of the table range are amounts borrowed, the col
row of the table are annual interest rates, so o
see the data table shown in Figure 17-6. This ta
$400,000 at an annual rate of 6 percent, your mo
The data table also shows that at a low interest r
$50,000 in the amount borrowed raises the monthl
high interest rate (such as 8 percent), an incre
the monthly payment by about $478.
A major Internet company is thinking
. The
retailer’s
of purchasi
current annual revenues are $100 million,
. Current with e
projections indicate that the retailer’s revenue
its expenses are growing
. We at
know
5 percent
projections
per year
might b
however, and we would like to know, for a variet
and expense growth, the number of years
.
before t

Chapter
Sensitivity
17
Analysis
133
with Data Tables
We want to determine the number of years neede
in revenue from 10 percent through 50 percent a
percent through 20 percent. Let’s also assume th
we’ll say “cannot break even.” Our work is in th
17-8.
I chose to hide columns A and B and rows 16–18
cells in columns A and B (or select the column h
the Cells group, click Format, point to Hide & Un
16–18, select any cells in those rows (or sele
procedure, selecting Hide Rows. Of course, the
Rows and Unhide Columns. If you receive a work
and want to quickly unhide all of them, you ca
Select All button at the intersection of the c
Rows and/or Unhide Columns will unhide all hid
In row 11, I project the frm’s revenue out 13 y
rate assumed in E7) by copying from. F11
In row
to G11:
12, I
project the frm’s expenses out 13 years (based o
in E8) by copying from F12 to. G12:R12
(See Figure
the form
17-7
Fig
URE 17-7
You can use a data table to calculate how many y
We would like to use a two-way data table to d
revenues and expenses affects the years needed t
value always tells us the number of years need
during any of the next 13 years, this might se
I begin by using in row 13 an IF statement for e
during the year. The IF statement returns the n
year or 0 otherwise. I determine the year we b
all the numbers in row 13. Finally, I can use c
table.
I copy from cell F13 to G13:R13 the
. This
formula
IF
reflects the fact that we break even for the fr
previous year, revenues are less than expenses
greater than expenses. If this is the case, th
entered.

134
Microsoft Excel 2010: Data Analysis and Business Modeling
Now, in cell E15 I can determine the breakeven y
IF(SUM(F13:R13)>0,SUM(F13:R13),”No
. If we do not break
BE”)
even dur
the formula enters the text string “No BE”.
I now enter the annual revenue growth rates (10 p
E21:E61. I enter annual expense growth rates (2 p
I ensure that the year-of-breakeven formula
.
is c
Next, I select the table range E20:X61, click Wh
Data Table. I select cell E7 (revenue growth rat
growth rate) as the row input cell. With these s
in Figure 17-8.
Fig
URE 17-8
A two-way data table.
Note, for example, that if expenses grow at 4 pe
revenue will result in breaking even in eight ye
revenue will result in breaking even in only two y
percent per year and revenues grow at 14 percent p
end of 13 years.
Problems
1.
You’ve been assigned to analyze the proftabil
following assumptions have been made:
Bill is receiving a one-time royalty paymen
The fxed cost of producing the hardcover ve
The variable cost of producing each hardcov
The publisher’s net from book sales per har
The publisher expects to sell 1 million har
The fxed cost of producing the paperback is $
The variable cost of producing each paperba
The publisher’s net from book sales per pap
Paperback sales will be double hardcover sa

Chapter
Sensitivity
17
Analysis
135
with Data Tables
Use this information to answer the followin
Determine how the publisher’s before-tax p
from 100,000 through 1 million copies.
Determine how the publisher’s before-tax p
from 100,000 through 1 million copies and th
sales varies from 1 through 2.4.
2.
The annual demand for a product equals
500-
.
,
5
where
p
is the pr
product in dollars and
a
is hundreds of dol
annual fxed cost of selling the product
-
is $
ducing the product is $12. Determine a pric0
(within $100) that maximizes proft.
3.
Reconsider our hedging example from Chapter 1
in six months that range from $20 through $
varying from 0 through 100 (in increments o
your portfolio.
4.
For our mortgage example, suppose you know th
percent. Create a table that shows for amou
$600,000 (in $50,000 increments) the differ
20-year, and 30-year mortgage.
5.
Currently, you sell 40,000 units of a produ
producing the product is $5. You are thinkin
percent. You are sure this will increase sa
percent. Perform a sensitivity analysis to s
the percentage increase in sales. Ignore fx
6.
Let’s assume that at the end of each of the n
your retirement fund and earn the same inte
of money you will have at retirement change
from $5,000 through $25,000 and the rate of i
15 percent.
7.
The
payback period
for a project is the num
profts to pay back the project’s initial in
investment at Time 0. The project yields pr
between $30 million and $100 million. Annua
through 25 percent a year. How does the proj
flow and cash flow growth rates?
8.
A software development company is thinking o
Swahili. Currently, 200,000 units of the pr
each. Unit variable cost is $20. The fxed c
the product into Swahili will increase sale

136
Microsoft Excel 2010: Data Analysis and Business Modeling
unknown percentage over the current level of 2
proft resulting from the translation depends o
sales. You can ignore the time value of money a
9.
The fle Citydistances.xlsx gives latitude and l
is also a formula that determines the distanc
latitude and longitude. Create a table that c
cities listed.
10.
You have begun saving for your child’s colleg
year, and want to know for annual rates of re
through 12 percent the amount of money you wi
for 10–15 years.
11.
If you earn interest at percentage rate
r
per y
per year, then in
y
years $1 will grow to
(1+(
ny
dollars. Assuming a 10 p
annual interest rate, create a table showing th
years for daily, monthly, quarterly, and semia
12.
Assume I have $100 in the bank. Each year, I w
percent through 10 percent) of my original ba
percent through 10 percent per year, determin
run out of money. Hint: You should use the IF
because if my annual growth rate exceeds the w
money.
13.
If you earn interest at an annual rate of
x
p
become
n
(1+x)
dollars. For annual rates of interest f
determine the exact time (in years) in which $
14.
You are borrowing $200,000 and making payment
annual interest rate ranging from 5 percent th
10, 15, 20, 25, and 30 years, determine the t
15.
You are saving for your child’s college fund. Y
amount of money to the fund at the end of eac
$100,000. For annual investment returns rangi
and number of years investing varying from 5–
annual contribution.
16.
The fle Antitrustdata.xlsx gives the starting a
Determine the number of court cases active du
17.
You can retire at age 62 and receive $8,000 p
$10,000 per year. What is the difference (in t
as you vary the annual rate at which you disc
percent and vary age of death between 70 and 8

137
Chapter 18
The Goal Seek Comma
Questions answered in this chapter:
For a given price, how many glasses of lemo
per year to break even?
We want to pay off our mortgage in 15 years
bank told us we can afford monthly payments o
I always had trouble with “story problems” i
solving story problems easier?
The Goal Seek feature in Microsoft Excel 2010 e
worksheet input that makes the value of a give
example, in the lemonade store example in Chap
suppose you have fxed overhead costs, fxed per
this information, you can use Goal Seek to cal
need to sell to break even. Essentially, Goal S
worksheet
. To use Goal Seek, you need to provide E
Set Cell
Specifes that the cell contains the for
you’re seeking. In the lemonade example, th
proft.
To Value
Specifes the numerical value for the go
the lemonade example, because we want to de
the breakeven point, the To Value would be 0
By Changing
Specifes
Cell
the input cell that Excel c
calculates the goal defned in the To Value c
Changing Cell would contain annual lemonade s
Answers to This Chapter’s Ques
For a given price, how many glasses of lemonad
year to break even?
The work for this section is in the fle Lemona
Chapter 17, I’ve assumed an annual fxed cost o
Let’s assume a price of $3.00. The question is h
each year to break even.

138
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 18-1
We’ll use this data to set up the Goal Seek feature t
To start, insert any number for demand in cell D
tab, click Goal Seek. Now fll in the Goal Seek d
Fig
URE 18-2
The Goal Seek dialog box flled in with entries for a b
The dialog box indicates that I want to change c
(proft) hits a value of 0. After I click OK, I g
approximately 17,647 glasses of lemonade per yea
fnd the value I’m seeking, Excel varies the dema
low values) until it fnds a value that makes pro
solution, Goal Seek will still display only one a
We want to pay off our. The
mortgage
annual interest
15 years
. The rate i
bank told us we can afford . monthly
How muchpayments
can we borr
of $
You can begin to answer this question by setting u
payments on a 15-year loan (let’s assume payment
of the annual interest rate and a trial loan amo
Paymentgs.xlsx and in Figure 18-3.
In cell E6, the formula –PMT(annual_int_rate/12,
._borrowed)
computes th
payment associated with the amount borrowed, whi
Seek dialog box as shown in Figure 18-4 calculat
monthly payments equal to $2,000. With a limit o
borrow up to $237,007.03.

Chapter
The
18Goal Seek Command
139
Fig
URE 18-3
You can use data such as this with the Goal Seek f
borrow based on a set monthly payment.
Fig
URE 18-4
The Goal Seek dialog box set up to calculate the m
I always had trouble with “story
. Can
problems”
Excel make
in hs
story problems easier?
If you think back to high school algebra, most
variable (usually
) that
it solved
was called
particular
x
equati
solver, so it’s perfectly suited to solving st
problem:
Maria and Edmund have a lover’s quarrel while h
her Mazda Miata and drives 64 miles per hour t
hours after Maria leaves, Edmund jumps into hi
hour. How many miles will each person have trav
You can fnd the solution in the fle Maria.xlsx
Fig
URE 18-5
Goal Seek can help you solve story problems.
The Set Cell will be the difference between th
You can set this to a value of 0 by changing th
Edmund drives two hours less than Maria.

140
Microsoft Excel 2010: Data Analysis and Business Modeling
I entered a trial number of hours that Maria dri
names in the cell range C2:C8 with cells D2:D8. B
Maria, in cell D4 I entered
. the
In cells
formula
D6
Time_Mar
and D7, I u
fact that
distance=speed*time
to compute the tot
difference between the distances traveled by Edm
the formula
Maria_distance–Edmund_distance
. Now I can fll in the Goal S
shown in Figure 18-6.
Fig
URE 18-6
The Goal Seek dialog box flled in to solve an alge
I change Maria’s hours of driving (cell D2) unti
by Edmund and Maria (cell D8) equals 0. As you c
Edmund 8 hours, they will each have driven a dis
Problems
1.
From Problem 1 in Chapter 17, determine how m
break even.
2.
From the car net present value (NPV) example i
what rate do annual sales need to grow for tot
3.
What value of Year 1 unit cost would increase o
to $1 million?
4.
In our mortgage example, suppose I need to bo
maximum payments are limited to $2,000 per mo
can I tolerate?
5.
How could I use Goal Seek to determine a proj
6.
At the end of each of the next 40 years, I’m g
fund. What rate of return on my investments d
available for retirement in 40 years?
7.
I expect to earn 10 percent per year on my re
of the next 40 years, I want to put the
-
same a
folio. How much money do I need to put in eac
account when I retire?

Chapter
The
18Goal Seek Command
141
8.
Consider two projects with the following ca
Year 1Year 2Year 3Year 4
Project 1 –$1,000
$400
$350
$400
Project 2 –$900 $100
$100
$1,000
For what rate of interest will Project 1 ha
that makes both projects have the same NPV.)
9.
I am managing a conference at my college. M
10 speakers $700 each, and the college unio
and lodging costs. I am charging each confe
$900, which includes the conference fee and th
paid registrants need to attend for me to b
10.
I am buying 40 pounds of candy. Some of the c
sells for $6 per pound. How much candy at e
average cost of $7 per pound?
11.
Three electricians are wiring my new home. E
do the job. Electrician 2 by himself will
-
n
self will need 9 days to do the job. If all th
the job take to complete?
12.
To celebrate the Lewis and Clark Expedition
40 miles downstream in a canoe. The speed o
the trip takes me 5 hours total, how fast d
13.
In the NPV.xlsx fle in Chapter 8, “Evaluatin
Criteria,” we found that for high interest r
interest rates Project 2 has a larger NPV. F
have the same NPV?

143
Chapter 19
Using the Scenario M
Sensitivity Analysi
Question answered in this chapter:
I’d like to create best, worst, and most-lie
by varying the values of Year 1 sales, annu
tables for sensitivity analysis allow me to v
data table. Does Excel have a tool I can us
analysis?
You can use the Scenario Manager to perform se
input cells. With the Scenario Manager, you fr
vary. Next, you name your scenario and enter f
Finally, you select the output
) that cells
you want
(also
to cal
tr
Manager then creates a beautiful report contai
cells for each scenario.
Answer to This Chapter’s Quest
I’d like to create best, worst, and most-likel
varying the values of Year 1 sales, . annual
Data tabl
sal
for sensitivity analysis allow me to vary . only o
Does Excel have a tool I can use to vary more t
Suppose you want to create the following three s
(NPV) of a car, using the example in Chapter 1
Year 1 sales
Annual salesYear
growth
1 sales price
Best case$20,000 20%
$10.00
Most likely
$10,000
case 10%
$7.50
Worst case$5,000 2%
$5.00
For each scenario, you want to look at the frm
work is in the fle NPVauditscenario.xlsx. Figu
in the
Original Model
worksheet), and Figure 1
the
Scenario Summary
worksheet).

144
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 19-1
The data on which the scenarios are based.
Fig
URE 19-2
The scenario summary report.
To begin defning the best-case scenario, display th
Manager on the What-If Analysis menu in the Data T
and fll in the Add Scenario dialog box as shown i

Chapter
Using
19
the Scenario Manager
145
for Sensitivity Analysis
Fig
URE 19-3
Data inputs for the best-case scenario.
Enter a name for the scenario (Best), and sele
that defne the scenario. After you click OK in th
Values dialog box with the input values that d
Fig
URE 19-4
Defning the input values for the best-case scena
By clicking Add in the Scenario Values dialog b
and worst-case scenarios. After entering data f
Values dialog box. The Scenario Manager dialog b
I created. When you click Summary in the Scena
result cells that will be displayed in scenari
Scenario Summary dialog box that I want the sc
after-tax proft (cells B17:F17) as well as tot

146
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 19-5
The Scenario Manager dialog box displays each scen
Fig
URE 19-6
Use the Scenario Summary dialog box to select the r
Because the result cells come from more than one r
B19 with a comma. (I could also have used the Ctr
After selecting Scenario Summary (instead
- of the P
ates the beautiful Scenario Summary report pictu
includes a column, ,labeled
for the
Current
values
Values
that were ori
worksheet. The worst case loses money (a loss of $
proftable (a proft of $226,892.67). Because the wo
the worst case loses money in each year.
Remarks
The Scenario PivotTable Report option on the S
the scenario results in a PivotTable format.
Suppose you select a scenario in the Scenario M
Show button. The input cells’ values for
-
the s
sheet, and Excel recalculates all formulas. T
of your scenarios.

Chapter
Using
19
the Scenario Manager
147
for Sensitivity Analysis
It’s hard to create a lot of scenarios with th
to input each individual scenario’s values.
“Introduction to Monte Carlo Simulation”) m
Using the Monte Carlo simulation method, yo
probability that the NPV of a project’s
-
cas
sure because it is the probability that the p
Clicking the minus (–) sign in row 5 of the S
Assumption cells and show only results. Cli) s
report.
Suppose you send a fle to several people, a
After each person returns the fle containin
the scenarios into one workbook by opening e
clicking the Merge button in the Scenario
-
M
book, and then selecting the workbooks cont
Excel merges the selected scenarios in the o
Problems
1.
Delete the best-case scenario and run anoth
2.
Add a scenario ,named
in which
High
Year
Price
1 price equal
inputs remain at their most-likely values.
3.
For the lemonade stand example in Chapter 1, “
use the Scenario Manager to display a repor
scenarios:
Scenario
Price
Unit cost
Fixed cost
High cost/high $5.00
price
$1.00
$65,000.00
Medium cost/medium
$4.00price
$0.75
$45,000.00
Low cost/low price
$2.50
$0.40
$25,000.00
4.
For the mortgage payment example in Chapter 1
a report tabulating monthly payments for th
Scenario
Amount borrowed
Annual rate
Number of monthly
payments
Lowest payment
$300,000
4%
360
Most-likely $400,000
payment
6%
240
Highest payment
$550,000
8%
180

149
Chapter 20
The COUNTIF, COUNTI
COUNTA, and COUNTBL
Functions
Questions answered in this chapter:
Suppose I have a list of songs that were pl
singer, the date the song was played, and th
questions such as these about the songs in th
How many were sung by each singer?
How many were not sung by my favorite sin
How many were at least four minutes long?
How many were longer than the average len
How many were sung by singers whose last n
How many were sung by singers whose last n
How many were played after June 15, 2005?
How many were played before 2009?
How many were exactly four minutes long?
How many were sung by my favorite singer a
How many were sung by my favorite singer a
In a more general context, how do I perform op
Count the number of cells in a range contai
Count the number of blank cells in a range.
Count the number of nonblank cells in a ran
You often need to count the number of cells in a r
example, if a worksheet contains information a
the number of sales transactions made by the s
sales transactions that
COUNTIF
occurred
function
after June
lets
-
10
yo
ber of cells in a range that meet criteria tha
of the worksheet.

150
Microsoft Excel 2010: Data Analysis and Business Modeling
The syntax of the COUNTIF
range,criterion)
function
.
is
COUNTIF(
Range
is the range of cells in which you want t
Criterion
is a number, date, or expression th
in the range.
The syntax
COUNTIFS
of
COUNTIFS(range1,criterion1,range2,cri
is
.
COUNTIFS counts the number of rows for
, the
which the
range2
entry ,
meets
the
range_n
criterion2
entry
, and
meets
so on.
criterion
Thus,
COUNTIFS allows the criteria to involve more tha
column. Other functions that allow for multiple c
SUMIF, AVERAGEIF, SUMIFS, and AVERAGEIFS Functio
with Database Statistical Functions.”
The key to using the COUNTIF function
understanding
(and simil
the wide variety of criteria that Excel accepts. T
explained through the use of examples. In additi
provide examples of the COUNT, COUNTA, and COUNT
The COUNT function counts the number of cells i
The COUNTA function counts the number of nonb
The COUNTBLANK function counts the number of
As an illustration of how to use these functions
information for each song played on radio statio
The singer
The date the song was played
The length of the song
The fle Rock.xlsx, shown in Figure 20-1, shows a s

Chapter
The
20COUNTIF, COUNTIFS, COUNT, COUNTA,
151
and COUNTBLANK Functions
Fig
URE 20-1
The song database used for the COUNTIF examples.
Answers to This Chapter’s Ques
How many songs were sung by each singer?
To begin, I selected the frst row of the datab
whole database by pressing Ctrl+Shift+Down Arr
the Formulas tab, I clicked Create From Selecti
range D7:D957
, the
Song
range
Numb
,E7:E957
the range
Singer
, F7:F957
and the
Dat
ra
G7:G957 .
Minutes
To determine how many songs were sung by e
C5 to C6:C12 the formula
. In
COUNTIF(Singer,B5)
cell C5, this formula
-
n
ber of cells in the range
Singer
that match th
114 songs sung by Eminem. Similarly, Cher sang 1
Figure 20-2. I could have also found the numbe
COUNTIF(Singer,”Eminem”)
. Note that you must enclose text s
marks (“ “) and that criteria are not case sen
Fig
URE 20-2
Using COUNTIF to determine how many songs were s

152
Microsoft Excel 2010: Data Analysis and Business Modeling
How many songs were not sung by Eminem?
To solve this problem, you need to know that Exc
as “not equal to.” The formula
, entered
COUNTIF(Singer,”<
cell C15, te
that 837 songs in the database were not sung by E
need to enclose
<>Eminem
in quotation
<>
marks
)
beca
character combination as text and
Eminem
is, of c
result by using the formula
, which
COUNTIF(Singer,”<>”&B
uses
&
the
) symbol
ampersan
to concatenate the reference to cell B5 and the
Fig
URE 20-3
You can combine the COUNTIF function with the not-e
How many songs were at least four minutes long?
In cell C16, I computed the number of songs play
the formula
COUNTIF(Minutes,”>=4”)
. You need to enclose
>=4
in quot
the greater than
>=
) character
or equal combination,
to, (is treated
like
as text
<>
see that 477 songs lasted at least four minutes.
How many songs were longer than the average leng
To answer this question, I frst computed in cell G
formula
AVERAGE(Minutes)
. Then, in cell C17, I computed the n
longer than the average with the
. Iformula
can refer
COUNTIF
to a
cell (in this case G5) in the criteria by using th
longer than average, which matches the number of s
reason these numbers match is that I assumed the l
song to last at least 3.48 minutes, it has to la
How many songs were sung by singers whose last n
To answer this question, I used a wildcard chara
represents any sequence of characters. Thus, the f
picks up any song sung by a singer whose last na
sensitive.) Two hundred thirty-two songs were su
with S. This number is simply the total of the s
Spears
103+129=232
( ).

Chapter
The
20COUNTIF, COUNTIFS, COUNT, COUNTA,
153
and COUNTBLANK Functions
How many songs were sung by singers whose last n
In this example, I used the question mark (?) w
any character. Therefore, entering the formula
the number of songs sung by singers having six l
(Two singers have last names of six characters
sang a total
129+114=243
of 243
.)songs—
How many songs were played after June 15, 2005
The criteria you use with COUNTIF functions ha
serial number. (A later date is considered lar
COUNTIF(Date,”>6/15/2005”)
in cell C20 tells y
June 15, 2005.
How many songs were played before 2009?
Here, we want our criteria to pick up all date
in cell C21 the formula
COUNTIF(Date,”<=12/31/
. You can see that 951 s
turns out to be all the songs) were played bef
How many songs were exactly four minutes long?
In cell C22, I computed the number of songs la
COUNTIF(Minutes,4)
. This formula counts the number
- of c
ing a 4. As you can see, 247 songs lasted exac
shows that 230 songs lasted exactly fve minute
How many songs played were sung by Bruce Sprin
long?
We want to count each row where an entry in th
entry in the Minutes
. Sincecolumn
this question
is
4
involves m
is a job for the wonderful COUNTIFS function. S
=COUNTIFS(Singer,”Springsteen”,Minutes,4)
.
This formula counts any row in which
. Singer
Bruce
is
Springsteen sang 24 songs that were exactly fo
is “Thunder Road,” but that song is more than f
function wizard to input formulas involving th
can paste range names into your formula with th
How many songs played were sung by Madonna and w
Because we are dealing with multiple criteria,
C25 the formula
=COUNTIFS(Singer,”Madonna”,Min
in which Madonna sang a song that was from thr

154
Microsoft Excel 2010: Data Analysis and Business Modeling
the rows we want to count. It turns out that Mad
four minutes long. (My favorite one is “Crazy fo
How do I count the number of cells in a range co
The COUNT function counts the number of cells in a r
example, the formula
COUNT(B5:C14)
in cell C2 di
C5:C13) in the range B5:C14 contain numbers. (Se
How do I count the number of blank cells in a ra
The COUNTBLANK function counts the number of bla
formula
COUNTBLANK(B5:C14)
entered in cell C4 re
and C14) in the range B5:C14 contain blanks.
How do I count the number of nonblank cells in a r
The COUNTA function returns the number of nonbla
formula
COUNTA(B5:C14)
in cell C3 returns 18 bec
blank.
Remarks
In the remainder of the book I discuss alternati
or more criteria (such as how many Britney Spear
Database statistical functions are discussed i
Database Statistical Functions.”
Array formulas are discussed in Chapter 83, “
Problems
The following questions refer to the fle Rock.xl
1.
How many songs were not sung by Britney Spear
2.
How many songs were played before June 15, 20
3.
How many songs were played between June 1, 20
difference between two COUNTIF functions.
4.
How many songs were sung by singers whose las
5.
How many songs were sung by singers
?
whose nam
6.
Create a formula that always yields the numbe
TODAY() function.

Chapter
The
20COUNTIF, COUNTIFS, COUNT, COUNTA,
155
and COUNTBLANK Functions
7.
For the cell range D4:G15, count the cells c
number of blank cells. Count the number of n
8.
How many songs sung by Barry Manilow were p
9.
How many songs at least four minutes long a
2007 or earlier?
10.
How many songs exactly three minutes long a
later than 2004?
11.
The fle NBA.xlsx contains the following inf
Columns A and B contain the name of each N
each team. For example, Team 1 is Atlanta
Column C contains the home team for each g
Column D contains the visiting team for e
Column E contains points scored by the ho
Column F contains points scored by the vi
From this data, compute the number of games p
12.
The fle Matchthesecond.xlsx gives a list of n
than once. You need to determine the -row in w
rence of the name “Dave” occurs. Set -up a w
son’s name and a positive
) and returns
integer the
(such
rowasin
n
w
occurs th
fortime.
the
n
13.
The Numbers.xlsx
fle
contains a set of numbers.
between 1 and 12 inclusive.

157
Chapter 21
The SUMIF, AVERAGEI
AVERAGEIFS Function
Questions answered in this chapter:
I’m a sales manager for a makeup company an
transaction the following information: sale
total price received (or paid out for retur
What is the total dollar amount of mercha
How many units were returned?
What is the total dollar amount of sales i
How many units of lip gloss were sold? How m
bring in?
What is the total dollar amount of sales m
salesperson?
What is the average number of units sold i
salesperson?
What is the total dollar amount of lipsti
What is the average quantity (in units) o
salesperson?
Among transactions involving at least 50 u
lipstick in each sale made by a specifc s
Among transactions of more than $100, wha
sold by a specifc salesperson? What about t
If you want to sum all the entries in one colu
another column (or row), the SUMIF function ge
function
range,criterion,[sum
is
SUMIF(
.
range])
Range
is the range of cells that you want t
Criterion
is a number, date, or expression th
sum range is added.
Sum range
is the range of cells that are ad
be the same
.
as
range

158
Microsoft Excel 2010: Data Analysis and Business Modeling
The rules for criteria you can use with the SUMI
the COUNTIF function. For information about the C
COUNTIF, COUNTIFS, COUNT, COUNTA, and COUNTBLANK F
The AVERAGEIF function has the syntax.
AVERAGEIF(
AVERAGEIF averages the range of cells meeting a c
Microsoft Excel 2010 includes three functions (i
to flag rows that involve multiple criteria: COUNT
AVERAGEIFS. Other functions that you can use to d
are discussed in Chapter 45, “Summarizing Data w
functions (see Chapter 83, “Array Functions and F
calculations involving multiple criteria.
The syntax of SUMIFS is
SUMIFS(sumrange,range1,c
criterionN)
. SUMIFS sums up every entry in the
sumrang
range1
),
criterion2
),
(based
c
r
,
iterionNrange2
(based
) are on
all
rangeN
satisfed
similar fashion, the AVERAGEIFS function has the s
criterion1,range2,criterion2,…,rangeN,criterionN
. AVERAGEIFS averages every e
sumrange
for which
criterion1
),
criterion2
(based
),
(based
c
r
,
iterionN
range1
on
ran
(based on
) are
rangeN
all satisfed.
Answers to This Chapter’s Quest
What is the total dollar amount of merchandise s
The work for the problems in this chapter is in th
subset of the data.
Fig
URE 21-1
Data we’ll use for SUMIF examples.

Chapter
The
21SUMIF, AVERAGEIF, SUMIFS, and
159
AVERAGEIFS Functions
As usual, I begin by labeling the data in colu
in cells G4:L4. For example, the range name
Pr
compute the total amount sold by each salesper
B5 to B6:B13 the formula
. This
SUMIF(Name,A5,Dollars
formula adds up e
Dollars column that contains the name
Emilee
i
sold $25,258.87 worth of makeup. Of course, th
would yield the same result.
Fig
URE 21-2
Results of SUMIF computations.
How many units were returned?
In cell B16, the formula
SUMIF(Units,”<0”,Unit
column (column K). The result is –922. Inserti
shows that 922 units were returned. (Recall th
from a SUMIF function, Excel assumes
. Therefore,
that
sum
the
r
formula –SUMIF(Units,”<0”) would also yield 92
What is the total dollar amount of sales in or a
In cell B17, the formula
SUMIF(Date,”>=1/1/200
column (column L) that contains a date on or a
shows that $157,854.32 worth of makeup was sol
How many units of lip gloss were sold? How muc
In cell B18, the formula
SUMIF(Product,”lip gl
that contains the text
lip gloss
in the Produc

160
Microsoft Excel 2010: Data Analysis and Business Modeling
units of lip gloss were sold. This is the net sa
gloss were returned are counted as negative sale
In a similar fashion, in cell B19 the formula
SU
a net amount of $49,834.64 worth of lip gloss wa
associated with returns as negative revenue.
What is the total dollar amount of sales made by s
In cell B20, the formula
SUMIF(Name,”<>Jen”,Doll
transactions that do not have
Jen
in the Name co
Jen sold $211,786.51 worth of makeup.
What is the average number of units sold in each t
salesperson?
This is a job for the AVERAGEIF function. Enteri
=AVERAGEIF(Name,”Jen”,Units)
averages every entr
the Name column. Jen’s average transaction size wa
with the formula
=SUMIF(Name,”Jen”,Units)/COUNTI
.
What is the total dollar amount of lipstick sold b
This calculation
Name=”Jen”
involves two
andcriteria
Product=”lipstick
). Therefore,
(
you need to compute the quantity you’re looking f
=SUMIFS(Dollars,Name,”Jen”,Product,”lipstick”)
. The total dollar amount o
which Jen sold lipstick is $3,953.
What is the average quantity (in units) of lipst
This calculation requires the AVERAGEIFS functio
the formula
=AVERAGEIFS(Units,Name,”Zaret”,Produ
. For the sales tran
which Zaret sold lipstick, the average number of u
Among transactions involving at least 50 units, w
each sale made by Zaret?
Here again I used AVERAGEIFS, but I added a crit
transaction was at least 50. In cell B23, I ente
”Zaret”,Product,”lipstick”,Units,”>=50”)
. In all transactions in which Z
of lipstick, the average transaction size is 68 u
Among transactions of more than $100, what is th
Jen? What about transactions of less than $100?
Because the criteria
,
Product=lipstick
is
, and
Name=Jen
some statement about t
of each order, you need to use the SUMIFS functi

Chapter
The
21SUMIF, AVERAGEIF, SUMIFS, and
161
AVERAGEIFS Functions
in transactions in which Jen sold lipstick and th
formula
=SUMIFS(Dollars,Name,”Jen”,Product,”li
. Jen sold $3,5
worth of lipstick in such transactions. In lip
see in cell B25 (the formula is
=SUMIFS(Dollar
that the answer is $370. Note that
$370+$3,583
lipstick sales (computed in cell B21).
Problems
1.
For each product, determine the total numbe
2.
Determine the total revenue earned before D
3.
Determine the total units sold by salespeop
4.
Determine the total revenue earned by peopl
5.
How many units were sold by people other th
6.
How many units of makeup were sold from Jan
February 15, 2005?
7.
The fle NBA.xlsx contains the following inf
Columns A and B list the name of each NBA t
team. For example, team 1 is Atlanta, and s
Column C lists the home team for each gam
Column D lists the visiting team for each g
Column E lists points scored by the home t
Column F lists points scored by the visiti
From this data, compute for each team the a
per game and the average number of points th
8.
The fle Toysrus.xlsx contains sales revenue (
for the years 1997–2001 and the frst two qu
seasonal index
for each quarter of the year
quarter were 80 percent of the overall aver
have a seasonal index of 0.8.
9.
The fle Sumifrows.xlsx contains sales data d
fall quarters. Determine average sales duri
quarters.
10.
Again using the fle Makeup2007.xlsx, how muc
transactions involving at least 50 units of m

162
Microsoft Excel 2010: Data Analysis and Business Modeling
11.
How many units of lip gloss did Cici sell in 2
12.
What is the average number of units of founda
13.
What is the average dollar size of a foundati
2004?
14.
In transactions in which Ashley sold at least 4
amount?
15.
Create a table that contains sales of each pr
16.
Create a table that, when you enter a year in y
product by person during that year.
17.
For the fle Numbers.xlsx. fnd the total of al
18.
For the fle Numbers.xlsx fnd the average of a

163
Chapter 22
The OFFSET Function
Questions answered in this chapter:
How can I create a reference to a range of c
columns from a cell or another range of cel
How can I perform a lookup operation based o
range instead of the left-most column?
I often download software product sales inf
revenues from Iran as well as costs and uni
in the same location in the worksheet. Can I c
Iran’s revenues, costs, and units sold?
Each drug developed by my company goes thro
have a list of the cost by month for each d
each development stage. Can I create formul
cost incurred during each stage of developm
I run a small video store. In a worksheet, m
movie and the number of copies in stock. Un
in one cell for each movie. How can I extra
stock to a separate cell?
How does Excel’s Evaluate Formula feature w
How can I write a formula that always retur
How can I set up a range name that automati
I am charting my company’s monthly unit sal
recent month’s unit sales. I would like my c
way to accomplish this?
The OFFSET function is used to create a refere
rows and columns away from a cell or range of c
range of cells, you frst specify a reference c
columns away from the reference cell that you wa
using the OFFSET function, I can create a refe
three columns and begins two columns to the ri
can calculate the specifed number of rows and c
using other Excel functions.
The syntax of the OFFSET function is
OFFSET(re
moved,height,width)
.

164
Microsoft Excel 2010: Data Analysis and Business Modeling
Reference
is a cell or range of cells from whi
of cells, the cells must be adjacent to each oth
Rows moved
is the number of rows away from th
the range reference to start (the upper-left c
of rows moves you up from the reference; a po
For example, if
reference
equals C5 and
rows m
rows moved
equals +1, you move to row 6. If
r
Columns moved
is the number of columns away f
you want the range reference to start. A nega
from the reference; a positive number of colu
reference
equals C5 and
columns moved
equals –
moved
equals +1, you move to column D. If
colu
column C.
Height
and
width
are optional arguments that g
in the offset range. If
height
or
width
is omi
for which the value of
height
or
width
equals th
or range.
Answers to This Chapter’s Quest
How can I create a reference to a range of cells t
columns from a cell or another range of cells?
The fle Offsetexample.xlsx, shown in Figure 22-1
function in action.
Fig
URE 22-1
Using the OFFSET function.

Chapter
The
22OFFSET Function
165
For example, in cell B10, I entered the .formul
This formula begins in cell B7. It moves one r
brings us to cell C6. The formula now selects a r
which yields the range C6:C7. The SUM function a
2+6=8
. The other two examples shown in Figure 22
sections, I’ll show you how to apply the OFFSE
me by former students working at major U.S. co
How can I perform a lookup operation based on t
instead of the left-most column?
In Figure 22-2 (see the workbook Lefthandlooku
2003 Dallas Mavericks NBA basketball team and th
to fnd the player with a specifc feld goal per
using a VLOOKUP function. But
left-hand
what I lookup,”
really
-
waw
volves fnding the feld goal percentage for a p
can’t perform a left-hand lookup, but a left-h
and OFFSET functions.
Fig
URE 22-2
You can do a left-hand lookup by using the MATCH a
First, I enter the player’s name in cell D7. T
percentage column header) in the OFFSET functi
percentage, I need to move down to the row bel
This is a job for the MATCH function. The MATC
OFFSET(B7,MATCH(D7,$C$8:$C$22,0),0)
moves down t
player’s name and then moves over 0 columns. B
omitting the
height
and
width
arguments of the O
returned by this formula is also one cell. Thu

166
Microsoft Excel 2010: Data Analysis and Business Modeling
I often download software product. I
sales
need informat
to trac
revenues from Iran as well as costs and units so
the same location. Can
in the
I create
worksheet
a formula that wi
revenues, costs, and units sold?
The fle Asiansales.xlsx (see Figure 22-3) contai
variable cost for software sold to several countr
when you download the monthly fnancial reports, t
worksheet changes, so you need formulas that alwa
units sold, revenue, and variable cost.
Fig
URE 22-3
You can use the OFFSET function in calculations whe
in the same location in a worksheet.
By copying from D21 to E21:F21 the formula
OFFSE
you can compute the result you want. This- formul
tains the words
).
Country/Region
Then it moves over one column (
sold and down to the row containing the country l
D20 now refers to E20 and becomes a 2, so you mo
umn C to fnd revenue. In cell E21, the reference t
so you move three columns to the right of column C t
Each drug developed by my company goes. I
through
have
t
a list of the cost by month for each drug, and I a
opment stage took
. Can
forIeach
create
drug
formulas that comp
total cost incurred during each stage of develop
The fle Offsetcost.xlsx contains the monthly cos
each drug, the number of months required to comp
shown in Figure 22-4.

Chapter
The
22OFFSET Function
167
Fig
URE 22-4
Using the OFFSET function to compute development c
The goal is to determine for each drug the tot
phase. In cells D4:D6, I compute the total dev
compute Phase 1 costs for Drug 1 by using a ce
columns moved
equal to 0. Setting
height
equal t
width
equal to 1 captures all Phase 1 costs. I c
with the formula
SUM(OFFSET(D10,0,0,D1,1))
. Next, in cell D5, I comp
for Drug 1 by using the formula
. Note
SUM(OFFSET(D10
that I start w
reference of D10 (the frst month of costs) and m
length of Phase 1. This brings me to the begin
value in cell D2 ensures that I include all Ph
development costs for Drug 1 by using .the
In form
this
formula, I start from the frst month of sales a
the total time needed for Phases 1 and 2. This b
in cell D3, I total the number of rows
formulas
to capt
in D4:D6 to E4:H6, I can compute total costs f
example, for Drug 2, total Phase 1 costs equal $
Phase 3 costs equal $876.
I run a small
. In
video
a worksheet,
store
my accountant has l
movie and the number. Unfortunately,
of copies in stock
he combine
into one cell . for
How each
can Imovie
extract the number of c
stock to a separate cell?
The fle Movies.xlsx, shown in Figure 22-5, con
of copies in stock.

168
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 22-5
Movie example using the OFFSET function.
I want to extract the number of copies owned of e
of copies were listed to the left of a movie’s ti
the FIND function to locate the frst space and th
data to the left of the frst space. (See Chapter 6
use the LEFT and FIND functions, as well as othe
Unfortunately, this technique doesn’t work when th
the movie title. For a one-word movie title, for e
of the frst space, but for a four-word movie titl
fourth space.
One way to solve this problem is to click the Da
group, click Text To Columns to place each word i
separate columns. You can use the COUNTA functio
title, including the number of items as a word, f
function to locate the number of items.
To begin, insert enough columns to the
movies’
right of th
titles and the number of items to be extracted t
(
Raiders of the Lost Ark
requires six columns), a
the cell range C2:C12, and click Text To Columns o
Convert Text To Columns Wizard and use the space c
After selecting cell D2 as the destination cell, I h
of Figure 22-5.
Now I count the number of words in each movie’s c
word) by copying from A2 to A3:A12
. The results
the formula
are s
C
Figure 22-5.
Finally, copying from B2 to ,
B3:B12
I canthe
locate
formula
the n
O
copies of each movie in stock. This formula begi
title and moves over the number of columns equal t
Because the reference cell contains only one cel
of the OFFSET function so that the function uses o
number of copies) of the title cell.

Chapter
The
22OFFSET Function
169
How does Excel’s Evaluate Formula feature work
If you select any portion of a cell formula
createdan
by that portion of the formula. You must press E
debugging and understanding complex formulas
-
e
derstand what the OFFSET portion of the formul
the formulas in this chapter. For example, in th
Phase 1 cost with the formula
. If
=SUM(OFFSET(E10,
you move the cu
OFFSET(E10,0,0,E1,1),
highlight
,
and then
this
select
part F9,
of th
y
=SUM({135,120,58}),
which indicates that the O
the correct cells (D10:D12). Be sure you press
formula!
Another way to see how a complex formula works i
Move the cursor to E4 and click the Formulas t
group, click Evaluate Formula. (See Figure 22-
magnifying glass), and Excel simplifes the for
fnal result. After clicking Evaluate twice, th
know that in cell E4 you have selected the Pha
Fig
URE 22-6
Evaluate Formula dialog box.
How can I write a formula that always returns t
You often download new data into a worksheet. C
sales during
las most
therecent month? (See the fle Mos

170
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 22-7
Finding the last number in a column.
Simply enter in cell D4 the formula
OFFSET(B6,CO
This formula begins in cell B6 and moves down a n
numerical entries in column B. This takes you to th
selected because
1,1
returns only one cell.
How can I set up a range name that automatically i
Users of Excel often add rows or columns
create
of data t
a PivotTable or to perform another type of analy
of cells referred to in their formula and then r
dynamic range names and never have to update the r
PivotTable. The range will automatically update. H
The fle Dynamicrange.xlsx shows entries from an H
Fig
URE 22-8
Example of a dynamic range.
Currently, the data contains nine rows and four c
could create a range name that would automatical
when you add people or felds of information to th

Chapter
The
22OFFSET Function
171
To create a dynamic range, click the Formulas t
Name Manager. Then click New and defne a range a
Fig
URE 22-9
Creating a dynamic range.
The range starts in the upper-left corner: cel
cell A1. The selected range has
number of rows
number of columns=number
.
of
Thus,
nonblank
if you
entries
add pe
in r
felds, the formula will automatically expand t
so that the defned range will not shift if you m
To try this out, enter the formula
=SUM(data)
numbers in the range A1:D9 and yields $448,278
Now add to row 10,the
enter
name
in
Meredith
B10 a salary of $1
for Mistakes (add
), the
and word
in E10
Mistakes
enter 1,000. The f
includes the 10,000 and 1,000, and automatical
I am charting my company’s
. Eachmonthly Iunit
download
sales t
month’s unit
. I would
sales like my chart
. Is
to there
update
anauto
eas
accomplish this?
The workbook Chartdynamicrange.xlsx (see Figur
company’s product. As you can see, the units s
chart.

172
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 22-10
You can use the OFFSET function to update this cha
Beginning in row 19, you download new sales data
chart automatically includes the new data?
The key to updating the chart is to use the OFFS
for both the Months column and the Units
dynamic
Sold co
range for unit sales will automatically include a
months will include each month number. After cre
chart, replacing the data ranges used in the cha
updates as new data is entered.
To begin, click Defne Names on the Formulas tab o
dialog box. Create a range named
Units
by flling i
Fig
URE 22-11
Creating a dynamic range name for the units sold.
Entering
=OFFSET(‘dynamic range’!$C$3,0,0,COUNT(
dialog box creates a range one column wide begin
sales data point. The range will contain as many n
derived by the portion of the formula
. As
that
newreads
data
is entered into column C, the data is automatica

Chapter
The
22OFFSET Function
173
Next, create a dynamic range named Month for th
formula is shown in Figure 22-12.
Fig
URE 22-12
The formula used to defne a dynamic range named
Now go to the chart and click any point. In th
SERIES(‘dynamic range’!$C$2,’dynamic range’!$B
.
This formula is Excel’s version of the data or
the ranges $B$3:$B$18 and $C$3:$C18 with the d
SERIES(‘dynamic range’!$C$2,Chartdynamicrange.
Of course, if a blank space is listed above an
new data, and you’ll see that it is included i
Remarks
The Excel table feature makes it easy to set thi
automatically incorporate new data. See Chapte
Problems
1.
The fle C22p1.xlsx contains data about unit s
1999–2003. Write a formula using the MATCH a
the sales of a given product during a given y
this problem without using the MATCH and OFF

174
Microsoft Excel 2010: Data Analysis and Business Modeling
2.
A commonly suggested moving average trading r
moves above the average of the last
D
months a
below the average of the last
D
months. In Ch
for ,
D=15
this trading rule outperformed the Stan
amount. By combining a one-way data table with th
value of
D
that maximizes trading proft (excl
pertinent data in the fle Matradingrule.xlsx.
3.
A commonly suggested moving average trading r
moves above the average of the last
B
months a
the average of the last
S
months. In Chapter 1
that for
, this
B=S=15
trading rule outperformed
-
the S
stantial amount. By combining a two-way data t
mine the values of
B
and
S
that maximize trad
You’ll fnd data for this problem in the fle M
4.
The fle Lagged.xlsx contains data about the n
Army Recruiting during each of 60 consecutive
-month
m
lagged number of ads is defned to equal the n
months 7–60, you want to compute the 1-month l
6-month lagged values of the number of ads. U
compute these lagged values.
5.
The fle Verizondata.xlsx gives sales of four d
regions. Determine an effcient method to ente
combinations, the region, type of phone, and s
6.
This problem is a diffcult one. The fle Aging
claims projected to be received daily and the n
available. Each day, a worker can process up t
est claims in the system frst. Cells H6:AL6 c
system on January 1, before new claims arrive
of the claims. That is, for each day, how man
over 30-day old claims will be in the system.
7.
Each row of the fle Tapesales.xlsx contains m
formula to determine sales for each tape duri
8.
To obtain a golfer’s handicap, you average th
Then you subtract 80 and round to the nearest i
20 rounds adds up to 864, the handicap would b
golfer’s scores. Beginning in row 24, compute th
Assume that if the tenth best score in the la
all rounds including that score will be inclu
the Excel function
=ROUND(x,0)
will round
x
t

Chapter
The
22OFFSET Function
175
9.
Each row of the fle Carsumdata.xlsx contain
plane) from January thru July. Suppose you e
worksheet. Write a formula that gives the t
month.
10.
The fle Verizon.xlsx contains monthly retur
function to extract all the January returns t
one column, and so on.
11.
The fle Casesensitive.xlsx contains product c
product codes are case sensitive. For examp
dag32. Write a formula that gives the produ
Hint: You might need to use the EXACT functi
yields True if cell1 and cell2 have exactly th
between
uppercase and lowercase letters.
12.
The fle Reversed.xlsx contains a column of n
“reverse” the numbers so that the number on b
13.
The fle Diagonal.xls contains a matrix of n
elements of the matrix in a single column.
14.
The fle Yeartodate.xlsx contains a company’
2008–2014. Write a formula that returns for
cumulative sales to date. For example, if y
year, your formula should compute total sal
15.
Show how you might create a graph of monthly s
six months of sales.
16.
The fle Transactiondata.xlsx contains sales tr
a drug company. Use the OFFSET function to m
division appear in a single row.

177
Chapter 23
The INDIRECT Functi
Questions answered in this chapter:
My worksheet formulas often contain referen
change these references in my formulas, can I p
that I can easily change my cell or range r
formulas?
Each worksheet in a workbook lists monthly s
easy way to write and copy a formula that l
worksheet?
Suppose I total the values in the .
range
If I A5:
ins
a blank row somewhere between rows 5 and 10
to
SUM(A5:A11)
. How can I write a formula so that w
rows 5 and 10, my formula still totals the v
How can I use the INDIRECT function in a fo
a formula in a worksheet?
My workbook contains sales in each country f
can I easily pool this data in a single sum
The INDIRECT function is probably one of the m
master. Knowing how to use the INDIRECT functi
seemingly unsolvable problems. Essentially, an
portion of a formula results in the immediate e
content of the cell. To illustrate the use of I
which is shown in Figure 23-1.
Fig
URE 23-1
A simple example of the INDIRECT function.
In cell C4, I entered. the
Excel
formula
returns
=INDIRECT(A4)
the value 6 b
reference to A4 is immediately replaced by the t
as
=B4
, which yields the value 6. Similarly, e
returns the value in cell B5, which is 9.

178
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
My worksheet formulas often contain
. Rather
references
than t
change these references in my formulas, can I pl
that I can easily change my cell or
underlying
range refere
formulas?
In this example, the data we’ll use is contained i
Figure 23-2. The cell range B4:H16 lists monthly s
12-month period.
I currently calculate total sales of each produc
this calculation is to copy from.C18
Suppose,
to D18:H18
howevth
that you want to change which months are totaled
for months 3–12. You could change the formula in c
this formula to D18:H18, but using this approach i
the formula in C18 to D18:H18 and, without looki
rows are being added.
Fig
URE 23-2
You can use the INDIRECT function to change cell re
formulas themselves.
The INDIRECT function provides another approach. I p
and ending rows of our summation. Then, by using th
is change the starting and ending row references i
include the rows I want. Also, by looking at the v
which rows (months) are being added. All I need t
formula
SUM(INDIRECT(C$3&$D$2&’’:’’&C$3&$E$2))
.
If you want to see how Excel evaluates a referen
following trick. Click in part
) andofthen press
formula
F9.(fE
you the value of the selected portion of the for

Chapter
The
23INDIRECT Function
179
Be sure to press Esc to return to Excel. Every c
this formula is evaluated to equal the content
evaluated as 6, and
$E$2
is evaluated as- 16. W
enation symbol, Excel evaluates
, which
this formula
exactly wa
The formula in C18 returns
. Inthe
cell
value
D18,
38+91+…69
the for
as
SUM(D6:D16)
, which is the result you want. -Of cour
ing months 4 through 6, you simply enter 8 in D
returns
33+82+75=190
. (For information about using the a
see Chapter 6, “Text Functions.”)
Each worksheet in a workbook lists. Is
monthly
there sal
an e
way to write and copy a formula that lists eac
The fle Indirectmultisheet.xlsx (see Figure 23
worksheet, cell D1 contains data about the sal
Let’s suppose Sheet1 contains Month 1 sales, S
For example, sales in Month 1 equals 1, in Mon
Fig
URE 23-3
Monthly sales (Months 1–7) of a product listed b
Now suppose you want to compile a list of each m
tedious approach would be to list , Month
1 2
sale
sales with the ,
formula
and so
=Sheet2!D1
on, until you -list Mon
mula
=Sheet7!D1
. If you have 100 months of data, this a
much more elegant approach is to list Month 1 s
INDIRECT($C$10&D10&’’!D1’’)
. Excel
C$10
evaluates
as “Sheet”,
$
D10
as “
the text string “!D1”. The whole
, which,
formula
of is
cours
ev
Month 1 sales, located in cell D1 of Sheet1. C
the entries in cell D1 of Sheets 2 through 7. W
the reference to D10 changes to D11, and cell E
Suppose I total the values in the range
. If A5:A10
I inse w
a blank row somewhere between rows
automatically
5 and 10, mt

180
Microsoft Excel 2010: Data Analysis and Business Modeling
SUM(A5:A11)
. How can I write a formula so that when I i
and 10, my formula still totals the values in th
The worksheet named
SUM(A5A10)
in the fle Indire
illustrates several ways to total the numbers in
traditional formula
, which
SUM(A5:A10)
yields.
6+7+8+9+1+2=33
Similarly, the formula
SUM($A$5:$A$10)
in cell E
however, if you insert a row between rows 5 and 1
in the range A5:A11.
Fig
URE 23-4
Several ways to sum the values in the cell range A5
With the INDIRECT function, you have at least tw
A5:A10. In cell F9, I entered .the
Because
formula
Excel
SUM(IN
tre
INDIRECT(‘’A5:A10’’) ’
,as
ifthe
youtext
insert
string
a row
‘’
in th
formula still totals the entries in the cell ran
Another way to use the INDIRECT function to tota
formula
SUM(INDIRECT(‘’A’’&C4&’’:A’’&D4))
, which is the formula entere
treats the reference to C4 as a 5 and the refere
SUM(A5:A10)
. Inserting a blank row between row 5 and r
because the reference to C4 is still treated as a 5
a 10. In Figure 23-5, you can see the sums calcu
is inserted below row 7. You can fnd this data o
Indirectinsertrow.xlsx.
As you can see, the classic SUM formulas, which d
changed to add up the entries in the range A5:A1
The two SUM formulas that do use the INDIRECT fu
the range A5:A10, so the value of 2 (now in cell A
sum. The SUM formulas that use the INDIRECT func

Chapter
The
23INDIRECT Function
181
Fig
URE 23-5
Results of SUM formulas after inserting a blank r
How can I use the INDIRECT function in a formu
formula in a worksheet?
Suppose you have named several ranges in a wor
sales. (See Figure 23-6 and the fle Indirectra
Quarter1
) contains fctitious frst-quarter sales of v
Fig
URE 23-6
Use the INDIRECT function to create a reference t
It would be great to write a formula that can e
sales of each product in each quarter
worksheet,
in a sin
as shown in H17:J20. You would formula
think you could e
=VLOOKUP(H$16,$G17,2,FALSE)
and then copy this f
Unfortunately, Excel does not recognize $G17 a
Rather, Excel just thinks $G17 is the text str
returns an #NA error. To remedy this problem, s
=VLOOKUP(H$16,INDIRECT($G17),2,FALSE)
and then

182
Microsoft Excel 2010: Data Analysis and Business Modeling
works perfectly!
INDIRECT($G17)
is evaluated as Q
name. You have now easily generated sales of all p
My workbook contains sales in each country
. How
for e
can I easily pool this data in a single summary wo
Cells E7:E9 of the fle Indirectconsolidate.xlsx c
each continent. Each continent has its own works
single sheet?
In the worksheet Summary, I created the summary s
Fig
URE 23-7
Use the INDIRECT function to create a summary of pr
I copied from cell E7 to
INDIRECT(E$6&”!”&$C7)
the range. E7:I9
This formula
the for
creates the ,
formula
which calculates
=LA!E7
car sales in Lati
picks off the sales for each type of product on e
In the worksheet
Another Summary
(see Figure 23-
a slightly different manner. I automated the gen
which I pull car, truck, and plane sales by copy
ADDRESS(ROW(),COLUMN()+2)
. This generates column E in the c
8 and 9. The function ROW() entered in -a cell re
tion COLUMN() entered by itself in a cell return
this case 3). When entered as part of the third a
COLUMN()+2
effectively returns the column label f
current cell (in this case column E.) Then I cop
INDIRECT(E$6&”!”&$C7)
.
Fig
URE 23-8
Use the INDIRECT function to create a summary of p

Chapter
The
23INDIRECT Function
183
Problems
1.
The ADDRESS function yields the actual cell a
For example, the formula
ADDRESS(3,4)
yield
you entered the formula?
=INDIRECT(ADDRESS(3
2.
The workbook P23_2.xlsx contains data for th
(East, West, North, and South). Use the IND
enable you to easily calculate the total sa
numbered products, such as Products 1–3, Pr
3.
The fle P23_3.xlsx contains six worksheets. S
1–4. These sales are always listed in the r
effciently tabulate the sales of each produ
4.
Write a formula that will total the entries i
or more columns between columns G and K.
5.
The fle Marketbasketdata.xlsx contains sale
columns B through K indicates a purchased i
not purchased. In the Day Week column, a 1 m
a 2 means the transaction was on a Tuesday, a
calculate the percentage of transactions
calcu
-
in w
late the fraction of transactions taking pl
6.
The fle Verizonindirectdata.xlsx contains e
rating for January–May. Set up a consolidati
person and then reports that person’s hours o
or her overall rating for the month.

185
Chapter 24
Conditional Formatt
Questions answered in this chapter:
How can I visually indicate whether recent te
global warming?
How does the Highlight Cells conditional fo
How do I check or customize my rules?
How do data bars work?
How do color scales work?
How do icon sets work?
How can I color-code monthly stock returns s
one color and every bad month in another?
Given quarterly corporate revenues, how can I i
increased over the previous quarter in one c
decreased from the previous quarter in anoth
Given a list of dates, how can I indicate w
Our basketball coach has given each player a r
player’s ability to play guard, forward, or c
indicates the ability of each player to pla
What does the Stop If True option in the Man
Conditional formatting lets you specify format
contents of the cell range. For example,- given e
tional formatting to display in red the names o
90. Basically, when you set up conditions to f
checks each cell in the range to determine whe
as
exam
)
score>90
is satisfed. Then Excel applies the f
to all the cells that satisfy the condition. I
conditions, the formatting of the cell remains
-
u
ting was completely revised and expanded. Exce
conditional formatting. In this chapter, I show y
features in Excel 2010.

186
Microsoft Excel 2010: Data Analysis and Business Modeling
To view the conditional formatting options, frst s
Then, on the Home tab, in the Styles group, clic
Figure 24-1) to open a menu of conditional forma
Fig
URE 24-1
Conditional formatting command.
Fig
URE 24-2
Conditional formatting options.
Highlight Cells
allows
Rules
you to assign a format to ce
of the following criteria:
Are within a specifc numerical range
Match a specifc text string
Are within a specifc range of dates (relati
Occur more than once (or only once) in the s
Top/Bottom
allows
Rules
you to assign a format to any o
N
largest or smallest values in a range
Top or bottom
n
percent of numbers in a ran
Numbers above or below the average of all th
Data Bars, Color
con Scales,
Sets
allow you
and
to
i
easily identif
intermediate values in the selected range. La
numbers. With color scales you might, for exa
red and larger values in blue, with a smooth tr
increase from small to large. With icon sets, y
identify different ranges of values. For exam

Chapter
Conditional
24
Formatting
187
up to indicate a large value, pointing to th
pointing down to indicate a small value.
New Rule
allows you to create your own formula t
have a specifc format. For example, if a ce
could apply the color green to the cell. If th
you could apply the color red to the cell, a
Clear Rules
allows you to delete all conditional f
selected range or for the entire worksheet.
Manage Rules
allows you to view, edit, and delete
create new rules, or change the order in whi
rules you have set.
Answers to This Chapter’s Questi
How can I visually indicate whether recent tem
global warming?
This question offers a perfect opportunity for a
formatting rules. The fle Globalwarming.xlsx (
temperatures for the years 1856–2005. -
(I hid th
peratures are deviations from a base level of 1
occurred, you would expect the numbers in rece
in earlier years. To determine whether recent y
B3:B152 containing the temperatures. On the Ho
Conditional Formatting and then selected Top/B
and flled in the dialog box as shown in Figure 2
Fig
URE 24-3
Highlighting the ten highest temperatures in red
Not
C
e
licking the arrow shown on the right side of F
including Custom Format. Selecting this option dis
allows you to create a custom format that is appli
is satisfed.

188
Microsoft Excel 2010: Data Analysis and Business Modeling
Next I selected the range B3:B152 again and went b
I selected Bottom 10 Items and chose to highligh
can see in Figure 24-4 that the 10 highest tempe
the 10 lowest temperatures occurred before
-
1865. I
lighted the top 10 percent of the temperatures i
Finally,
column
in D I highlighted above-average tempera
temperatures in red. Note that all years earlier th
whereas all years from 1990 and later have had a
formatting is a powerful tool that can be used t
reasons) seems to have recently become warmer.
Fig
URE 24-4
Conditional formatting using Top/Bottom Rules.
How does the Highlights Cells conditional format
The fle Highlightcells.xlsx (see Figure 24-5) de
is used. For example, suppose you want to highli
Simply select the cell range C2:C11, click Condi
Home tab, click Highlight Cells Rules, click Dup
With Dark Red Text. Click OK to apply the rule s
(John and Josh) are highlighted in red.

Chapter
Conditional
24
Formatting
189
FigureUsing
24-5 the Highlight Cells Rules option.
Now suppose that you want to highlight in red a
text “Eric”. Simply select the cell range D2:D
Cells Rules, and then click Text That Contains
Red Fill With Dark Red Text on the right. As s
highlighted. (Erica, of course, contains the t
Suppose you have a list of dates (such as in E
contains yesterday’s date in green and any oth
the worksheet
Right Way
in the fle Highlightce
current date is September 24, 2010.
TODAY()–1
Note
, so
that c
cell E3 always display yesterday’s date. Cell E
I began by selecting the cell range I want to f
Occurring option and then selected the Yesterd
Text. Then I clicked Conditional Formatting, Hi
Occurring. In the A Date Occurring dialog box, t
Light Red Fill With Dark Red Text. Formatting r
created earlier (unless you change the order o
This explains why 9/23/2010 is formatted in re
How do I check or customize my rules?
After creating conditional formatting rules, y
Rules on the Conditional Formatting menu. For e
click Conditional Formatting, click Manage Rul
Figure 24-6. You can see that the Last 7 Days f
Yesterday
formatting rule.

190
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 24-6
Conditional Formatting Rules Manager dialog box.
In the Conditional Formatting Rules Manager dial
Create a rule by clicking the New Rule button
Edit or change a rule by clicking the Edit Ru
Delete a rule by selecting it and then clicki
Change the order of precedence by selecting a r
down arrow.
To illustrate the use of the Conditional Formatti
previous worksheet (simply right-click the
-
works
lect the Create A Copy check box) to the
Right W
I selected the Yesterday rule and clicked the up a
precedence than the Last 7 Days rule, so E3 will b
shows how the Conditional Formatting Rules Manag
shows that cell E3 is green and cell E4 is red a
Fig
URE 24-7
Now Yesterday has a higher priority than Last 7 day

Chapter
Conditional
24
Formatting
191
Fig
URE 24-8
After I change the precedence of rules, yesterda
How do data bars work?
When you have a long list of numbers, it’s nic
easily identify large and small numbers.
introduced
Data b
in Excel 2007) are perfect tools for displayin
Scalesiconsdatabars.xlsx illustrates the use o
Figure 24-9 shows the use of data bars. I bega
in D6:D15. I selected the data in D6:D15, clic
Data Bars. Next I selected blue data bars and c
format shown in column D of Figure 24-9. Cells c
blue bars. The default option is to associate th
in the selected range and the longest data bar w
column D, the size of the data bars is directl
bar for 4 is twice as large as the data bar fo
Fig
URE 24-9
Visually distinguishing numeric values by using d

192
Microsoft Excel 2010: Data Analysis and Business Modeling
If, after clicking Data Bars, you click More Rul
in Figure 24-10 is displayed. (You can also disp
and then clicking Edit Rule or by double-clickin
change the criteria used to assign the shortest a
assigned the shortest bar to the number 3 and th
Figure 24-9, all numbers in column E that are le
numbers that are greater than or equal to 8 have th
3 and 8 have graduated bars. Note that in the Ed
select the Show Bar Only check box to display on
conditionally formatted cells.
Fig
URE 24-10
Customizing your data bars.
Next, in column F, I chose to assign the shortes
the range F6:F15, and the longest bar to numbers i
numbers
<=1+.2(10–1)=2.8
have the shortest data b
have the longest data bar. Figure 24-9 shows tha
shortest data bar and the numbers 9 and 10 have th
In the cell range G6:G13, I associated the short
twentieth percentile of the data (1), and I asso
or above the ninetieth percentile of the data (9
whether your data bars begin at the right or lef

Chapter
Conditional
24
Formatting
193
Excel 2010 introduces solid shading for data b
associated with negative values so that they r
The fle Negativedatabars.xlsx and Figure 24-11 s
set containing negative numbers.
Fig
URE 24-11
Data bars for negative values with both solid an
How do color scales work?
Now let’s use color scales to summarize some d
a color scale uses cell shading to display the d
example of a three-color scale. (The fle Color
the use of a three-color scale. Note that I hi
76, right-click the selection, and then click
T-Bills, and T-Bonds in cells B8:D89. I then c
then More Rules to display the Edit Formatting R
Figure 24-13.
I chose the color red to indicate the lowest r
orange to indicate the return at the midpoint. A
color shading of each cell based on the value i
lowest return is shaded red. Note that 1931 an
for stocks. As the returns approach the fftieth p
yellow. Then, as the returns increase from the f
the cell color changes from yellow to green. M
with stocks because annual stock returns are m
variability causes large and small stock retur
returns for T-Bills or T-Bonds are yellow beca
investments means that intermediate returns oc

194
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 24-12
Three-color scales.
Fig
URE 24-13
Customizing a three-color scale.
I created some two-color scales in the fle Scale
I selected the range of cells and then clicked C
select the color combination you want from the g
More Rules.
I chose a two-color scale that indicates lower v
In the cell range D19:D28, I chose to make th
blue. As numbers increase, the cell shading b

Chapter
Conditional
24
Formatting
195
In the range E19:E28, I chose to make value
greater than or equal to 8 blue. For number
the cell shading becomes darker.
In the range F19:F28, I chose to make values i
white and numbers in the top 20 percent blu
cell shading becomes darker as numbers incr
In G19:G28, I chose to make values at or bel
and values at or above the eightieth percen
becomes darker as numbers increase.
Fig
URE 24-14
Two-color scales.
How do icon sets work?
You can also display numerical differences by u
Scalesiconsdatabars.xlsx.) An icon set consist
associate an icon with each value in a cell ra
for small numbers, an up arrow for large
-
numbe
ate values. The cell range E32:F41 contains tw
column, I used the red down arrow, the yellow h
Fig
URE 24-15
Using an icon set.

196
Microsoft Excel 2010: Data Analysis and Business Modeling
Here is how I assigned icons to a range of numer
After selecting the numbers in E32:E41, I cli
then clicked More Rules and chose the 3 Arrow
list. In column E, I want numbers less than 4 t
to 8 to display a horizontal arrow, and numbe
accomplish this goal, I set the options in th
in Figure 24-16.
In a similar fashion, I set up a formatting r
cells containing numbers in the
>=
80th
)
8
, and
percenti
down
arrows are placed in cells containing
values
numbers i
(
<=
)
1
. Figure 24-17 displays the needed formatti
Fig
URE 24-16
Assigning icons to numerical values.
Fig
URE 24-17
Assigning icons to percentile values.

Chapter
Conditional
24
Formatting
197
Optional settings include Reverse Icon Order, w
numbers and the icons on the right with larger n
the contents of the cell. In Excel 2010 -you ca
tomize icon sets. In the worksheet
Excel 2010 I
icons to summarize investment returns. The top thi
arrow, the bottom third of the returns contain a d
for the middle third of the returns. Figure 24
shows the dialog box (accessed from Manage Rul
customized the three gray arrow icon set by re
Fig
URE 24-18
Customized icon set with hidden icon.
Fig
URE 24-19
Dialog box for customizing and hiding icons.

198
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I color-code monthly stock returns so th
color, and every bad month in another?
The fle Sandp.xlsx, shown in Figure 24-20, contai
Standard & Poor’s stock index. Suppose that you wa
which the S&P index went up by more than 3 perce
which it went down more than 3 percent.
I began by moving to cell C10 (the frst month co
monthly returns by pressing Ctrl+Shift+Down Arrow
Manage Rules, New Rule, and selected Format Only C
dialog box as shown in Figure 24-21. I told Exce
>0.03 and, after clicking Format, I selected the f
Notice that the lists for fonts and font size ar
change these attributes. The Fill tab provides th
and the Borders tab lets you create a border for
After clicking OK in the Format Cells dialog box
dialog box. You can now select New Rule again, a
all cells containing numbers that are less than –
When you click OK, all months with an S&P return th
C23, for example) are displayed in green, and al
–3percent (see cell C18) are displayed in red. Ce
either of these conditions maintain their origin
Fig
URE 24-20
Conditional formatting highlights returns in the S

Chapter
Conditional
24
Formatting
199
Fig
URE 24-21
Applying special formatting to S&P returns great
Fig
URE 24-22
Coloring stock returns less than 3 percent in re
Here are some useful tips concerning condition
To delete conditional formatting (or any for
select the range of cells, click Conditiona
Clear Rules From Selected Cells.
To select all the cells in a worksheet to w
F5 to display the Go To dialog box. In the d
Formats, and then click OK.
If you want to edit a conditional formattin
double-click the rule or click Edit Rules.
You can delete a specifc conditional format
the rule, and then clicking Delete Rule.
Notice that after both rules are defned, the r
created more recently than the green formattin
Manager dialog box, rules are listed in order o
matter which rule is listed frst because no ce
conflict, however, the rule listed frst takes p
formatting rules, select the rule and click th
the down arrow to move the rule down in preced

200
Microsoft Excel 2010: Data Analysis and Business Modeling
Given quarterly corporate revenues, how- can I in
creased over the previous quarter in one color, a
from the previous quarter in another color?
The fle Amazon.xlsx contains quarterly revenues (
years 1995–2009. (See Figure 24-23.) We want to hi
increased over the previous quarter in green and hi
decreased over the previous quarter in red.
Fig
URE 24-23
Highlighting increased sales in green and decrease
The Use A Formula option in the Conditional Form
you to specify a formula that defnes conditions th
to a cell. I’ll use this option in this section, b
look at how Excel evaluates some logical functio
xlsx.
What happens when you type a formula such as
=B3
number smaller than 2, Excel returns the value T
You can refer to the fle Logicalexamples.xlsx, s
this, including combinations of AND, OR, and NOT i
In cell B6,
OR(B3<3,
the formula
C3>5)=
returns the value Tr
conditions
B3<3 or C3>5
is true. Because the v
returns True.
In cell B7,
AND(B3=3,C3>5)
the formula
=
returns
. True
Because
if
B3=3
i
not equal to 3, Excel returns False. In cell B
returns True because
B3>3
and
C3>5
are both tr
In cell B9,
NOT(B3<2)
the formula
returns
=
True because
B3<2
a not-false value becomes True.

Chapter
Conditional
24
Formatting
201
Fig
URE 24-24
Logical functions.
Now let’s look at how the Use A Formula
format
option a
in a range of cells. Begin by selecting
apply athe ra
conditional format. Then click Conditional For
Conditional Formatting Rules Manager dialog bo
A Formula To Determine Which Cells To Format o
the
formula
). To
option
use the formula option, you ente
with an equals sign) that is true if and only i
assigned the chosen format. Your logical formu
the remainder of the selected range, so judici
that for each cell of the selected range the f
format to apply to the cell. Click Format, and th
After clicking OK in the Conditional Formattin
copied to the whole cell range. The formatting i
that satisfes the condition defned in the form
Returning to the fle Amazon.xlsx, let’s focus o
revenues increase. Basically, what you want to d
quarter to which you can compare the revenue f
if a cell’s value is larger than the cell abov
how to set up the rule.
Fig
URE 24-25
Conditional formatting settings that will displa
increased.

202
Microsoft Excel 2010: Data Analysis and Business Modeling
If you enter
=E6>E5
by pointing to the appropria
from the formula in the Conditional Formatting d
Probably the easiest way to insert or delete
-
dol
light a cell reference such as A3, pressing F4 i
order: A3, $A$3, A$3, $A3. Thus, if you start wi
to A$3. The formula in this example ensures that c
in that quarter exceed the previous quarter. Aft
which revenue increased are colored green. Notic
was copied in the usual
.
way, becoming
=E7>E6
To add the condition for formatting cells in whi
again, open the Conditional Formatting Rules Man
select Use A Formula To Determine Which Cells To F
then click Format. On the Fill tab, change the fl
Conditional Formatting Rules Manager dialog box n
Fig
URE 24-26
These conditions will display quarters in which re
which revenue decreased in red.
You can use the formula option with color scales
option when setting the criteria for your color s
Given a list of dates, how can I indicate weeken
The fle Weekendformatting.xlsx (see Figure 24-27
all Saturdays and Sundays in red. To do this, I f
cell D6 to D7:D69. Choosing
Type=2
for the WEEKD
a 2 for each Tuesday, and so on, so that the fun
each Sunday.

Chapter
Conditional
24
Formatting
203
Fig
URE 24-27
Using the WEEKDAY function to highlight weekend d
I now select the range D6:D69, click Condition
Rules. After clicking New Rule and the formula o
Figure 24-28.
Fig
URE 24-28
The Edit Formatting Rule dialog box set up to di
After I click OK, each date having its weekday e
colored red. The formula
=OR(D6=6,D6=7)
implie
red font color. Of course, I could have used F
>5
to obtain the same formatting.

204
Microsoft Excel 2010: Data Analysis and Business Modeling
Our basketball coach has given each player a rat
player’s ability to play
. Can
guard,
I setforward,
up a worksheet
cent t
indicates the ability of each player to play the p
The fle Basketball.xlsx, shown in Figure 24-29, c
position and
1=Guard,
the position
2=Forward,
)( played
3=Center
by each player
here is to fll with red the cell containing the r
she’s assigned.
Fig
URE 24-29
This worksheet rates each player’s ability to play a p
Begin by selecting the range C3:E22, which contai
Formatting, Manage Rules. Then click New Rule, a
the dialog box as shown Figure 24-30.
Fig
URE 24-30
The Edit Formatting Rule dialog box set up to show p

Chapter
Conditional
24
Formatting
205
The formula
=$A3=C$1
compares the player’s ass
(1, 2, or 3) in row 1. If the player’s assigne
which is her guard rating, appears in red. Simi
her forward rating in column D appears in red. Fi
center rating in column E appears in red. Note th
the A and the 1 in the formula, it will not co
I also want to note that Excel 2010 allows con
reference data in other worksheets. In prior v
the worksheet where the format was placed.
What does the Stop If True option in t
Suppose that the Stop If True option is select
precedent rules are ignored. To illustrate the u
data bar format, but you don’t want data bars t
equal to 50. Simply use Manage Rules to add a f
only if the value
. Have
of
thecell
frstis
format
>=50
use an a
select Stop If True for that format. Now, for a
Excel will stop and not use the data bar forma
Problems
1.
Using the data in the fle Sandp.xlsx, use c
situations:
Format in bold each month in which the va
underline each month in which the value o
Highlight in green each month in which th
2 percent.
Highlight the largest S&P index value in r
2.
Using the data in the fle Toysrusformat.xls
revenue has increased over at least the las
revenues in blue and frst-quarter revenues i
3.
The fle Test.xlsx contains exam scores for s
A, the next 20 students receive a B, and al
A grades in red, the B grades in green, and th
LARGE(D4:D63,10)
gives you the tenth-highes
4.
In the fle Weekendformatting.xlsx, highligh
days that occur in the frst 10 days of the m

206
Microsoft Excel 2010: Data Analysis and Business Modeling
5.
Suppose each worker in Microsoft’s fnance dep
of four groups. The supervisor of each group h
and each worker has rated his satisfaction wi
Satissuper.xlsx.) Based on the group to which e
supervisor rating and the worker satisfaction r
6.
The fle Varianceanalysis.xlsx contains monthl
sales. The sales variance for a month equals:
predictedsales
actualsales – predictedsales
Highlight in red all months with a favorable v
highlight in green all months with an unfavor
7.
For our drug cost example from Chapter 22, “T
worksheet so that all Phase 1 costs are displ
in green, and all Phase 3 costs are displayed i
8.
The fle Names.xlsx contains a list of names. Hi
names containing
Ja
in red.
9.
The fle Duedates.xlsx contains due dates for v
invoices due by the end of the next month.
10.
In the fle Historicalinvest.xlsx, set up cond
10 percent of returns have an up arrow, 10 pe
have a horizontal arrow.
11.
The fle Nbasalaries.xlsx contains salaries of N
data bars to summarize this data. Players mak
shortest data bar, and players making more th
bar.
12.
Set up a three-color scale to summarize the N
bottom 10 percent of all salaries to green an
13.
Use fve icons to summarize the NBA player dat
million, $6 million, $9 million, and $12 mill
14.
How could you set things up so that no icons a
between $7 million and $8 million? Hint: Use th
15.
The fle Fractiondefective.xlsx contains the p
daily. A day’s production is considered accep
produced are defective. Highlight all accepta
worksheet, highlight all acceptable days with a r
option to ensure that no icon occurs in any c

Chapter
Conditional
24
Formatting
207
16.
Summarize global warming data with a three-
be blue, intermediate temperatures should b
should be red.
17.
Suppose you are saving for your child’s col
same amount of money to the fund at the end o
$100,000. For annual investment returns ran
number of years investing varying from 5 to 1
contribution. Suppose you are able to- save $
ting to highlight for each annual return ra
accumulate $100,000.
18.
The fle Amazon.xlsx contains quarterly reve
formatting to ensure that sales during each q
19.
Set up conditional formatting that colors th
alternating white and black coloring. Hint: T
a cell, and the COLUMN() function gives the c
20.
When students take Vivian’s accounting exam th
on a Scantron. Often they make a mistake. V
for the students in the class. She would li
entered by students that are not true alias
fle Scantrons.xlsx contains the necessary d
21.
The fle Top5.xlsx contains the revenues eac
highlight the companies that have the fve la
LARGE(B1:B50,5)
would return the ffth large
22.
The fle Threetimes.xlsx contains a list of n
appears at least three times.
23.
The fle GNP.xlsx contains quarterly U.S. gr
fact that data bars handle negative values t
growth rates.
24.
Using the data in the fle Globalwarmingtemp
temperatures) in which the temperature is a

209
Chapter 25
Sorting in Excel
Questions answered in this chapter
How can I sort sales transaction data so th
salesperson, then by product, then by units s
from oldest to most recent?
I have always wanted to sort my data based o
Excel 2010?
I love the great icon sets described in Cha
my data based on the icon in the cell?
My worksheet includes a column containing th
When I sort by this column, I get either Ap
(last month alphabetically) on top. How can I s
transactions are on top, followed by Februa
Can I sort data without using the Sort dial
Almost every user of Microsoft Excel has at on
alphabetically or by numerical value. Let’s lo
powerful sorting is in Excel 2010.
Answers to This Chapter’s Ques
How can I sort sales transaction data so that t
then by product, then by units sold, and finall
most recent?
JAC is a small company that sells makeup. The
xlsx fle in the Templates folder for this chap
transaction information:
Transaction number
Name of salesperson
Date of transaction
Product sold

210
Microsoft Excel 2010: Data Analysis and Business Modeling
Units sold
Dollars received
Location of transaction
Fig
URE 25-1
Sales transaction data before sorting.
I want to sort the data so that:
Transactions are listed alphabetically by sal
order so that all of Ashley’s transactions ar
Each person’s transactions are sorted by prod
will be followed by Ashley’s foundation trans
For each salesperson and product, transaction
descending order).
If a salesperson makes two or more sales of th
units, transactions are listed in chronologic
In versions of Excel before Excel 2007, it was d
Excel 2007 and Excel 2010 allow you to apply up t
data, I frst need
cell
to range
selectE3:K1894).
the data (Two easy wa
as follows:
Position the cursor in the upper-left corner o
Ctrl+Shift+Right Arrow followed by Ctrl+Shift+
Position the cursor anywhere in the cell rang

Chapter
Sorting
25
in
211
Excel
Next, on the Data tab, in the Sort & Filter gr
shown in Figure 25-2.
Fig
URE 25-2
Sort dialog box not yet flled in.
Because row 3 contains headings for the data c
check box. Now I select the following four cri
1.
Sort by the Name column so that values (thi
2.
Sort by the Product column so that values a
3.
Sort by the Units column so that values are
4.
Sort by the Date column so that values are i
newest.
The dialog box now looks like Figure 25-3.
Fig
URE 25-3
Sort dialog box set up for the sales sorting exa
The fnal result of our sort is shown in Figure 2

212
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 25-4
Sorted sales transaction data.
Note that all of Ashley’s transactions are liste
and so on. Eye liner transactions are listed fro
est. In the case of a tie (see rows 6 and 7), th
Using the Sort dialog box, you can easily
criteria
add so
(Delete Level), copy the settings that defne a l
whether your data has headers. By selecting Opti
sensitive or even sort data for which each data i
the more common situation in which each case is i
I have always wanted to sort my data
. Is this
basedpossib
on ce
Excel 2010?
In Excel 2010, sorting on cell or font color is s
Makeupsorttemp.xlsx fle. Several names in column F a
For example, Cici in cell F620 is highlighted in r
yellow. Suppose you want names with green fll on t
with the rest of the rows on the bottom. To sort th
range you want to sort (E3:K1894), click Sort, a
column, click the Sort On setting, and select Ce
color). For the frst level, select green from th
and select red for the third level. The -complete
sulting sort is shown in the
Colors
worksheet of th
Files folder for this chapter and shown in Figur

Chapter
Sorting
25
in
213
Excel
Fig
URE 25-5
Sort dialog box set up to sort by color.
Fig
URE 25-6
Results of sorting by color.
I love the great icon sets described
”. Can
in I
Chapte
sort m
data based on the icon in the cell?
To sort by icon, simply select Cell Icon from t
the Order list, choose the icon you want on to
My worksheet includes a column containing
.
the m
When I sort by this column, I get either April (
month alphabetically)
. How canon
I top
sort by this column s
are on top, followed by February, and so on?
The
Dates
worksheet in the Makeupsorttemp.xlsx fl
25-7.) I would like to sort the months- so that th
ning with January. I begin by selecting the ra
When selecting the order, I select Custom List a

214
Microsoft Excel 2010: Data Analysis and Business Modeling
January, February,
. Note that
March
you could also have sorte
completed dialog box is shown in Figure 25-8, wi
Note that in the Custom Lists dialog box you can c
select New List, under List Entries type the entr
click Add. Your new list is now included as a me
John, and Alan in List Entries (on different lin
would be listed frst, followed by John listings, w
Fig
URE 25-7
Months to be sorted.
Fig
URE 25-8
The Sort dialog box set up to sort by month.
Fig
URE 25-9
Months sorted in chronological order.

Chapter
Sorting
25
in
215
Excel
Can I sort data without using the Sort dialog b
Sometimes sorting data without using the Sort d
how this is done, suppose again that you want t
Makeup
worksheet in the Makeupsort.xlsx -fle so th
person, then by product, then by units sold, a
est to the most recent. To begin, select the l
the date column (G3:G1894). Next, in the Sort & Fi
To Z button (see Figure 25-10) and, with the E
so that all the columns are sorted. The Sort A T
smallest numbers or oldest dates are on top, a
Fig
URE 25-10
Sorting.
The Sort Z To A button, of course, sorts numer
recent dates are on top, and sorts text data s
Next, sort by the second least important colum
on top. Then sort from A to Z by Product, and fn
achieve the same results as shown in Figure 25
Problems
1.
In the Makeupsort.xlsx fle, sort the sales d
product type, then by name, then by date of s
2.
The Sortday.xlsx fle contains hours worked o
so that Monday data is followed by Tuesday d
3.
The Sorticons.xlsx fle contains annual inve
indicate good years, a horizontal arrow
-
use
row used to indicate bad years. Sort the da
arrows on top, followed by horizontal arrow
4.
The fle Makeupsortfont.xlsx contains our ma
blue, red, or brown font. Sort the data so th
dates, and then blue dates.

217
Chapter 26
Tables
Questions answered in this chapter:
I have entered in a worksheet the number of u
salesperson, and I can easily compute avera
create a nice format that is automatically c
easy way to automatically copy my formulas w
I have entered in my worksheet several year
line chart displaying the monthly variation i
add new gas price data, my chart automatica
For each sales transaction, I have the sale
the transaction. Can I easily summarize, fo
by Jen or Colleen?
How can I easily refer to portions of a tab
Do conditional formats automatically apply t
When most of us use Microsoft Excel, we often e
formulas, formats, and charts. What a drag! Now th
drudgery a thing of the past.
Answers to This Chapter’s Ques
I have entered in a worksheet the number of un
salesperson, and I can easily compute
. How average
can I
p
create a nice format that is automatically cop
way to automatically copy my formulas when new d
The fle Tableexampletemp.xlsx in the Templates f
contains units sold and revenue data for each o
will be added beginning in row 12. Also, in co
price
Units/Revenue
(
) earned by each salesperson. You
-
wou
mat for the data and have the formula for aver
data is added.

218
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 26-1
Data for creating a table.
Creating a table allows your analysis and format
add data. Begin by selecting the current range o
click Table on the Insert tab or press Ctrl+T. A
box, you will see that the table range (E5:G11) i
continue automatically whenever new data is ente
in a table, many styles and options are availabl
select a formatting style that will be applied a
Note that the column headings have arrows, as yo
work as flters that can be used to sort or flter th
chapter.)
Fig
URE 26-2
Table design options.
Fig
URE 26-3
Formatted table with flters.
The cells in the selected table (excluding
default.
the h
I changed the name to
Sales
in the Properties gr
Formulas tab and then click Name Manager, you ca
The beauty of this range name (and the table)
-
is th
clude new rows added to the bottom of the table a
table. In Chapter 22, “The OFFSET Function,” I u
range, but the new table capabilities make creati

Chapter
Tables
26
219
Suppose that in D15 you want to compute
.
total r
Excel
offers you the option to automatically comp
I implemented Autocomplete by double-clicking th
Autocomplete by moving the cursor to
Sales
and p
=SUM(Sales
and type an opening bracket ( [ ),
complete the formula with column headings from th
complete your formula as
=SUM(Sales[Revenue])
(See Figure 26-5.) (You will see an example of s
that begin with number signs (#) later in this c
Fig
URE 26-4
AutoComplete options for a table.
Fig
URE 26-5
Total revenue for original data.
If new rows of data are added, the data in the
formula. To illustrate this idea, you can add n
$5,000. As shown in Figure 26-6, the total rev
The formatting has been extended to row 12 as w
updated to include Amanda’s data. Even if data i
bottom), everything will be updated in a consi

220
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 26-6
New data added to table in row 12.
Now suppose that you want to compute in column H t
salesperson. Simply type
Unit Price
in H5 as the c
=SALES[
. In the AutoComplete list, click Revenue. T
Type a slash (/), and use Formula
formula
AutoComplete
as
t
=SALES[Revenue]}/Sales[Units].
An amazing thing h
the formula down to the bottom of the table in c
to any cell in column H, the formula appears as
=[@Revenue]/[@Units]
is a lot. easier
This formula
to understa
can b
interpreted as taking whatever is in the current r
by whatever is in the current row in the Units c
Fig
URE 26-7
Unit price formula autocopy.
If you click anywhere in a table, the Table Tool
offers choices including the following:
Change Table
Can
Name
be used to rename a table. I ch
(the default) to Sales.
Convert to
Converts
Range
the table range to normal c
structure.
Resize
Adds
Table
or subtracts rows and/or columns t
Remove Duplicates
Removes rows that contain duplicates
only the Name column in the Remove Duplicates d
not occur more than once. Checking both the N
no rows in the table will match both Name and Uni

Chapter
Tables
26
221
Header
If
Row
checked, displays the header row . I
displayed.
Total
I
Row
discuss the total row later in this c
First Column
If checked, applies a special format t
Last Column
If checked, assigns a special format t
Banded Rows
If checked, gives the even-numbered r
format than odd-numbered rows.
Banded Columns
If checked, gives odd-numbered colu
format than even-numbered columns.
Table Styles
Select from any of the table formats s
the table expands or contracts, the format w
I have entered in my worksheet several years o
line chart displaying the. Can
monthly
I setvariation
things upins p
add new gas price data, my chart automatically u
In the fle Gasprices507.xlsx, the worksheet
Or
feet from July 2002 through December 2004. (Se
you can select B5:C34 (containing months and p
this range. Then you can create a line graph t
group on the Insert tab and selecting the four
is shown in Figure 26-9.
Fig
URE 26-8
Gas price data: 2002–2004.

222
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 26-9
Gas price line graph: 2002–2004 data.
Next, I copied this worksheet (by right-clicking th
Sheet, and then clicking Make A Copy) and added g
now extends to row 53.) I named
. Note the
newline
workshee
grap
worksheet automatically updates to include the n
Fig
URE 26-10
Gas price line graph: 2002–2006 data.
This example illustrates that if you create a ta
data will automatically be included in the chart
For each sales transaction I have the salesperso
transaction
. Can I easily summarize, for example, tota
Jen or Colleen?
The fle Tablemakeuptemp.xlsx contains sales tran
transaction, I have the following information: t
location, dollars, and units sold. If I format t
Units and Dollars columns and then use the flter a
subset of transactions I want. To begin, place th
a table by pressing Ctrl+T. Note that if you scr

Chapter
Tables
26
223
visible. With the cursor in the table, select th
group on the Design tab. By default, Excel wil
in cell K1895, which you can delete. Click the a
and then click Sum. This totals all entries in c
the total revenue is $239,012.67, and 78,707 u
Tablemakeuptotals.xlsx.)
Fig
URE 26-11
Makeup sales data.
Fig
URE 26-12
Total revenue and units sold.
To make the totals reflect only lipstick sales i
the arrow in F3 (to the right of the Name head
are selected. Then select the check boxes for
Next, click the Product arrow and select the l
arrow and select the East check box. Use the s
Product column and only East in the location c

224
Microsoft Excel 2010: Data Analysis and Business Modeling
fltering criteria in Figure 26-14 and in the fle
and Jennifer sold 497 units of lipstick in the E
feature makes it a snap to easily compute totals f
If you want, you can also copy the rows involvin
and paste them elsewhere.
Fig
URE 26-13
Selecting names from the table.
Fig
URE 26-14
Filtered subtotals for units and revenue.

Chapter
Tables
26
225
How can I easily refer to portions of a table i
The fle Tablestructure.xlsx shows many example
when you are working outside the table’s range
references.
(See Figure 26-15.) When you enter a t
makes the column names and the following table s
Table Name
All cells in the table, excluding the h
#AlAl
ll cells in the table, including the tot
#Dat
A
a
ll cells in the table except for the fr
#Headers
Just the header row.
#Totals
Just the total row. If there is no tota
#This
All
Row
table entries in the current row.
A column reference includes all cells in a tab
entries (if any).
Here are some examples of how table specifers c
In cell C15, the formula
=COUNTA(Table1[All#
entries.
In cell C16, the formula
=COUNTA([Table1])
-
y
tal rows are not counted. In cell C17, the f
because the cell range D5:H13 is referenced
In cell C18, the formula
=COUNTA(Table1[#Hea
row (D4:H4) is referenced.
In cell C19,
SUM(Table1[Q1])
the formula = yields 367 becaus
entries in E5:E13.
In cell C20, the formula
=SUM(Table1[#Totals
yields 1,340, which is the total sum of all t
In cell C21, the formula
=SUM(Table1[[Data#]
are in columns Q1:Q3, inclusive (cells E5:G1
include all data entries between and includ
the column name after the colon.
In cell B8, the formula
=SUM(Table1[#This Ro
(
41+28+49+40
).
Of course, all of these formulas are automatic

226
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 26-15
Structured references.
Do conditional formats automatically apply to ne
Yes, conditional formats will automatically incl
illustrate, I placed in worksheet
Original
of fl
highlight the three largest Q1 sales in -column E
lighted. In worksheet
, I added
Add
in
Biggersale
cell E14 the entry 9
largest entry in the column and is immediately hi
because it is no longer one of the three largest n
Fig
URE 26-16
Conditional formatting extends automatically to ne

Chapter
Tables
26
227
Problems
1.
The fle Singers.xlsx contains a list of son
length of each song. Set up your worksheet t
sung by Eminem and the average length of ea
your formulas should automatically update.
2.
In the fle Tableexample.xlsx, set things up s
to total revenue and units sold is included i
included, your ranks should automatically u
the RANK.EQ function. The syntax of the
. RAN
This function yields the rank of a number i1 b
number.
3.
The fle Lookupdata.xlsx contains product co
that a product code can be entered and your w
Of course, when new products are introduced
4.
The fle Productlookup.xlsx contains the pro
up a formula that returns the sale of any p
products are added to the data, your formul
products.
5.
The fle Tablepie.xlsx contains sales inform
general store. You want to set up a pie char
product categories are added, the pie chart s
6.
The fle Tablexnpvdata.xlsx lists cash flows r
formula to compute (as of January 5,annual
2007) t
discount rate of 10 percent. Of course, if n
should automatically include them.
7.
The fle Nikedata.xlsx contains quarterly sa
sales that automatically includes new sales r
8.
For the data in fle Tablemakeuptemp.xlsx, d
gloss or lipstick sold by Jen or Ashley in th
9.
The fle Closest.xlsx contains people’s name
any number and fnds the person whose -salary i
sheet should accomplish this goal even if n
deleted from the list.
10.
The fle Adagency.xlsx contains salaries and a
a spreadsheet that will compute the average s
Of course, your calculations should automati
workers.

229
Chapter 27
Spin Buttons, Scrol
Buttons, Check Boxes
and Group List Boxes
Questions answered in this chapter:
I need to run a sensitivity analysis that h
sales growth, Year 1 price, and unit cost. I
and see the effect of the variation on the c
How do I set up a simple check box that tog
How can I set up my worksheet so that my su
choose whether we charge a high, low, or me
How can I create an easy way for a user of m
without having to type any text?
User forms enable a user of Microsoft Excel 20
to a worksheet. In this chapter, I show you how e
check boxes, option buttons, combo boxes, and l
Developer tab on the ribbon, click Insert in th
(not to be confused with ActiveX Controls, whi
Basic for Applications [VBA] programming langu
Not
T
e
o display the Developer tab, click the File ta
Ribbon, and then select Developer in the Main Tabs l
The user forms I discuss are shown in Figures 2
Controls.xlsx in the Practice fles folder for thi
Fig
URE 27-1
Spin button.

230
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 27-2
Scroll bar.
Fig
URE 27-3
Check box.
Fig
URE 27-4
Option button.
Fig
URE 27-5
Group box.
Fig
URE 27-6
Combo box.
Fig
URE 27-7
List box.
Answers to This Chapter’s Quest
I’ll begin by showing you how to use spin button
As I discussed in Chapter 19, “Using the Scenari
Scenario Manager lets you change a group of inpu
Unfortunately, the Scenario Manager requires you t
makes creating more than a few scenarios diffcul
four key inputs to the car net present value (NP
price, and Year1 cost. (See the fle NPVspinners.
the inputs change in the following ranges:

Chapter
Spin
27 Buttons, Scroll Bars, Option Buttons, Check
231
Boxes, Combo Boxes, and Group List Boxes
Input
Low value High value
Year 1 sales
$5,000
$30,000
Annual sales growth
0%
50%
Year 1 price
$6
$20
Year 1 cost
$2
$15
Using the Scenario Manager to generate the sce
the given ranges would be very ,
time-consuming.
however, a us B
quickly generate a host of scenarios that vary e
spin button is a control that is linked to a s
the spin button, the value of the linked cell c
(such as one that calculates a car’s NPV) chan
I need to run a sensitivity analysis that has m
sales growth, Year 1 price,
. Is there
and Year
way1Iunit
can co
qui
inputs and see the effect of the variation on t
example?
Here’s how to create spin buttons that allow y
price, and Year1 cost within the ranges you wa
NPVspinnerstemp.xlsx in the Templates folder) i
Fig
URE 27-8
The Original Model worksheet without any spin bu
To create the spin buttons, select the rows in w
rows 2–5 in this example), and then increase
-
th
lecting Format, Row, and then Height. A row he
the spin button arrows. Alternatively, hold dow
that it fts the cell.

232
Microsoft Excel 2010: Data Analysis and Business Modeling
Display the User Forms menu by clicking Insert i
Click the spin button form control (shown in Fig
to appear in your worksheet (cell D2). You will s
anchors the spin button where you want it and al
button. To change the shape of a form control or t
the control and hold down the Ctrl key. When the p
drag the control to move it. When the pointer ap
the control to resize it.
A spin button now appears in cell D2. You can us
Year1 sales. Right-click the spin button, and on th
D3, and then click Paste. Also paste the spin bu
four spin buttons as shown in Figure 27-9.
Fig
URE 27-09
Spin buttons placed in worksheet cells.
Now you need to link each spin button to an inpu
C2, right-click the spin button in cell D2, and th
Control dialog box as shown in Figure 27-10.
Fig
URE 27-10
Use the Format Control dialog box to link Year1 sa

Chapter
Spin
27 Buttons, Scroll Bars, Option Buttons, Check
233
Boxes, Combo Boxes, and Group List Boxes
The current value is not important. The rest o
linked to the values in cell C2 (Year1 sales), t
value in C2 by 1,000, and that each click on th
1,000. When the value in C2 reaches 30,000, cl
the value in C2 reaches 5,000, clicking the dow
Next, use the Format Control dialog box to lin
C4). For the current value, I used 9. The mini
the incremental change is 1. Clicking the spin b
between $6 and $20 in $1 increments.
To link the spin button in cell D5 to Year1 co
the minimum value, 15 for the maximum value, a
spin button arrows in cell D5 changes Year1 co
Linking the spin button in cell D3 to control
Sales gr
to change sales growth to 0 percent, 1 percent
-
mum increment a spin button value can change i
button to a dummy value in cell E3 and place th
E3 varies from 1 to 50, sales growth varies be
shows how to link this spin button to cell E3. R
the number in cell E3 divided by 100.
Fig
URE 27-11
The Format Control dialog box settings that link t
By clicking a spin button arrow, you can easil
the values for the other inputs listed in the w
effect of the changes, you can select cell F9, c

234
Microsoft Excel 2010: Data Analysis and Business Modeling
click Freeze Panes again. This command freezes th
You can now use the scroll bars on the right of th
Figure 27-12.
Fig
URE 27-12
You can freeze panes to see the results of calcula
Given the values of the other inputs, clicking th
a 1-percent increase in sales growth is worth ab
normal state, click Freeze Panes on the View men
The scroll bar control is very similar to the sp
the cursor over the gray area in the middle of th
continuously change in value. By selecting
-
Forma
ing the value under Page Change in the Format Co
speed with which the linked cell changes.
How do I set up a simple check box that toggles
A check box is a form control that specifes a va
and False when the box is clear. Check boxes can b
a particular feature on or off. As an example, I w
conditional formatting feature on or off.
Suppose a worksheet contains monthly sales and y
green and the fve smallest sales in red. (See th
formula
=LARGE(Sales,5),
which computes the ffth
compute the ffth-smallest sales .value
(See with
Figure
the27f

Chapter
Spin
27 Buttons, Scroll Bars, Option Buttons, Check
235
Boxes, Combo Boxes, and Group List Boxes
Fig
URE 27-13
Using a check box to turn conditional formatting o
Next, you create a check box and confgure it t
Developer tab, click Insert and select the che
palette. Drag the check box to cell G9, and ch
Off. Then right-click the check box, click For
Figure 27-14.
Fig
URE 27-14
The Format Control dialog box for a check box.
Now, whenever you select the check box, True i
check box, False is placed in cell F1.

236
Microsoft Excel 2010: Data Analysis and Business Modeling
After selecting the cell range D4:D29, click Con
Home tab, and then click New Rule. Enter the for
color the top fve sales green and the portion
bottom fve s
of the formula ensures that the formatting can b
check box determines whether cell F1 is True or F
cells will not turn green or red.
Fig
URE 27-15
Format to turn fve largest cells green.
Fig
URE 27-16
Format to turn fve smallest cells red.
If you want, you can select cell F1 and change th

Chapter
Spin
27 Buttons, Scroll Bars, Option Buttons, Check
237
Boxes, Combo Boxes, and Group List Boxes
How can I set up my worksheet so that my suppl
choose whether we charge a high, low, or mediu
Let’s suppose that you can charge one of three p
These prices are listed in cells B7:B9 of the fl
lookup table to print the price if a user type
however, if the user can select an option butt
Price, and then have a formula automatically c
To use option buttons, you frst draw a group b
control from the User Forms menu. Then you dra
group box. Because you have three price levels
the group box. Right-click any option button, a
link any one of the option buttons to a cell. I l
the option buttons in the group box are -now li
tion button will enter a 1 in cell E4, selecti
E4, and selecting the third option button will e
Entering the
INDEX(A7:A9,E4,1)
formula
=
in cell E7 returns
-
th
ing to the selected option
VLOOKUP(E7,A7:B9,2,FA
button. In cell F7, t
computes the price corresponding to the select
Fig
URE 27-17
Using option buttons to select product price.

238
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I create an easy way for a user of my sp
without having to type any text?
The fle Combobox.xlsx shows how to use a combo b
allow a user to easily
Data
select
validation
an itemalso
from
-
makes
lisi
ate drop-down boxes; see Chapter 40, “Validating Da
number of hours an employee worked on a given da
listed in cells G9:G15. A combo box or list box a
combo box or list box is linked to a cell (via F
box is selected, a 1 is placed in the linked cel
is entered in the linked cell, and so on. To set u
click Insert, and then drag a combo box from the F
B14.
Right-click the combo box and click Format Con
contains days of the week) and link cell A8. Now r
Control. Select the input range F9:F15 and link th
Tuesday from the combo box and Friday from the l
a 5 in A13.
In cell F3, the formula
=INDEX(F9:F15,A8,1)
list
combo box selection. In cell G3, the formula
=VL
number of hours worked for the day selected in th
formulas in F4 and G4 list the day of the week a
list box.
Fig
URE 27-18
Using combo boxes and list boxes.

Chapter
Spin
27 Buttons, Scroll Bars, Option Buttons, Check
239
Boxes, Combo Boxes, and Group List Boxes
Problems
1.
Add a spin button for the car NPV example th
between 30 percent and 50 percent.
2.
Add a spin button for the car NPV example th
between 5 percent and 20 percent.
3.
The Format Control dialog box allows a mini
you fgure out a way to use a spin button to v
and 20 percent?
4.
Using the lemonade example in Chapter 17, “S
create spin buttons that allow the inputs t
Input
Low value
High value
Price
$2.00
$5.00
Unit cost
$0.20
$1.00
Fixed cost
$20,000.00 $100,000.00
5.
Using the mortgage payment example in Chapt, c
inputs to vary within the following ranges:
Input
Low value
High value
Amount borrowed $270,000
$800,000
Number of months 120
of payments360
Annual interest rate
4%
10%
6.
For the weekend example used in Chapter 24, “
box that turns conditional formatting on or o
7.
In the fnancial formulas described in Chapt
used a last argument of 1 to indicate
- end o
ginning of month cash flows. Excel recognize
equivalent to 0. Set up a worksheet in whic
in a loan, principal, and annual interest r
check box to select whether the payments ar
8.
The fle Quarterly.xlsx contains quarterly s
option buttons to select the quarter and a l
worksheet should then compute sales at a sp

240
Microsoft Excel 2010: Data Analysis and Business Modeling
9.
Using the data for Problem 15 in Chapter 22, “
that lets you graph the last few months of sa
10.
The fle Suppliers.xlsx contains the unit pric
units purchased. Create a list box that allow
unit price and units purchased.

241
Chapter 28
An Introduction to O
with Excel Solver
In many situations, you want to fnd the best wa
to fnd the values of certain cells in a worksh
certain objective. The Microsoft Excel Solver h
the following:
How can a large drug company determine the m
plant that maximizes corporate proftability
If Microsoft produces Xbox consoles at thre
the cost of meeting demand for them?
What price for Xbox consoles and games will m
sales?
Microsoft would like to undertake 20 strate
skilled programmers for the next fve years. I
20 projects; which ones should it undertake
How do bookmakers fnd the best set of ratin
point spreads?
How should I allocate my retirement portfol
bonds, cash, and gold?
An optimization model has three parts: the tar
constraints. The
target cell
represents the ob
maximize the amount in the target cell. In the q
mix given earlier, the plant manager would pre
of the plant during each month. The cell that m
The target cells for each situation described a
Table 28-1.
Keep in mind, however, that in some situations y
example, Microsoft might have a secondary goal t

242
Microsoft Excel 2010: Data Analysis and Business Modeling
TABLE 28-1
List of Target Cells
Model
Maximize or Target
minimize
cell
Drug company product
Maximize
mix
Monthly proft
Xbox shipping
Minimize
Distribution costs
Xbox pricing
Maximize
Proft from Xbox consoles a
Microsoft project
Maximize
initiatives
Net present value (NPV) co
selected projects
NFL ratings
Minimize
Difference between scores p
ratings and actual game sc
Retirement portfolio
Minimize
Risk factor of portfolio
Changing cells
are the worksheet cells that you c
cell. In the drug company example, the plant man
each product during a month. The cells in
- which th
ing cells in this model. Table 28-2 lists
- the ap
els described at the beginning of the chapter, a
TABLE 28-2
List of Changing Cells
Model
Changing cells
Drug company product
Amount mix
of each product produced during t
Xbox shipping
Amount produced at each plant each mon
customer
Xbox pricing
Console and game prices
Microsoft program
Which
initiatives
projects are selected
NFL ratings
Team ratings
Retirement portfolio
Fraction of money invested in each ass
TABLE 28-3
List of Problem Constraints
Model
Constraints
Drug company product
Product mix uses no more resources tha
Do not produce more of a product than c
Xbox shipping
Do not ship more units eachcapacity
month from a p
Make sure that each customer receives t
consoles that they need
Xbox pricing
Prices can’t be too far out of line wi
Microsoft project
Projects
initiatives
selected can’t use more money o
than are available
NFL ratings
None
Retirement portfolio
Invest all our money somewhere (cash i
Obtain an expected return of at least 1

Chapter
An28
Introduction to Optimization
243
with Excel Solver
The best way to understand how to use Solver i
later chapters, you’ll learn how to use Solver t
this chapter as well as several other importan
To install Solver, click the File tab, click O
at the bottom of the dialog box, select Excel A
In check box in the Add-Ins dialog box, and cl
Solver by clicking Solver in the Analysis grou
Parameters dialog box. In the next few chapter
-
put the target cell, changing cells, and constr
Fig
URE 28-1
The Solver Parameters dialog box.
The Excel Solver has been greatly revamped and i
change is the presence of the Select A Solving M
appropriate solution engine for your optimizati
The Simplex LP engine is used to solve line
Chapters linear
29–32,optimization problem is
- one i
straints are all created by adding together
.
t
The GRG Nonlinear engine is used to solve o
cell and/or some of the constraints -
are not l
mon mathematical operations such as multipl
changing cells to a power, exponential or tr
so on. The GRG engine includes a powerful M
many problems that were solved incorrectly w
Chapters
33 through 35 discuss the GRG Non

244
Microsoft Excel 2010: Data Analysis and Business Modeling
The Evolutionary engine is used when your
-
tar
smooth functions that reference changing cell
slope abruptly changes. For example, when x = 0
abruptly changes from -1 to 1. If your Target c
COUNTIF, SUMIFS, COUNTIFS, AVERAGEIF, AVERAGEI
that reference the changing cells, then you a
Evolutionary engine probably has the best shot at f
optimization problem. The Evolutionary engine i
After you have input the target cell, changing c
answer this question, you need some background is
the changing cells that satisfes
feasible
solution
.the
Formodel’s
instance,
con
product mix that satisfes the following three col
Does not use more raw material or labor than i
Does not produce more of each product than is d
Does not produce a negative amount of any pro
Essentially, Solver searches all feasible soluti
cell value (the largest value for maximum
- optimi
tion). Such a solution. is
As called
you’ll an
see
optimal
in Chapter
solu
2
to Determine the Optimal Product Mix,” some Solv
some have a unique solution. Other Solver
-
models h
ber of) optimal solutions. In the next chapter, w
examining the drug company product mix problem.
Problems
For each situation described below, identify the t
1.
I am borrowing $100,000 for a 15-year mortgag
percent. How can I determine my monthly mortg
2.
How should an auto company allocate its adver
advertising formats?
3.
How should cities transport students to more d
4.
If a city has only one hospital, where should i
5.
How should a drug company allocate its sales f
6.
A drug company has $2 billion allocated to pu
companies should they buy?
7.
The tax rate charged to a drug company depend
produced. How can a drug company determine wh

245
Chapter 29
Using Solver to Det
Optimal Product Mix
Questions answered in this chapter:
How can I determine the monthly product mix th
Does a Solver model always have a solution?
What does it mean if a Solver model yields th
Answers to This Chapter’s Ques
How can I determine the monthly product mix th
Companies often need to determine the quantity o
basis. In its simplest form, the product mix p
of each product that should be produced during a m
must usually adhere to the following constrain
Product mix can’t use more resources than a
There is a limited demand for each product. Y
product during a month than demand dictates b
wasted (for example, a perishable drug).
Let’s now solve the following example of the p
solution to this problem in the
Feasible Solut
Figure 29-1.
Fig
URE 29-1
A feasible product mix.

246
Microsoft Excel 2010: Data Analysis and Business Modeling
Let’s say you work for a drug company that produ
Production of each product requires labor and raw m
hours of labor needed to produce a pound of each p
raw material needed to produce a pound of each p
of Product 1 requires six hours of labor and 3.2 p
price per pound is given in row 6, the unit cost p
contribution per pound is given in row 9. For ex
incurs a unit cost of $5.70 per pound, and contr
demand for each drug is given in row 8. For exam
This month, 4,500 hours of labor and 1,600 pound
this company maximize its monthly proft?
If you knew nothing about the Excel Solver, you mi
a worksheet to track proft and resource usage as
could use trial and error to vary the product mi
or raw material than is available, and without p
use Solver in this process only at the trial-and-
tion engine that flawlessly performs the trial-an
A key to solving the product mix problem is to e
proft associated with any given product mix. An i
this computation is the SUMPRODUCT function. The S
corresponding values in cell ranges and returns th
in a SUMPRODUCT evaluation must have the same di
use SUMPRODUCT with two rows or two columns but n
As an example of how you can use the SUMPRODUCT f
let’s try to compute resource usage. Labor usage i
(Labor used per pound of drug 1)*(Drug 1 pounds produced)+(Labor
*(Drug 2 pounds produced) + ...(Labor used per pound of drug 6)*(Drug
You could compute labor usage in a more tedious f
G4+H2*H4+I2*I4
. Similarly, raw material usage could be c
F5+G2*G5+H2*H5+I2*I5
. However, entering these formulas in a w
time-consuming. Imagine how long it would take i
produced, for example, 50 products at its plant.
material usage is to copy from D14 to D15
. This
the fo
formula computes
D2*D4+E2*E4+F2*F4+G2*G4+H2*H4+I

Chapter
Using
29
Solver to Determine the
247
Optimal Product Mix
is much easier to enter. Notice that I use the $
the formula I still capture the product mix fr
material usage.
In a similar fashion, proft is determined by th
(Drug 1 profit per pound)*(Drug 1 pounds produced) + (Drug 2 profit per
*(Drug 2 pounds produced) + ...(Drug 6 profit per pound)*(Drug
Proft is easily computed in cell D12 with
.
the f
You now can identify the three components of th
Target
The
cell
goal is to maximize proft (comput
Changing
The
cells
number of pounds produced of eac
range D2:I2)
Constraints
You have the following constraints:
Do not use more labor or raw material tha
D14:D15 (the resources used) must be less th
F14:F15 (the available resources).
Do not produce more of a drug than is in d
D2:I2 (pounds produced of each drug) must b
for each drug (listed in cells D8:I8).
You can’t produce a negative amount of an
I’ll show you how to enter the target cell, ch
you need to do is click the Solve button to fn
To begin, click the Data tab, and in the Analy
Not
A
e
s I explained in Chapter 28, “An Introduction t
installed by clicking the File tab, then Options, f
Add-ins and click Go. Select the Solver Add-In che
The Solver Parameters dialog box will appear, a

248
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 29-2
The Solver Parameters dialog box.
Click the Set Objective box, and then select the p
Variable Cells box, and then point to the range D
each drug. The dialog box should now look Figure 2
Fig
URE 29-3
The Solver Parameters dialog box with the target c
You’re now ready to add constraints to the model
Constraint dialog box, shown in Figure 29-4.

Chapter
Using
29
Solver to Determine the
249
Optimal Product Mix
Fig
URE 29-4
The Add Constraint dialog box.
To add the resource usage constraints, click th
D14:D15. Select <= from the middle list. Click th
range F14:F15. The Add Constraint dialog box s
Fig
URE 29-5
The Add Constraint dialog box with the resource u
You have now ensured that when Solver tries di
combinations that satisfy both D14<=F14 (labor u
and D15<=F15 (raw material used is less than
-
o
sidered. Click Add to enter the demand constrai
shown in Figure 29-6.
Fig
URE 29-6
The Add Constraint dialog box with the demand co
Adding these constraints ensures that when
-
Solv
ing cell values, only combinations that satisfr
D2<=D8 (the amount produced of Drug 1 is les
E2<=E8 (the amount produced of Drug 2 is les
F2<=F8 (the amount produced of Drug 3 is les
G2<=G8 (the amount produced of Drug 4 is les
H2<=H8 (the amount produced of Drug 5 is les
I2<=I8 (the amount produced of Drug 6 is les

250
Microsoft Excel 2010: Data Analysis and Business Modeling
Click OK in the Add Constraint dialog box. The S
Figure 29-7.
Fig
URE 29-7
The fnal Solver Parameters dialog box for the produ
Selecting the Make Unconstrained Variables Non-N
changing cells are forced to be greater than or e
Next choose Simplex LP from the Select A Solving M
engine because the product mix problem is a spec
model
. Essentially, a Solver model is linear under th
The target cell is computed by adding togethe
(changing cell)*(constant)
.
Each constraint satisfes the
linear model req
is evaluated by adding together the terms of th
comparing the sums to a constant.
Why is this Solver problem linear? Our target ce
(Drug 1 profit per pound)*(Drug 1 pounds produced) + (Drug 2 profit per
*(Drug 2 pounds produced) + ...(Drug 6 profit per pound)*(Drug
This computation follows a pattern in which the t
together terms of the form
.
(changing cell)*(cons

Chapter
Using
29
Solver to Determine the
251
Optimal Product Mix
Our labor constraint is evaluated by comparing th
pound of Drug 1)*(Drug 1 pounds produced) + (L
pounds
produced)+…(Labor used per pound of Drug 6)
available.
Therefore, the labor constraint is evaluated by a
(changing cell)*(constant)
and comparing the s
and the raw material constraint satisfy the li
The demand constraints take the form:
(Drug 1 produced)<=(Drug 1 Demand)
(Drug 2 produced)<=(Drug 2 Demand)
(Drug 6 produced)<=(Drug 6 Demand)
Each demand constraint also satisfes the linea
evaluated by adding together the terms of the f
the sums to a constant.
Knowing that the product mix model is a linear m
If a Solver model is linear and you select S
optimal solution to the Solver model. If a S
not fnd the optimal solution.
If a Solver model is linear and you select S
algorithm (the simplex method) to fnd the m
is linear and you do not select Simplex LP, S
GRG2 method) and might have diffculty fndin
After you click Solve, Solver calculates an op
model. As I stated in Chapter 28, an optimal s
set of changing cell values (pounds produced o
of all feasible solutions. Again, a feasible s
constraints. The changing cell values shown in Fi
production levels are non-negative, production l
usage does not exceed available resources.
Fig
URE 29-8
A feasible solution to the product mix problem f

252
Microsoft Excel 2010: Data Analysis and Business Modeling
The changing cell values shown in Figure 29-9 re
following reasons:
You produce more of Drug 5 than the demand fo
You use more labor than is available.
You use more raw material than is available.
Fig
URE 29-9
An infeasible solution to the product mix problem d
After you click Solve, Solver quickly fnds the o
need to select Keep Solver Solution to preserve th
Fig
URE 29-10
The optimal solution to the product mix problem.
Our drug company can maximize its monthly proft at a l
596.67 pounds of Drug 4, 1,084 pounds of Drug 5, a
determine whether you can achieve the maximum pr
can be sure of is that with your limited resourc
than $6,625.20 this month.
Does a Solver model always have a solution?
Suppose that demand for each product
must
be met
worksheet in the fle Prodmix.xlsx.) You then hav
D2:I2<=D8:I8 to D2:I2>=D8:I8. To do this, open S
then click Change. The Change Constraint dialog b

Chapter
Using
29
Solver to Determine the
253
Optimal Product Mix
Fig
URE 29-11
The Change Constraint dialog box.
Select >=, and then click OK. You’ve now ensur
values that meet all demands. When you click S
fnd a feasible solution.” This message does
-
not m
el, but rather that with limited resources, yo
simply telling you that if you want to meet de
labor, more raw materials, or more of both.
What does it mean if a Solver
Set Values
model Do
yields
Not Con
the r
Let’s see what happens if you allow unlimited d
negative quantities to be produced of each dru
Set Values Do Not Converge
worksheet in the fl
for this situation, open Solver and clear the
check box. In the Solver Parameters dialog box
and then click Delete to remove the constraint
-
sage “Set Cell Values Do Not Converge.” This m
maximized (as in this example), there are feas
values. (If the target cell is to be minimized
means there are feasible solutions with arbitr
byallowing negative production of a drug, you i
to produce arbitrarily large amounts of other d
allows you to make unlimited profts. In a real s
money. In short, if you see “Set Values Do Not C
Problems
1.
Suppose our drug company can purchase up to 50
than current labor costs. How can it maximi
2.
At a chip manufacturing plant, four technic
(Products 1, 2, and 3). This month, the chi
50 units of Product 2, and at most 50 units o
Products 1 and 3. Technician B can make only P
only Product 3. Technician D can make only P

254
Microsoft Excel 2010: Data Analysis and Business Modeling
products contribute the following proft: Prod
$10. The time (in hours) each technician need
Product
Technician
A
Technician
B
Technician
C
D
1
2
2.5
Cannot dC
oannot do
2
Cannot d3
o
Cannot d3
o.5
3
3
Cannot d4
o
Cannot do
Each technician can work up to 120 hours per m
maximize its monthly proft? Assume a fraction
3.
A computer manufacturing plant produces mice, k
The per-unit proft, per-unit labor usage, mon
usage are given in the following table:
Mice
KeyboardJ
soysticks
Proft/unit $8
$11
$9
Labor usage/unit
.2 hour .3 hour .24 hour
Machine time/unit
.04 hour .055 hour.04 hour
Monthly demand
15,000
29,000
11,000
Each month, a total of 13,000 labor hours and 3
available. How can the manufacturer maximize i
plant?
4.
Resolve our drug example assuming that a mini
drug must be met.
5.
Jason makes diamond bracelets, necklaces, and e
of 160 hours per month. He has 800 ounces of d
ounces of diamonds required to produce each p
each product is unlimited, how can Jason maxi
Product Unit profit
Labor hoursOunces
per unit
of diamonds
per unit
Bracelet$300
.35
1.2
Necklace$200
.15
.75
Earrings$100
.05
.5
6.
In our product mix example, suppose that when
any product you must give a $1 per pound disc
How does this change the answer to the proble

255
Chapter 30
Using Solver to Sch
Workforce
Question answered in this chapter:
How can I effciently schedule my workforce t
Many organizations (such as banks, restaurants
their labor requirements are at different time
effciently schedule their workforce. You can u
solve workforce scheduling problems.
Answers to This Chapter’s Ques
How can I efficiently schedule my workforce to m
Bank 24 processes checks seven days a week. Th
process checks is shown in row 14 of the fle B
example, 13 workers are needed on Tuesday, 15 w
so on. All bank employees work fve consecutive d
employees Bank 24 can have and still meet its l
Fig
URE 30-1
The data we’ll use to work through the bank work
You begin by identifying the target cell, chan
model.
Target
Minimize
cell
total number of employees.
Changing
Number
cells
of employees who start work (
days) each day of the week. Each changing c

256
Microsoft Excel 2010: Data Analysis and Business Modeling
Constraints
For each day of the week, the number of e
must be greater than or equal to
Number
the number
of
o
employees
)
>=
(
working
Needed employees
)
To set up the model for this problem,working
you need t
each day. I began by entering in the cell range A
employees who start their fve-day shift each day
that 1 employee begins work on Monday and works M
day’s required workers in the range C14:I14.
To track the number of employees working each da
range C5:I11. The value 1 indicates that the emp
designated in the cell’s row are working on the d
example, the 1 in cell G5 indicates that employe
working on Friday; the 0 in cell H5 indicates th
Monday are not working on Saturday.
By copying from C12 to
SUMPRODUCT($A$5:$A$11,C5:C11
D12:I12 the formula
, I compute
=
the number of employees working each day. For ex
to
A5+A8+A9+A10+A11
=
, which equals
(Number starting on Mo
Thursday)+(Number starting on Friday)+(Number st
Sunday)
. This total is indeed the number of people w
After computing the total number of
SUM(A5:A11)
employees
, I
in c
can enter a model in Solver as shown in Figure 3
Fig
URE 30-2
The Solver Parameters dialog box flled in to solve t

Chapter
Using
30
Solver to Schedule
257
Your Workforce
In the target cell (A3), I want to minimize th
C12:I12>=C14:I14
ensures that the number of em
as the number needed each day. The constraint
of employees beginning work each day is an int
in the Solver Parameters dialog box and flled i
Figure 30-3.
Fig
URE 30-3
This constraint defnes as an integer the number o
Note that this model is linear because
changing
the tar
cells, and the constraint is created by compar
the product of each changing cell times a cons
workers. Therefore I selected the Simplex
- LP e
ber of workers on a day, I checked the Make Un
After clicking Solve, I fnd the optimal soluti
A total of 20 employees is needed. One employe
four start on Thursday, one starts on Friday, t
Note that this model actually has multiple opti
the Solver again, you might very well fnd one o
Problems
1.
Suppose Bank 24 had 22 employees and that t
that they would have the maximum number of w
workers be scheduled?
2.
Suppose Bank 24 employees are paid $150 per d
work a day of overtime at a cost of $350. How s

258
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
The number of telephone reservation operators n
of day is as follows:
Time
Operators needed
Midnight–4 A.M.
12
4 A.M.–8 A.M.16
8 A.M.–Noon
22
Noon–4 P.M.
30
4 P.M.–8 P.M. 31
8 P.M.–Midnight
22
Each operator works one of the following six-
A.M.–noon, noon–6:00 P.M., 6:00 P.M.–midnight
operators needed?
4.
Shown in Figure 30-4 are the number of people i
watch various TV shows and the cost (in thous
ad on each show. For example, it costs
. $160,0
The show is watched by 6 million males betwee
between 36 and 55, 1 million males over 55, 9 mi
million females between 36 and 55, and
-
2 mill
cludes the number of people in each group (in mi
ad. For example, the advertiser wants at leas
its ads. What is the cheapest way to meet the
Fig
URE 30-4
Data for Problem 4.
5.
The Pine Valley Credit Union is trying to sch
8 A.M.– 6 P.M. and needs the following number o

Chapter
Using
30
Solver to Schedule
259
Your Workforce
NeededTime
4
8–9
8
9–10
6
10–11
4
11–12
9
12–1
8
1–2
5
2–3
4
3–4
4
4–5
5
5–6
Full-time tellers can work 8 A.M.–5 P.M. (w1 l
(with a 1 P.M.–2 P.M. lunch hour).
Part-time tellers work 10 A.M.–2 P.M. Full-ti
anp
dart-time tellers $60 per day. At most, fo
the credit union minimize their daily telle

261
Chapter 31
Using Solver to Sol
or Distribution Pro
Question answered in this chapter:
How can a drug company determine at which l
from which location it should ship drugs to c
Many companies manufacture products at )differe
and
ship their products to customers
). A natural
(often questi
called
the least expensive way to produce and ship pr
This type of problem is .
called
A transportation pro
up as a linear Solver model with the following s
Target
Minimize
cell
total production and shipping c
Changing
The
cells
amount produced at each supply p
demand point.
Constraints
The amount shipped from each supply p
Each demand point must receive its required d
non-negative.
Answer to This Chapter’s Quest
How can a drug company determine at which loca
which it should ship drugs to customers?
You can follow along with this problem by look
company produces a certain drug at its Los Ang
month, the Los Angeles plant can produce up to 1
produce up to 12,000 pounds, and New York
-
can p
pany must ship each month the number of pounds l
of the United States—East, Midwest, South,
-
and W
ample, the West region must receive at least 1
cost per pound of producing a drug at each pla
thceountry is given in cells B4:E6. For example
drug in Los Angeles and ship it to the Midwest r
region the quantity of the drug it needs?

262
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 31-1
Data for a transportation problem.
To express the target cell, you need to track tot
range B10:E12 trial values for shipments from ea
compute total shipping cost as follows:
(Amount sent from LA to East)*(Cost per pound of sending drug from
+(Amount sent from LAto Midwest)*(Cost per pound of sending drug
+(Amount sent from LA to South)*(Cost per pound of sending drug
+(Amount sent from LA to West)*(Cost per pound of sending drug
+...(Amount sent from New York City to West)
*(Cost per pound of sending drug from New York City to West)
The SUMPRODUCT function can multiply correspondi
rectangles (as long as the rectangles are the sa
I’ve named the cell range B4:E6
costs
. and the ch
Therefore, total shipping and production cost is c
SUMPRODUCT(costs,shipped)
.
To express the problem’s constraints,
supply
I frst com
point. By entering the formula
SUM(B10:E10)
in c
pounds shipped from Los Angeles as
(LA shipped t
(LA shipped to South)+(LA
. Copying
shipped
this formula
to West)
to F11:
total shipped from Atlanta and New York City. La
constraint
) that ensures that the amount shipped from e
plant’s capacity.
Next I compute the total received by each demand p
formula
SUM(B10:B12)
. This formula computes the total numb
East as
(Pounds shipped from LA to East)+(Pounds s
shipped from New
.
York
By copying
City to
this
East)
formula from B

Chapter
Using
31
Solver to Solve Transportation
263
or Distribution Problems
the pounds of the drug received by the Midwest
constraint (called
) that
demand
ensures
constraint
that each regi
the drug it requires.
Now I open the Solver Parameters dialog box (c
tab) and fll it in as shown in Figure 31-2.
Fig
URE 31-2
The Solver set up to solve our transportation pr
I want to minimize total shipping cost (comput
the number of pounds shipped from each plant t
amounts are listed in, the
consisting
range named
of cells
shipped
B10
F10:F12<=H10:H12 (the supply constraint) ensur
not exceed its capacity. The constraint B13:E1
that each region receives at least the amount o
This model is a linear Solver model because th
terms of the form
(changing cell)*(constant),
a
created by comparing the sum of changing cells t
I chose the Simplex LP engine. Clearly, shipme
Make Unconstrained Variables Non-Negative chec
After clicking Solve in the Solver Parameters d
solution shown earlier in Figure 31-1. The mini

264
Microsoft Excel 2010: Data Analysis and Business Modeling
$86,800. This minimum cost can be achieved if th
and shipping schedule:
Ship 10,000 pounds from Los Angeles to the We
Ship 3,000 pounds from Atlanta to the West re
to the Midwest region. Ship 6,000 pounds from A
Ship 9,000 pounds from New York City to the E
York City to the Midwest region.
Problems
1.
The following table gives the distances betwe
and Miami. Each city requires 40,000 kilowatt h
Dallas, and Miami are capable of producing 70
kWh over 100 miles costs $4. From where shoul
meeting each city’s demand?
Boston ChicagoDallas Los Angeles
Miami
Chicago
983
0
1205
2112
1390
Dallas1815
1205
0
801
1332
Miami 1539
1390
1332
2757
0
2.
Resolve this chapter’s example assuming that d
13,000.
3.
Your company produces and sells drugs at seve
where to produce goods for each sales
- locatio
ability. The model here is similar to the mod
drugs should be produced. Use the following a
You produce drugs at six locations and sell t
The tax rate and variable production cost d
is produced. For example, any units produce
produce; profts from these goods are taxed a
The sales price of each drug depends on whe
each product sold in Location 2 is sold for $
Production location
1
2
3
4
5
6
Sales price
$45 $40 $38 $36 $39 $34
Tax rate
31% 40% 20% 40% 35% 18%
Variable production
$8
$7 cost
$6
$9
$7
$7

Chapter
Using
31
Solver to Solve Transportation
265
or Distribution Problems
Each of the six plants can produce up to 6 mi
The annual demand (in millions) for your p
Sales location
1
2
3
4
5
6
Demand
1
2
3
4
5
6
The unit shipping cost depends on the pla
the location where the product is sold.
Sold S1old S2old S3old S4old S5old 6
Plant $13
$4
$5
$6
$7
$8
Plant $25
$2
$6
$9
$10
$11
Plant $34
$3
$1
$6
$8
$6
Plant $45
$5
$7
$2
$5
$5
Plant $6
5
$9
$6
$5
$3
$7
Plant $67
$7
$8
$9
$10
$4
For example, if you produce a unit at Plant 1 a
it.
How can you maximize after-tax proft with y
4.
Suppose that each day, northern, central, a
lion gallons of water. Also assume that nor
available 120 billion gallons of water, wher
of water available. The cost of shipping 1 b
regions is as follows:
NorthernCentral Southern
Northern
$5,000
$7,000
$10,000
Central
$7,000
$5,000
$6,000
Southern
$10,0000$6,000
$5,000
You will not be able to meet all demand for wa
of unmet demand incurs the following shorta
NorthernCentral Southern
Shortage cost/billion
gallons short
$6,000
$5,500
$9,000
How should California’s water be distribute
shortage costs?

267
Chapter 32
Using Solver for Ca
Question answered in this chapter:
How can a company use Solver to determine w
Each year, a company like Eli Lilly needs to d
like Microsoft, which software programs to dev
new consumer products to develop. The Solver i
make these decisions.
Answer to This Chapter’s Quest
How can a company use Solver to determine whic
Most corporations want to undertake projects th
(NPV), subject to limited resources (usually ca
opment company is trying to determine which of 2
The NPV (in millions of dollars) contributed by e
of dollars) and the number of programmers need
given on the
Basic Model
worksheet in the fle
example, Project 2 yields $908 million. It req
during Year 2, and $248 million during Year 3. P
Year 1, 86 programmers during Year 2, and 83 p
the capital (in millions of dollars) available d
indicate how many programmers are available. F
in capital and 900 programmers are available.
The company must decide whether it should unde
company can’t undertake a fraction of a softwa
allocated, for example, the company would have a n
$0 revenue!
The trick in modeling situations in which you e
binary changing
. A binary
cells
changing cell always equal
cell that corresponds to a project equals 1, y
corresponds to a project equals 0, you don’t d
of binary changing cells by adding a constrain
and then choose Bin from the list in the Add C

268
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 32-1
Data we will use with Solver to determine which pro
With this background, you’re ready to solve the s
always with a Solver model, you should begin by i
cells, and the constraints.
Target
Maximize
cell
the NPV generated by selected p
Changing
Look
cells
for a 0 or 1 binary changing cell f
these cells in the range A6:A25
). For (and
example,
nameda th
1 i
indicates that you undertake Project 1; a 0 i
Project 1.
Constraints
You need to ensure
t=1,
that
),
2,
for
Year
3
each
t
capital
Year
t
u
less than or equal to Year
t
capital availabl
to Year
t
labor available.
As you can see, the worksheet must compute for a
capital used annually, and the programmers used e
SUMPRODUCT(doit,NPV)
to compute the total NPV ge
range name
NPV
refers to the range C6:C25.)
-
For e
mula picks up the NPV of the project, and for ev
does not pick up the NPV of the project.- Therefo
ects, and the target cell is linear because it i
form
(changing
.
cell)*(constant)
In a similar fashion, I compute th
the labor used each year by copying from .E2 to F
I now fll in the Solver Parameters dialog box as s

Chapter
Using
32
Solver for Capital
269
Budgeting
Fig
URE 32-2
Solver Parameters dialog box set up for the proj
The goal is to maximize the NPV of selected pr
named)
doit
are the binary changing cells for each p
ensures that during each year the capital and l
and labor available. To add the constraint tha
the Solver Parameters dialog box and then sele
Constraint dialog box. The Add Constraint dial
The goal is to maximize the NPV of selected pr
named)
doit
are the binary changing cells for each p
ensures that during each year the capital and l
and labor available. To add the constraint tha
the Solver Parameters dialog box and then sele
Constraint dialog box. The Add Constraint dial
Fig
URE 32-3
Use the Bin option in the Add Constraint dialog b
that display either a 0 or a 1.

270
Microsoft Excel 2010: Data Analysis and Business Modeling
This model is linear because the target cell is c
form
(changing cell)*(constant)
and because the r
by comparing the sum of
(changing cells)*(consta
Simplex LP engine.
With the Solver Parameters dialog box flled in, I c
in Figure 32-1. The company can obtain a maximum N
choosing Projects 2, 3, 6–10, 14–16, 19, and 20.
Handling Other Constraints
Sometimes project selection models have other co
select Project 3, you must also select Project 4
Project 3 but not Project 4, this tells you that th
solve this problem, simply add the constraint th
than or equal to the binary changing cell for Pr
You can fnd this example on the
If 3 then 4
work
shown in Figure 32-4. Cell L9 refers to the bina
to the binary value related to Project 4. By add
Project 3, L9 equals 1 and this constraint force
constraint must also leave the binary value in th
you do not select Project 3. If you do not selec
allows the Project 4 binary to equal 0 or 1, whi
is shown in Figure 32-4.
Fig
URE 32-4
New optimal solution for
if not Project 3 then Proj

Chapter
Using
32
Solver for Capital
271
Budgeting
Now suppose that you can do only four projects f
At Most 4 Of P1–P10
worksheet, shown in Figure 3
of the binary values associated with Projects
.
1 th
Then add the constraint L8<=L10, which ensures th
selected. The new optimal solution is shown in Fi
billion.
Fig
URE 32-5
Optimal solution when only 4 of 10 projects can b
Solving Binary and Integer Progr
Linear Solver models in which some or all chan
integer are usually harder to solve than linea
to be fractions. For this reason, analysts are o
binary or integer programming problem. If your S
want to consider adjusting the Integer Optimal
Solver Options dialog box. Tolerance
(See Figure
setting
32-6.)ofF 0
that Solver will stop the frst time it fnds a f
theoretical optimal target cell value. (The th
target value found when the binary and integer c
faced with a choice between fnding an answer w
fnding an optimal solution in two weeks of com
value is 1%, which means that Solver stops whe
of the theoretical optimal target cell value. W
example, I had the Integer Optimality set to 5
9269. When I changed the Integer Optimality va
value (9293).

272
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 32-6
Adjusting the Integer Optimality option.
Problems
1.
A company has nine projects under considerati
the capital required by each project during th
table. (All numbers are in millions.) For exa
and require expenditures of $12 million durin
During Year 1, $50 million in capital is avai
during Year 2.
NPV
Year 1 expenditure
Year 2 expenditure
Project14
12
3
Project17
2
54
7
Project17
3
6
6
Project15
4
6
2
Project40
5
32
35
Project12
6
6
6
Project14
7
48
4
Project10
8
36
3
Project12
9
18
3
If you can’t undertake a fraction of a proj
none of a project, how can you maximize NPV

Chapter
Using
32
Solver for Capital
273
Budgeting
Suppose that if Project 4 is undertaken, P
you maximize NPV?
2.
A publishing company is trying to determine w
year. The fle Pressdata.xlsx gives the foll
Projected revenue and development costs (
Pages in each book
Whether the book is geared toward an audi
(indicated by a 1 in column E)
The company can publish books with a total o
publish at least four books geared toward s
maximize its proft?
3.
In the equation SEND + MORE = MONEY each le
0-9. Which digit is associated with each le
4.
Jill is trying to determine her class sched
of two seven-week half semesters. Jill
- must t
ter. There are fve time slots during each s
course twice. Jill has associated a value w
in the fle Classdata.xlsx. For example, cou
value of 5. Which courses should Jill take d
value from the semester’s courses?

275
Chapter 33
Using Solver for Fi
Questions answered in this chapter:
Can I use Solver to verify the accuracy of th
mortgage payments for a variable interest r
Can I use Solver to determine how much mone
The Solver feature in Microsoft Excel 2010 can b
planning problems. In many of these types of p
balance on a loan or the amount of money neede
example, consider a situation in which
noninterest
you bor
portion of each monthly payment reduces the un
following equation (which I’ll refer to as Equ
(Unpaid loan balance at end of period t)=(Unpaid loan balance at beginning of period t)
–[(Month t payment)–(Month t interest paid)]
Now suppose that you are saving for retirement
beginning of each period) (let’s
an amount
say of
periods
money eq
i
retirement account, and during the year, your r
areturn of some percentage. During retirement, y
of each year and your retirement fund still re
thfeollowingEquation
equation2)
( describes the relations
withdrawals, and return.
(Retirement savings at end of Year t+1) = (Retirement savings at end of Year t + retirement
contribution at beginning of Year t+1 – Year t+1 retirement withdrawal)
*(Investment return earned during Year t+1)
Combining basic relationships such as these wi
interesting fnancial planning problems.
Answers to This Chapter’s Ques
Can I use Solver to verify the accuracy of the E
mortgage payments for a variable interest rate
Recall that in Chapter 10, “More Excel Financia
(assuming payments occur at the end of a month
annual interest rate of 10 percent to be $1,03

276
Microsoft Excel 2010: Data Analysis and Business Modeling
our monthly payment? You’ll fnd the answer in th
Finmathsolver.xlsx, which is shown in Figure 33-
Fig
URE 33-1
Solver model for calculating the monthly payment fo
The key to this model is to use Equation 1 to tr
target cell is to minimize the monthly payment. T
The only constraint is that the ending balance i
I entered the beginning balance in cell B5. I en
I copied the monthly payment to the range C6:C14
occur at the end of each month, interest is incu
month. The monthly interest
) is
rate
computed
(I’ve in
named
D1 by
celd
the annual rate of 0.08 by 12. The interest paid e
cell D5 to D6:D14. the
Eachformula
month,
rate*B5
this formula comp
.006666*(month’s
.
beginning
By copying
balance)
the formula
(B5–(Pa
E5 to E6:E14, I use Equation 1 to compute each m
(Month t+1 beginning balance)=(Month
, each month’s
ending
beginnin
ba
computed by copying from cell
.
B6 to B7:B14 the f
I am now ready to use Solver to determine the mo
Solver Parameters dialog box, take a look at Fig
The goal is to minimize the monthly payment (cel
same as the target cell. The only constraint is th
equal 0. Adding this constraint ensures that the l
engine and select the non-negative variables opti
$1,037.03, which matches the amount calculated by th

Chapter
Using
33
Solver for Financial
277
Planning
Fig
URE 33-2
Solver Parameters dialog box set up to determine m
This model is linear because the target cell e
created by adding multiples of changing cells.
I should mention that when Solver models invol
the Solver sometimes thinks models that
are
li
is good practice to check the Use Automatic Sc
should ensure that Solver properly recognizes l
Can I use Solver to determine how much money I n
By using Equation 2 (shown earlier in the chap
money a person needs to save for retirement. H
I am planning for my retirement, and at the be
39 years, I’m going to contribute some money t
increase my retirement contribution by $500. W
(at the beginning of each year) $100,000 per y
assumptions about the yields for my retirement i
During the frst 20 years of my investing, t
During all other years, my investments will e

278
Microsoft Excel 2010: Data Analysis and Business Modeling
I’ve assumed that all contributions and withdrawa
these assumptions, what is the least amount of m
enough to make my retirement withdrawals?
You can fnd the solution to this question on the
xlsx, shown in Figure 33-3. Note that I’ve hidde
This worksheet simply tracks my retirement balan
year, I earn the indicated interest rate on the r
value for my Year 1 payment in cell C6. Copying th
ensures that the retirement contribution increas
40. I entered in column D the assumed return on m
years. In cells E46:E65, I entered the annual $1
Copying the formula
(B6+C6–E6)*(1+D6)
from F6 to F
year’s ending retirement account balance. Copyin
computes the beginning balance for years 2 throu
is 0. Note that the value 6.8704E-07 in cell F65 i
result of a rounding error.
Fig
URE 33-3
Retirement planning data that can be set up for ana
The Solver Parameters dialog box for this model i
my Year 1 contribution (cell C6). The changing c
ensure that I never run out of money during reti
so that the ending balance for Years 41 through 6

Chapter
Using
33
Solver for Financial
279
Planning
Fig
URE 33-4
Solver Parameters dialog box set up for the reti
After choosing the Simplex LP engine and selec
Non-Negative option in the Solver Parameters d
Parameters dialog box and fnd that the frst ye
This model is linear because the target cell e
ic
sreated by adding multiples of changing cells
investments is not the same each year, there i
solve this problem. Solver provides a general f
planning problems when mortgage rates or inves
Problems
1.
I am borrowing $15,000 to buy a new car. I a
payments. The annual interest rate on the l
of mine, and he will allow me to make the mo
equal to one-half the payment for Months 31 th
each month?
2.
Solve the retirement planning problem assumi
each year and contributions occur at the be
3.
Solve our mortgage example assuming that pa
each month.

280
Microsoft Excel 2010: Data Analysis and Business Modeling
4.
In the retirement-planning example, suppose th
and your salary increases 5 percent per year u
same percentage of your salary each year you w
should you save?
5.
In the mortgage example, suppose that you wan
$50 each month. What should each month’s paym
6.
Assume you want to take out a $300,000 loan o
month payments. The annual rate of interest i
need to make an ending balloon payment
-
of $40
come to increase, you want to structure the l
your monthly payments increase by 2 percent. D
monthly payment.
7.
Blair’s mother is saving for Blair’s college e
made at the indicated times:
4 years from
5 years
now from
6 years
now
from
7 years
now
from now
$24,000
$26,000
$28,000
$30,000
The following investments are available:
Today, one year from now, two years from now
years from now, she can invest money for on
return.
Today, 2 years from now, and 4 years from n
years and receive a 14 percent return.
Three years from now she can invest money f
percent return.
Today she can invest money for seven years a
What is the minimum amount that Blair’s mothe
college education that ensures she can pay he
8.
I owe $10,000 on one credit card that charges 1
on another credit card that charges 12 percen
is based on the month’s beginning balance. I c
$2,000 per month and the minimum monthly paym
the card’s unpaid balance at the beginning of th
cards in two years. What is the minimum amoun

281
Chapter 34
Using Solver to Rat
Question answered in this chapter:
Can I use Excel to set NFL point spreads?
Many of us follow basketball, football, hockey
on games in all these sports and others. For e
the Indianapolis Colts would win the 2010 Supe
Saints won the game. In this chapter, I’ll show th
were the better team and should have been favo
accurately estimate the relative ability of NF
Using a simple Solver model, you can generate r
the scores of the 2009 season. The work is in fl
You simply use the score of each game of the 2
cell for the Solver model is a rating for each t
For example, if the Indianapolis Colts have a r
of +7, the Jets are considered two points bett
With regard to the home-feld edge, in most yea
as well as professional basketball teams, tend t
home college basketball teams tend to win
- by a
ever, I will defne the home edge as a changing c
edge. You can defne the outcome of an NFL game t
the home team outscores the visitors and predi
following equation (which I’ll refer to as Equ
(Predicted points by which home team outscores v
(Away Team rating)
For example, if the home feld edge equals thre
Colts will be a
3+5–7
one-point
). If thefavorite
Jets host
(
the Colt
point favorite
3+7-5
). (The Tampa Bay-New England game wa
no home edge for this game.)
What target cell will yield reliable ratings? T
ratings and home-feld advantage that best pred
you want the prediction for each game to be as c
game. This suggests that you want to minimize th
(Predicted
. However,
outcome)
the problem with using
-
thi
tive prediction errors cancel each other out. F

282
Microsoft Excel 2010: Data Analysis and Business Modeling
margin by 50 points in one game and under predic
another game, the target cell would yield a valu
fact you were off by 50 points a game. You can r
over all games by using the formula
[(Actual Out
2
. Now positive
and negative errors will not cancel each other o
Answer to This Chapter’s Questi
Can I use Excel to set NFL point spreads?
Let’s now see how to determine accurate ratings f
2009 regular season. You can fnd the data for thi
which is shown in Figure 34-1.
Fig
URE 34-1
Data rating NFL teams that we’ll use with Solver.
To begin, I placed a trial home-feld advantage v
Starting in row 5, columns E and F contain the h
example, the frst game (listed in row 5) is Tenn
contains the home team’s score, and column H con
see, the Steelers beat the Titans 13-10. I can n
number of points by which the home team beats th
=G
H5
in cell I5. By pointing to the lower-right p
left mouse button, you can copy this formula dow
appears in row 260. (By the way, an easy way to s
Arrow. This key combination takes you to the las
In column J, I use Equation 1 to generate the pr
the frst game is computed in cell J5 as follows:
=$B$8+VLOOKUP(E5,$B$12:$C$43,2,FALSE)-VLOOKUP(F5

Chapter
Using
34
Solver to Rate
283
Sports Teams
This formula creates a prediction for the frst ga
home-team rating and then subtracting the visi
Ideleted the term $B$8 from the formula becaus
England-Tampa Bay game.) The term VLOOKUP(E5,$
home-team rating, and VLOOKUP(F5,$B$12:$C$43,2,
rating. (For more information about using look
Functions.”). In column K,
actual
I compute
score–predicted
)
2
the
for
squar
s
each game. Our squared error for the frst game i
= (I5-J5)^2.
After selecting the cell range I5
down to row 260.
Next I compute the target cell in cell K3 by s
SUM(J5:J260)
.
Ti
Y
p
ou can enter a formula for a large column of nu
then selecting the frst cell in the range you want t
to enter the range from the cell you selected to t
closing parenthesis.
It is convenient to make the average team rati
better than average and a team with a negative r
average team rating in cell C10
. with the formu
I can now fll in the Solver Parameters dialog b
Fig
URE 34-2
Solver Parameters dialog box set up for NFL rati

284
Microsoft Excel 2010: Data Analysis and Business Modeling
I minimize the sum of the squared prediction err
changing each team’s rating (listed in cells C12
constraint
C10=0
ensures that the average team r
that the home team has an advantage of 2.26 poin
rated teams are shown in Figure 34-3. Remember th
are computed by Solver. In the template fle, you c
and Solver will still fnd the “best” ratings.
Fig
URE 34-3
Top 10 teams for the NFL 2009 season.
These ratings have the Saints around 5 points be
predicted (before the playoffs) that the Saints w
Why is our model not a linear Solver mo
This model is not linear because the target cel
(Home Team Rating+Home Field Edge–Visiting Team R
2
. Recall that for a S
model to be linear, the target cell must be cre
form
(changing
.
cell)*(constant)
This relationship doesn’t exist i
is not linear. Solver does obtain the correct a
model in which the target cell minimizes the su
GRG nonlinear engine because this model
-
is not l
ematical functions” such as IF statements. I di
Variables Non-Negative option because to have th
allow some of the team ratings to be negative.
Not
Recently, I found that the GRG Solver engine work
checked. I recommend that you go open the Options di
Scaling option.

Chapter
Using
34
Solver to Rate
285
Sports Teams
Problems
1–4.
The fles
.xlsx
Nfl0
= (1, 2, 3, 4) contain scores for e
the
x
200
NFL season. Rate the teams for each se
would you forecast to have made the Super B
5.
For the 2004 season, devise a method to pre
Give each team an offensive rating and a de
Who had the best defense?
6.
True or False? An NFL team could lose every ga
7.
The fle Nba01_02.xlsx contains scores for e
season. Rate the teams.
8.
The fle Nba02_03.xlsx contains scores for e
2002–2003 NBA season. Rate the teams.
9.
The fle Worldball.xlsx contains all scores f
Championships. Rate the teams. Who were the b
10.
Our method of rating teams works fne for fo
arise if you apply these methods to hockey o

287
Chapter 35
Warehouse Location a
GRG Multistart and E
Solver Engines
Questions answered in this chapter:
Where in the US should an Internet shipping c
minimize the total distance that packages a
Where in the U.S. should an Internet shippi
minimize the total distance that packages a
In Microsoft Excel 2010, the Solver has been b
this chapter (and Chapters 36 and 37) I will tr
can help you solve many important optimization p
Understanding
Rg Multistart
the g
and Evo
Solver Engines
As I pointed out in Chapter 28, “An Introducti
2010 Solver has three engines that it uses to s
Nonlinear, and Evolutionary. In the following s
latter two of these engines are used to solve o
How Does Solver Solve Linear Sol
As I pointed out in Chapters 28 through 33, a S
changing cells in the target cells and constrai
form
(changing
.
cells)*constants
For linear models, you should a
engine, which is designed to effciently fnd so
Solver can handle problems with up to 200 chan
Solver that can handle larger problems
.
are avai

288
Microsoft Excel 2010: Data Analysis and Business Modeling
How Does the GRG Nonlinear Engine So
Optimization Models?
If your target cell and/or any of your constrain
not of the form
(changing cell)*(constant)
you h
ing cells, references such as the following in th
model nonlinear:
x
2
xy
sin x
e
x
x
2
e
y
If your nonlinear formulas involve ordinary math o
then proper use of the GRG Nonlinear engine shou
your Solver model. To illustrate how the GRG Non
maximize –x
2
+ 4x + 2. This function is graphed in Fig
Fig
URE 35-1
How the GRG Nonlinear engine maximizes a function.
You can see that this function is maximized
functionfor x = 2
has a slope of 0. The GRG Nonlinear engine solve
at which the slope of the function is 0. Similar
2
,the GRG
Nonlinear engine solves this problem by determini
x = 0. See Figure 35-2.

Chapter
Warehouse
35
Location and the GRG Multistart
289
and Evolutionary Solver Engines
Fig
URE 35-2
How the GRG Nonlinear engine minimizes a functio
Unfortunately, there are many functions that c
where the function’s slope equals 0. For examp
shown in Figure 35-3, when x ranges between -5 a
Fig
URE 35-3
Maximizing a function with multiple peaks.
You can see that this function has more than o
you will fnd the right solution to the problem (
near x = 5—you will fnd a solution of x = 5, w
(especially those with more than one changing c
it appears you have a major hurdle to clear. F
You can select Multistart after choosing Optio
When the Multistart option is selected, Excel c
best answer after beginning with these startin
multiple peak and valley problem.
By the way, pressing Esc stops the Solver. Als
works best when you place reasonable upper and l
example, you do not specify changing cell<100 mi

290
Microsoft Excel 2010: Data Analysis and Business Modeling
The GRG engine also runs into trouble if the tar
functions like MAX, MIN, ABS, IF, SUMIF, COUNTIF
involve changing cells. These functions create p
slope due to the fact that the slope changes
-
abr
tion problem requires you to model the value of a E
price. This call option lets you buy the stock f
thoeption, then the value of
. the
I graphed
call option
this relati
is
m
Figure 35-4. It is clear that when s = 40, the o
would break down.
Fig
URE 35-4
Option value has no slope for $40 stock price.
As Figure 35-5 shows, Solver models that include th
absolute value of a number is just the distance o
= 0. In Excel the function ABS(x) returns the ab
Fig
URE 35-5
Absolute value function has no slope for x = 0.

Chapter
Warehouse
35
Location and the GRG Multistart
291
and Evolutionary Solver Engines
Optimization problems in which the target cell a
for any changing cell values are called
nonsmo
Multistart option has diffculty with these typ
apply Solver’s Evolutionary engine. For nonlin
changing cells and 100 constraints.
How Does the Evolutionary Solver E
Optimization Problems?
The Evolutionary Solver in Excel 2010 is based o
by John Holland, a computer science professor a
Evolutionary Solver, begin by taking 50–100 po
the set of points that meet the constraints.)
Then,
T
the target cell is evaluated for each point. U
theory of evolution, you change the points in th
likelihood that future population members are l
that have a good target cell value. Because thi
and not on slopes, multiple peaks and valleys p
not have slopes (the so-called
nonsmooth
functi
The Evolutionary Solver engine (like the
- GRG M
sonable upper and lower bounds are placed on y
Evolutionary Solver engine, its best to choose O
change the mutation rate to .5. Also select th
increase the maximum time without improvement t
rate decreases the likelihood that the Solver g
maximum time without improvement to 3,600 seco
to improve the target cell for 3,600 seconds. T
your computer.
Now let’s use the Excel 2010 Solver to solve t
Answer to This Chapter’s Quest
Where in the US should an Internet shipping co
minimize the total distance that packages are s
The number of shipments (in thousands) made ea
Figure 35-6. (See the worksheet
One warehouse
i

292
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 35-6
Data for the single warehouse problem.
A key to this model is the following formula, whi
two U.S. cities having a latitude and longitude g
*
(
Lat
1 -
Lat
2)
2
+
(
Long
1 -
Long
2)
2
Distance
= 69
To begin, enter in cells F4:G4 trial values for th
Next, by copying from F7 to F8:F27 the
, you
formula
6
compute the approximate distance of each city fr
to G8:G27 the
E7*F7
formula
computes the distance traveled by
cell H5, the formula
SUM(G7:G27)
computes the tot
target cell is to minimize H5 by changing
engine,
F4:G4. A
the Solver Parameters dialog box appears as in Fi
After you click Solve, you’ll fnd that the wareh
latitude and 92.48 degrees longitude, which is n

Chapter
Warehouse
35
Location and the GRG Multistart
293
and Evolutionary Solver Engines
Fig
URE 35-7
Solver Parameters dialog box for the one warehou
Where in the US should an Internet shipping co
minimize the total distance that packages are s
The work for this problem is in the worksheet
shown in Figure 35-8.
Fig
URE 35-8
Model for locating two warehouses.

294
Microsoft Excel 2010: Data Analysis and Business Modeling
To begin, enter trial latitudes and longitudes f
from F7 to F8:F27 the formula
69*SQRT((C7-$F$4)^
o
distance of each city from Warehouse
formula
1. By copyi
69*SQRT((C7-$F$5)^2+(D7-$G$5)^2),
you compute the d
Warehouse 2. Since the shipments from each city w
you now compute the distance of each city to the c
H8:H27 the formula
MIN(F7,G7).
In I7:I27, you co
shipments by copying from I7 to I8:I27 the formu
distance traveled by shipments
.
with the formula
You’re now ready to use Solver to determine the o
the Solver Parameters dialog box is shown in Fig
Fig
URE 35-9
Solver set up for locating two warehouses.
Begin by selecting the GRG Nonlinear engine. The
each warehouse at 0 latitude and longitude. This s
the warehouses in Africa and it puts two warehou
we fnd Solver recommends locating both warehouse
a suboptimal solution. The problem is twofold: T
slopes, and perhaps our target cell, as a functi
peaks and valleys. If our target cell has multip
perhaps our poor starting solution is not near th

Chapter
Warehouse
35
Location and the GRG Multistart
295
and Evolutionary Solver Engines
solution. In situations in which you suspect m
to use the GRG Multistart option, which tries m
answer from each starting point. Most of the ti
will be the optimal solution to the problem. T
cells and run Solver using the GRG Multistart o
cells, I selected 0 and 90 degrees. This ensur
For the bounds on longitude changing cells, I c
location is west of Greenwich, England and eas
In the results, the average distance traveled p
warehouses are shown in cells F4:G5 of Figure 3
Kentucky, while Warehouse 2 is located near La
To confrm that Solver found the optimal soluti
and found no improvement in the optimal soluti
Suppose I had set an upper bound for longitude o
would have found that Solver recommends a long
bounds on a changing cell and the Solver force
a bound, then you should relax the bound.
Problems
1.
Find the optimal solution to the warehouse p
2.
Suppose you want to locate a single restroo
travel the smallest possible distance per d
work in four locations within the plant as d
X
Y
Number of employees
5
20
6
50
50
12
25
75
23
80
30
15
Assume that employees always walk in a north
going to and from the restroom. Where shoul
Problem 2 if the company wants to locate tw

297
Chapter 36
Penalties and the E
Questions answered in this chapter:
What are the keys to successfully using the E
How can I use the Evolutionary Solver to as
job in one of four workgroups?
Answers to This Chapter’s Ques
What are the keys to successfully using the Ev
Previously I stated that the Evolutionary Solv
optimization problems in which the target cell a
functions such as IF, ABS, MAX, MIN, COUNTIF, C
and AVERAGEIFS. Before solving a problem with th
following in the Solver Parameters dialog box:
Click Options, select the Evolutionary tab, a
Change Maximum Time Without Improvement to 3
Place reasonable lower and upper bounds on y
Everything in life has an upside and a downsid
The upside of the Evolutionary Solver is -that i
side is that constraints that are not linear f
well. To handle most constraints with the Evol
cell to make violation of a constraint a bad thi
with any constraint violation. The chapter’s n
the Evolutionary Solver.
How can I use the Evolutionary Solver to assig
in one of four workgroups?
You need to assign 80 employees to four workgr
rated each employee’s competence on a 0 to 10 s
employee has rated his or her satisfaction with e
scale).
example,
For
Worker 1 has been given a 9 rati
Workgroup 4 a rating of 7.

298
Microsoft Excel 2010: Data Analysis and Business Modeling
The work for this question is in the fle Assign.
between 18 and 22 people to each workgroup. You c
important as employee satisfaction. How -can you a
mize total satisfaction and ensure that each div
Fig
URE 36-1
Data for job assignment problem.
In cells A3:A82 I entered trial assignments of w
to Workgroup 1, for example, is an okay starting s
formula
HLOOKUP(A3,Qual,B3+1)
enables you to loo
her assigned job. Note that
Qual
refers to the r
the formula
HLOOKUP(A3,Satis,B3+1)
enables you t
her assigned job.
Satis
is the range name for G2
To deal with the fact that each division needs b
count how many employees have been assigned to e
N6:N9 by copying from N6 to N7:N9
.
the
Next,
formula
in cell
CO
O6:O9 you determine if a workgroup has the incor
from O6 to O7:O9 the formula
.
IF(OR(N6<18,N6>22),
Now I’ll show how to work on computing the targe
competence and total job quality by copying from K
To ensure that each workgroup will have between 1
target cell. I chose a penalty of 1,000 for each w
22 workers. There is no hard-and-fast rule to he
In this situation, the average rating is 5. This y
Therefore, it seems likely that putting the wron
beneft the target cell by more than 1,000, so su
which a workgroup has too many or too few worker

Chapter
Penalties
36
and the Evolutionary
299
Solver
too large (100,000) because it sometimes makes th
penalty is too small, Solver will not achieve th
In cell O10 I computed total number of divisio
workers with the
.
formula
Now we
SUM(O6:O9)
are fnally ready to c
in cell O12 by adding twice the total competen
a penalty of 1,000 for each group that does not h
fnal target cell is computed with the formula
You now can create the Solver model for this p
Solver because the COUNTIF functions are nonsm
model is shown in Figure 36-2.
Fig
URE 36-2
Solver model for worker assignment problem.
I maximize the weighted sum of workgroup and e
an incorrect number of workers in a workgroup (
assignment to be 1, 2, 3, or 4. The solution i
number of workers; average employee competence
-
i
tion is 6.3. Over all 80 workers, the average o
average for satisfaction ratings is 5, so cond
assignment.
If you had tried the GRG Nonlinear engine (eve
not have found the optimal solution because th
Another tip about using the Evolutionary Solve
and you will usually be rewarded by having Sol

300
Microsoft Excel 2010: Data Analysis and Business Modeling
Using Conditional Formatting to H
Ratings
You can use the conditional formatting feature t
(based on her assignment) competence and satisfa
cell range C3:J82. Then, select New Rule from Co
select the Use A Formula To Determine Which Cell
box as shown in Figure 36-3.
Fig
URE 36-3
Using conditional formatting to highlight worker q
This formula will enter in cell C3 a red format i
Workgroup 1. You can copy this formula across an
and satisfaction ratings are highlighted only fo
assigned.
Problems
1.
Use the Evolutionary Solver to solve Problem 4 i
Budgeting.”
2.
Solve the two warehouse problem in Chapter 35
Multistart and Evolutionary Solver Engines,” a
most 120,000 units.

Chapter
Penalties
36
and the Evolutionary
301
Solver
3.
In the fctional state of Politicians Care A
districts. Each of 15 cities must be assign
must be assigned between 150,000 and 250,00
given below. Assign the cities to districts t
the Democrats.
City Rep
Dem
1
80
34
2
43
61
3
40
44
4
20
24
5
40
114
6
40
64
7
70
34
8
50
44
9
70
54
10
70
64
11
80
45
12
40
50
13
50
60
14
60
65
15
50
70
4.
Solve the assignment of workers example ass
important as the bosses’ ratings.

303
Chapter 37
The Traveling Sales
Questions answered in this chapter:
How can I use Excel to solve sequencing pro
How can I use Excel to solve a traveling sa
Answers to This Chapter’s Ques
How can I use Excel to solve sequencing proble
Many business problems involve the choice of a
In what order should a print shop work on 1
jobs fail to meet their due dates? Problems o
problems.
A salesperson lives in Boston and wants to v
In which order should he visit the cities t
an example of the classic
traveling
.
salespe
Here are two other examples of a TSP:
A delivery driver needs to make twenty stop
packages to minimize her time on the road?
A robot must drill 10 holes to produce a si
drilling the holes minimizes the total time n
The new and improved Excel 2010 Solver makes t
Simply choose Evolutionary Solver, select your c
All Different option ensures that if you have 1
2, …10 to the changing cells with each value o
a range of
n
changing cells to be different, E
values 1,with
2, …,
each
n
possible value occurring ex
option to easily solve a traveling-salesperson p
How can I use Excel to solve a traveling sales
Let’s try and solve the following problem.
Willie Lowman is a salesman who lives in Bosto
Figure 37-1 and then return to Boston. In what o
the total distance he travels? Our work is in fl

304
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 37-1
Data for the TSP.
To model this problem in a spreadsheet, you shou
of the numbers 1 through 11 represents an order f
2-4-6-8-10-1-3-5-7-9-11 can be viewed as traveli
LA (City 5), and fnally to SF (City 10) before r
from the location of
×9
City
×8×7×6…
×2
1,
×1
=there
3,628,800
are 10!
- possibl
= 10
ings for Willie to consider.
To begin you need to determine the total distanc
the cities. The INDEX function is perfect for thi
Function,” that the syntax
Range,
of the
row#,
INDEX
). Excel
column#
function
look i
in the range of cells named
Range
and picks out th
Range
. In this case, you can use the INDEX -functio
ing all cities.
I began by entering in the range F16:F26 an orde
Next, I named the range
, and G4:Q14
entered
distances
in cell G16 the f
INDEX(distances,F26,F16).
This formula determine
(in F26) and the frst city listed
INDEX(Distances,F16
(in F16). Next I e
in cell G17 and copy it to the range G18:G26. In G
between the frst and second city listed,
- and so o
tal distance traveled) in cell
.
G27 with the form
At this point, I’m ready to invoke the Evolution
then I click Add Constraint and select the range F
This ensures that Solver always keeps the changi
values 1, 2, up to 11. Each value will occur exa
shown in Figure 37-2. Before running Solver, I i

Chapter
The
37Traveling Salesperson
305
Problem
Fig
URE 37-2
Solver set up for a traveling salesperson proble
The minimum possible distance to travel
cities
is 8,9
are visited, simply begin in the row with a 1 (
and follow the cities in the listed sequence. T
Boston-NY-Pittsburgh-Chicago-Denver-Seattle-SF
are many other sequences for visiting the citi
distance of 8,995 miles.
Problems
1.
A small job shop needs to schedule six jobs
complete each job are given below. In what o
minimize the total days the jobs are late?
Job
Processing Due
timedate(measured
from today)
1
9
32
2
7
29
3
8
22
4
18
21
5
9
37
6
6
28

306
Microsoft Excel 2010: Data Analysis and Business Modeling
2.
The fle Nbamiles.xlsx contains the distance b
in New York and want to visit each arena once a
should you visit the cities to minimize total d
3.
Suppose now that you live in Atlanta and are d
wants to return to his home. Each time you vi
home arena. In what order should you drop off th
distance traveled by the GMs.
4.
In the Willy Lowman problem, suppose you
must
What is the solution to the problem?

307
Chapter 38
Importing Data from a T
Document
Question answered in this chapter:
How can I import data from a text fle into E
Jeff Sagarin, the creator of the
USA Today
bas
developed a system to rate NBA players for the
Cuban. Every day during the season, Jeff’s FOR
information, including ratings for each Dallas M
program produces this information in the form o
you can import a text fle into Microsoft Excel t
Answers to This Chapter’s Ques
How can I import data from a text file into Exc
You will likely often receive data in a Micros
need to import into Excel for numerical analys
should frst save it as a text fle. You can the
With the Text Import Wizard, you can break dat
the following approaches:
If you choose the
fxed-width
option, Excel g
into columns. You can easily modify Excel’s a
If you choose the
delimited
option, you pic
a space, or a plus sign), and Excel breaks th
the character you choose.
As an example, the fle Lineupsch38.docx (a sam
length of time each lineup played for Dallas i
The fle also contains the “rating” of the line

308
Microsoft Excel 2010: Data Analysis and Business Modeling
against Sacramento, the lineup of Bell, Finley, L
court together for 9.05 minutes and that the lin
minutes), worse than an average NBA lineup.
Bell
Finley
LaFrentz
Nash
Nowitzki
- 19.79
695# 9.05m SAC DAL* Finley
Nash
Nowitzki
Van Exel
Williams
- 11.63
695# 8.86m SAC DAL* Finley
LaFrentz
Nash
Nowitzki
Van Exel
102.98
695# 4.44m SAC DAL* Bradley
Nowitzki
Van Exel
- 44.26
695# 4.38m SAC DAL* Bradley
Nash
Nowitzki
Van
Williams
9.71
695# 3.05m SAC DAL* Bell
Finley
LaFrentz
Nowitzki
Van
121.50
695# 2.73m SAC DAL* Bell
LaFrentz
Nowitzki
Van Exel
Williams
39.35
695#
2.70m SAC DAL* Bradley
Finley
Nowitzki
Van Exel
Williams
86.87
695# 2.45m SAC DAL*
Bradley
Nash
Van Exel
Williams
Rigaudeau
- 54.55
695# 2.32m SAC DAL*
We’d like to import this lineup information into E
information would be listed in different columns
Each player’s name
Minutes played by the lineup
Rating of the lineup
The player Van Exel (his full name is Nick Van E
delimited option and use a space character to br
occupy two columns. For lineups that include Van E
in a different column than the column in which th
include Van Exel. To remedy this problem, I used th
each
occurrence of Van Exel to Exel. Now, when Exce
occurs, Van Exel will require only one column. T
the following.
Bell
Finley
LaFrentz
Nash
Nowitzki
- 19.79
695# 9.05m SAC DAL* Finley
Nash
Nowitzki
Exel
Williams
- 11.63
695# 8.86m SAC DAL* Finley
LaFrentz
Nash
Nowitzki
Exel
102.98
69 5# 4.44m SAC DAL* Bradley
Finley
Nash
Nowitzki
Exel
44.26
695# 4.38m SAC DAL* Bradley
Nash
Nowitzki
Exel
Williams
SAC DAL* Bell
Finley
LaFrentz
Nowitzki
Exel
- 121.50
695# 2.73m SAC DAL* Bell
LaFrentz
Nowitzki
Exel
Williams
39.35
69 5# 2.70m SAC DAL* Bradley
Exel
Williams
86.87
69 5# 2.45m SAC DAL* Bradley
Nash
Exel
Williams
Rigaudeau
-
54.55
695# 2.32m SAC DAL*
The trick to importing data from a Word or text fl
Wizard. As I mentioned earlier, you frst need to s
this example) as a text fle. To do this, simply o
Save As, and then select Plain Text in the Save A
select the Windows (Default) option, and then cl
the name Lineupsch38.txt. Close the Word documen
You’ll see step 1 of the Text Import Wizard, whi

Chapter
Importing
38
Data from a Text
309
File or Document
Fig
URE 38-1
Step 1 of the Text Import Wizard.
Clearly, in this case you want to select the D
However, let’s suppose that you choose Fixed W
appears, shown in Figure 38-2. As you can see, y
For many data import operations, changing colu
Fig
URE 38-2
Step 2 of the Text Import Wizard after selecting t
If you select Delimited in step 1, you’ll see th
shown in Figure 38-3. In this example, I’ve se

310
Microsoft Excel 2010: Data Analysis and Business Modeling
Consecutive Delimiters As One option ensures tha
column break. I recommend keeping Tab selected b
properly if Tab is cleared.
Fig
URE 38-3
Step 2 of the Text Import Wizard after selecting D
When you click Next, you’re sent to the third st
Figure 38-4. By selecting the General option as th
numerical data as numbers and other values as te
Fig
URE 38-4
Step 3 of the wizard, in which you can select a fo

Chapter
Importing
38
Data from a Text
311
File or Document
When you click Finish, the wizard imports the d
Fig
URE 38-5
Excel fle with lineup information.
Each player is listed in a separate column (co
lineup, column G contains the game number, col
lineup, and columns I and J list the two teams p
Excel workbook (.xlsx), you can use all -
of the a
formance of Dallas’s lineups. For example, you c
the team when Dirk Nowitzki is on or off the c
Problems
1.
The fle Kingslineups.docx contains performa
Kings lineups. Import this data into Excel.
2.
In the example discussed in the chapter, th
with .anModify
m
the fle so that the time playe

313
Chapter 39
Importing Data from t
Questions answered in this chapter:
Yahoo Finance provides analyst ratings (buy
import this information into Excel?
Is there a way I can download current stock p
We all know that the World Wide Web contains u
However, you can’t really do any sort of analy
to import the data into Microsoft Excel, which y
website where the data you want is located, co
an Excel worksheet. On the Data tab, in the Ge
the New Web Query dialog box appears, paste th
page appears, and you can select the data you wa
chapter’s frst question shows you how to imple
Answers to This Chapter’s Ques
Yahoo Finance provides analyst ratings
. How can
(buy,
I ims
this information into Excel?
The URL
http://fnance.yahoo.com/q/al?s=MSFT+An
analysts’ forecasts for the future price of Mi
can see that on August 2, 2010, 31 analysts pr
sell on August 2, 2011, for $33.35. The highes
was $24. It would be useful to import this dat
the data. You’ll fnd the web queries worksheet
used in thi
in the fle Webqueries.xlsx. When you open the W
“Security Warning: Data connections have been d
course, enable the content if you believe the s

314
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 39-1
Analyst forecast for Microsoft in August 2010. The W
easy to analyze on a website.
To import the data into Excel, copy the URL and th
the Data tab on the ribbon, and in the Get Exter
New Web Query dialog box appears, press Ctrl+V t
then click Go. The New Web Query dialog box disp
Fig
URE 39-2
New Web Query dialog box after choosing a URL.
You now click the arrow that points to the data y
case, you would click the arrow directly to the l
check mark. After clicking Import, you’ll
-
see th
cate to Excel where you want to place the data. I c
this example. After clicking OK, the analysts’ r
Figure 39-3.) Note that the numbers and labels a

Chapter
Importing
39
Data from
315
the Internet
Fig
URE 39-3
Analyst forecasts for Microsoft made on August 2
You can easily set your query to be refreshed o
right-click anywhere in the query results, sel
Refresh Control settings. As shown in Figure 3
every minute and be automatically refreshed wh
Fig
URE 39-4
Refresh settings for the web query.
To edit this query, simply right-click anywher
By clicking the Options button shown in the up
formatting of your query results. Of course,
-
w
ably see different information because analyst
future stock price for Microsoft.
Is there a way I can download current stock pr
Excel comes with a built-in web query that can b
about stocks. This web ,
query
which
ismeans
dynamic
that you
web
c
q
query to update stock information as it change
data you want to update and then, on the Data t
All. Let’s see how to download real-time stock i
MSFT) and International Business Machines (tic

316
Microsoft Excel 2010: Data Analysis and Business Modeling
Open or create a worksheet in Excel, and then di
Data group, double-click Existing Connections. N
MoneyCentral Investor
. Click
Stock
Open,
Quotes
and then use the I
to indicate where you want to place the data in th
Enter Parameter Value dialog box as shown in Fig
about Microsoft and IBM into Excel. Figure 39-6 (
fle Webqueries.xlsx) shows a sample of the downl
on August 2, 2010. Checking the options shown in Fi
changes to reflect the most current information.
Fig
URE 39-5
Use the Enter Parameter Value dialog box to designa
dynamic web query to download information.
Fig
URE 39-6
Downloaded information about Microsoft and IBM sto
Excel also ships with web queries designed to dow
information about major stock indexes. These que
information in real time unless you rerun the qu
Of course, you can create your own web queries. C
of this book. See Chapter 4 of
Data Analysis for M
S. Christian Albright, Wayne L. Winston, and Chr
introduction to creating web queries.

Chapter
Importing
39
Data from
317
the Internet
Problems
1.
Download real-time information about Disney (
symbol GPS) into Excel.
2.
Use the built-in web query designed to down
information into Excel.
3.
Go to
NBA.com
and download the career stati
4.
Go to
MLB.com
and download the career stati
5.
Go to
NFL.com
and download the season stati
6.
Go to
http://www.boxoffceguru.com/blockbust
moneymaking movies of all time into Excel.
7.
Go to
http://money.cnn.com/magazines/fortune
information on the Fortune 500 into Excel.
8.
Go to Fangraphs.com and download the latest C
(They are pretty sad!)

319
Chapter 40
Validating Data
Questions answered in this chapter:
I’m entering scores from professional baske
scores from 50 to 200 points per game. I on
points, which messed up my analysis. Is the
making this type of error?
I’m entering the date and amount of my busin
year, I often enter the previous year in th
up Excel to prevent me from making this typ
I’m entering a long list of numbers. Can I h
value?
My assistant needs to enter state abbreviati
sales transactions. Can we set up a list of s
that she’ll enter an incorrect abbreviation
A lot of our work often involves mind-numbing d
information into Microsoft Excel, it’s easy to m
Excel 2010 can greatly lessen the chances that y
validation, you begin by selecting the cell ra
Choose Data Validation on the Data tab, and th
chapter’s examples) that Excel uses to flag any
Answers to This Chapter’s Ques
I’m entering scores from professional
. I know basketba
that a t
scores from 50 to 200
. I once
points
entered
per game
1,000 point
which messed up. Is
my there
analysisway to have Excel pr
type of error?
Let’s suppose that you’re going to enter into c
home team, and in cells B2:B11, you’ll enter th
(You’ll fnd the work I did to solve this probl
that each value entered in the range A2:B11 is a w
Begin by selecting the range A2:B11, and then c
the Settings tab, select Whole Number from the A
dialog box as shown in Figure 40-1.

320
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 40-1
Use the Settings tab in the Data Validation dialog b
Excel’s default response to
) is
invalid
message
data (called
stating a
entered is not valid. A user has restricted valu
use the Error Alert tab in the Data Validation
-
d
ture of the error alert, including the icon, the ti
message itself. On the Input Message tab, you ca
the type of data that can be safely entered. The m
selected cell. For example, I entered an error a
between 50 and 200.” After typing a number that v
would then see the message shown in Figure 40-3.
Fig
URE 40-2
Error Alert tab options in the Data Validation dia
Fig
URE 40-3
Error alert for the basketball data validation exa

Chapter
Validating
40
321
Data
I’m entering the date and amount of. Early
my busines
t
year, I often enter the previous
. Is year
there
ina the
way dI c
up Excel to prevent me from making this type o
Suppose it is early in 2013 and you are enteri
fle Datedv.xlsx.) Simply select the range A2:A
Data tab. Fill in the Settings tab of the Data V
Then you will not be allowed to enter any date e
Fig
URE 40-4
Use settings such as these to ensure the validit
If you enter a date in this range that occurs e
about the error. For example, entering 1/15/20
defne.
I’m entering a long
. Canlist
I have
of numbers
Excel warn me if I e
value?
To unleash the full power of data validation, y
select Custom in the Allow list on the Setting
Figure 40-4), you use a formula to defne
-
valid d
tion works the same as a formula used for cond
Chapter 24, “Conditional Formatting.” You
- ente
tent of the frst cell in the selected range is v
dialog box, the formula is copied to the remai
in a cell in the selected range, Excel display
False for that value.
To illustrate the use of the Custom setting, l
entry in the cell range B2:B20 is a number. (S
this problem is using the Excel ISNUMBER functi

322
Microsoft Excel 2010: Data Analysis and Business Modeling
if the function refers to a cell that contains n
function refers to a cell that contains a nonnum
After selecting the cell range B2:B20 and placin
click Data Validation in the Data Tools group, a
Validation dialog box as shown in Figure 40-5.
Fig
URE 40-5
Use the ISNUMBER function to ensure that the data i
After clicking OK, you’ll receive an error promp
B2:B20. For example, if you type
John
in cell B3
If you click Data Validation while working in ce
displayed as .
=ISNUMBER(B3)
This demonstrates that the formul
in the correct fashion. Entering John in cell B3 c
receive the error alert.
My assistant needs to enter state abbreviations w
sales transactions
. Can we set up a list of state abbrevia
she’ll enter an incorrect abbreviation?
The key to this data validation problem is to us
a list of state abbreviations. See the fle State
and named the. range
Next,
abbrev
select the range in which y
(The example uses D5:D156.) After clicking Data V
Validation dialog box as shown in Figure 40-6.

Chapter
Validating
40
323
Data
Now, whenever you select a cell in thedisplays
range D
a list of state abbreviations, as shown in Fig
list are valid values in this range. If you do n
state abbreviation, you’ll receive an error me
(such as ALK for Alaska).
Fig
URE 40-6
The Data Validation dialog box can be used to de
Fig
URE 40-7
Drop-down list of state abbreviations.
Remarks
If you press F5, click Special in the Go To d
Excel selects all cells with data validatio
dialog box to select all cells containing c
In previous versions of Excel, if you wante
based on a data source list in a different w
(as I did in this chapter’s example) for the d
limitation has been removed.

324
Microsoft Excel 2010: Data Analysis and Business Modeling
If you use the dynamic-range technique descri
Function,” changes you make (adding or deleti
automatically reflected in the drop-down box. (
data source list as an Excel table (see Chapt
are reflected in the drop-down list, as long a
to type the table name.
Suppose you want to use a drop-down list to s
You want another drop-down list that you can u
sell at the selected store. The problem is th
sold at each store. How do you create such a n
are Target and CVS. Suppose you assign a rang
bars sold at Target, and a range name of
CVS
t
the drop-down list for store selection
- is in, f
propriate drop-down list in cell B20 by click
list selected the formula
. As I discussed
=INDIRECT(A20)
in Chapter 2
Function,” if A20 contains CVS, the list will k
bars sold at CVS, and so on. See Problem 11.
To clear data validation from a range, select th
Data tab, and then select Clear All.
If you have a long list, you probably want to i
start the range for your drop-down list in th
cells allowed), then Autocomplete will work. S
You can also use data validation to set up cr
(see Problem 4) or the time of day (see Probl
Problems
1.
You are entering nonnegative whole numbers in th
validation setting that ensures that each entr
2.
You are entering in the cell range C1:C15 the d
July 2004. Enter a data validation setting th
July 2004.
3.
With the List option in the group of data val
error message if a value that is not included i
validating. Suppose you’re entering employee fr

Chapter
Validating
40
325
Data
The only employees of the company are Jen, G
option to ensure that no one misspells a fr
4.
With the Text Length option in the group of d
an error message when the number of charact
you defne. Use the Text Length option to en
contain at most fve characters (including b
5.
You are entering employee names in the cell r
ensure that no employee’s name is entered m
setting and the COUNTIF function.)
6.
You are entering product ID codes in the ce
always end with .the
Usecharacters
data validation
xyz
to ens
code entered.ends
(Hint:
with
Use
xyz
the Custom setting a
7.
Suppose you want every entry in the cell ra
numerical value. Use data validation to ens
an error. (Hint: Use the ISTEXT function.)
8.
Set up a data validation procedure that ens
contain exactly two decimal places. (Hint: U
9.
The fle Latitude.xlsx contains a formula to c
using their latitude and longitude. The fle a
various U.S. cities. Set up a drop-down lis
another city in cell Q2, the distance betwe
10.
Ensure that if new cities are added to the l
will include the new cities.
11.
The fle Candybardata.xlsx contains a list o
worksheet also contains the types of candy b
charged for each candy bar. Set up your wor
both the store and a candy bar from a drop-
in D19.
Enable users to select a store from the d
Set up a drop-down list in C13 to let use
containing only those candy bars sold at a s
function when defning the list.)
If you change the store in B19, then C19 mi
sold at the newly selected store. Ensure th
selection above
if this is the case. For e
gumballs,
then C19 should
.
say
Make select

326
Microsoft Excel 2010: Data Analysis and Business Modeling
12.
You have a $100,000 expense budget. In column A
incurred. Set up a data validation criterion th
column E do not exceed your budget.
13.
Set up a data validation criterion that ensur
descending order.
14.
Set up data validation criteria that ensures th
on Monday through Friday. (Hint: The WEEKDAY f
Monday, etc.)
15.
Set up data validation criteria that ensures th
A1:A20 will be a morning time.

327
Chapter 41
Summarizing Data by U
Histograms
Questions answered in this chapter:
People often say that a picture is worth a t
picture (called
) that
histogram
summarizes the values in a da
What are some common shapes of histograms?
What can I learn by comparing histograms fr
The ability to summarize a large data set is i
summarize data in Microsoft
,
descriptive
Excel
, and
are
statistics
PivotTable
.
histogra
In this chapter, I discuss the use of histogra
statistics in Chapter 42, “Summarizing Data by U
Chapter 43, “Using PivotTables and Slicers to D
Answers to This Chapter’s Ques
People often say that a picture
. Can is
I use
worth
Excel
a tho
to c
picture (called a histogram) that summarizes t
A histogram is a commonly used tool to summari
how many observations (another
) fall in
term
various
for
data
range
p
example, a histogram created from monthly Cisc
monthly returns Cisco had from 0 percent throu
percent, and so on. The ranges in which
.
you gr
Let’s look at how to construct and interpret hi
returns for Cisco and GM stock in the years 19
other stocks) in the fle Stock.xlsx. Figure 41
worksheet). During March 1990, for example, Ci

328
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 41-1
Monthly stock returns.
When constructing histograms with Excel, you can l
defne the bin ranges yourself. If Excel defnes th
looking bin ranges, such as –12.53 percent to 4.
the ranges myself.
A good way to start defning bin ranges for a his
ranges as setting boundaries) is to divide the r
largest) into 8 to 15 equally spaced categories. A
–3p
0ercent through 40 percent, so I chose bin ran
percent,
–10
0 percent, and so on up to 40 per
To create bin ranges, I frst enter CSCO, .4, .3, .
in cells H54:H62. Next, on the Data tab on the r
Analysis to open the Data Analysis dialog box. T
Analysis ToolPak, which contains many of the sta
Not
I
e
f the Data Analysis command doesn’t appear on th
Options, and then click Add-Ins. In the Manage box, c
Add-Ins dialog box, select Analysis ToolPak, and the
ToolPak functions by clicking Data Analysis in the A
By clicking Histogram in the Data Analysis dialo
shown in Figure 41-2.

Chapter
Summarizing
41
Data by Using
329
Histograms
Fig
URE 41-2
Histogram dialog box for the Cisco histogram.
Here’s how to fll in the dialog box as it’s sh
Select the input range (F51:F181). (To selec
and then press Ctrl+Shift+Down Arrow. This t
This range includes all the data you want t
label CSCO from cell F51 because when you d
x-axis of the histogram is often labeled wi
The bin range (H54:H62) includes the bounda
of –30 percent through –20 percent, –20 per
30–40 percent.
I checked the Labels option because the frs
range contain labels.
I chose to create the histogram
).
in a new wo
Select Chart Output, or Excel will not crea
Click OK in the Histogram dialog box. The Cisc
Figure 41-3.
Fig
URE 41-3
Cisco histogram created by using an Excel Analys
When you create the histogram, you’ll see gaps b
right-click any bar on the graph and choose Fo

330
Microsoft Excel 2010: Data Analysis and Business Modeling
drag Gap Width to 0%. You might also see that a l
the labels do not appear, select the graph and d
the graph. You can also reduce the font size to m
right-click the graph axis, and then right-click F
change the title of the chart by selecting the t
made some of these changes, the histogram appear
Fig
URE 41-4
You can change the format of different elements in t
Notice that Cisco returns are most likely betwee
height of the bars drops off as the graph moves awa
the histogram, you also obtain the bin-range fre
Fig
URE 41-5
Cisco bin-range frequencies.
From the bin-range frequencies, you can learn, f
return was greater than –30 percent and less tha
monthly return was greater than –20 percent and l
What are some common shapes of histograms?
For most data
histogram
sets, created from the data will be c
following:
Symmetric
Skewed right (positively skewed)
Skewed left (negatively skewed)
Multiple peaks

Chapter
Summarizing
41
Data by Using
331
Histograms
Let’s look at each type in more detail. See th
Symmetric distribution
A histogram is symmetric if it h
approximately the same to the left of the p
(such as IQ tests) are often symmetric. For e
W42) might look like Figure 41-6. Notice tha
the peak bar are approximately the same, th
the peak bar are approximately the same, an
all people with an IQ greater than 95 and l
represents all people having an IQ less tha
Cisco monthly returns are approximately sym
Fig
URE 41-6
Symmetric histogram.
Skewed right (positively
A histogram
skewed)
is skewed right (
if it has a single peak and the values of th
the peak than to the left of the peak.- Many e
vidual income) exhibit a positive skew. Figu
positively skewed histogram created from a s
Fig
URE 41-7
A positively skewed histogram created from da

332
Microsoft Excel 2010: Data Analysis and Business Modeling
Skewed left (negatively
A histogram
skewed)
is skewed left (n
if it has a single peak and the values of the d
the peak than to the right of the peak. Days f
skewed. An example is shown in cell Q7
- of Fig
sents the number of women whose time from con
range. For example, two women gave birth fewe
Fig
URE 41-8
A negatively skewed histogram of data plotting d
Multiple
When
peaks
histogram exhibits multiple pe
from two or more populations are being graphe
diameter of elevator rails produced by two ma
Figure 41-9. See cell Q11 of the fle Twinpeaks
Fig
URE 41-9
A multiple-peak histogram.
In this histogram, the data clusters into two s
group of data corresponds to the elevator rai
assume that the diameter you want for an elev
that one machine is producing elevator rails th
machine is producing elevator rails that are t
interpretation of this histogram by constructi
produced by each machine. This example shows w
quality control.

Chapter
Summarizing
41
Data by Using
333
Histograms
What can I learn by comparing histograms from d
Analysts are often asked to compare different
how the monthly returns on GM and Cisco stock d
can construct a histogram for GM by using the s
one histogram above the other, as shown in Fig
fle Stock.xlsx.
Fig
URE 41-10
Using histograms that include the same bin range
By comparing these two histograms, you can draw t
Typically, Cisco performed better than GM. Y
Cisco is one bar to the right of the highes
-
ther to the right than the GM bars.
Cisco had more variability, or spread about t
bar contains 59 months, whereas Cisco’s pea
that for Cisco, more of the returns are out
Cisco return. Cisco returns are more spread o
In Chapter 42, we’ll look at more details abou
on Cisco and GM.
Problems
1.
Use the data in Stock.xlsx to construct his
2.
Use the data in Historicalinvest2009.xlsx t
stocks and bonds. Then compare the annual r

334
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
You are given (in the fle Deming.xlsx) the me
rods produced by Rodco, as reported -by the pr
ered
acceptable if it is at least 1 inch in diam
produced by Rodco has followed a symmetric hi
Construct a histogram of these measurements
Comment on any unusual aspects of the histo
Can you guess what might have caused any unus
(Hint:
One of quality-guru Edwards Deming’s 1
4.
The fle Unemployment.xlsx contains monthly U.
histogram. Are unemployment rates symmetric o
5.
The fle Teams.xlsx contains runs scored by ma
season. Create a histogram. Are runs scored s
6.
The fle NFLpoints.xlsx contains points scored by N
histogram. Are points scored symmetric or ske

335
Chapter 42
Summarizing Data by U
Descriptive Statist
Questions answered in this chapter:
What defnes a typical value for a data set?
How can I measure how much a data set sprea
Together, what do the mean and standard dev
data?
How can I use descriptive statistics to com
For a given data point, can I easily fnd it
example, how can I fnd the ninetieth percen
How can I easily fnd the second largest or s
How can I rank numbers in a data set?
What is the trimmed mean of a data set?
When I select a range of cells, is there an e
describe the data in those cells?
Why do fnancial analysts often use the geom
return on a stock?
In Chapter 41, “Summarizing Data by Using Hist
sets by using histograms. In this chapter, I s
characteristics of the data, such as the mean, m
measures that Microsoft Excel 2010
. You
groups
can toge
obt
the descriptive statistics for a set of data by c
the Data tab and then selecting the Descriptiv
data and click OK, all the descriptive statisti
Answers to This Chapter’s Ques
What defines a typical value for a data set?
To illustrate the use of descriptive statistic
return data in the fle Stock.xlsx. To create a s
Data Analysis on the Analysis tab, and then se
Statistics dialog box as shown in Figure 42-1.

336
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 42-1
Descriptive Statistics dialog box.
The input range is the monthly Cisco and GM retu
(including the labels in row 51). I flled in the r
box as shown in Figure 42-1 for the following re
I selected Columns in the Grouped By options b
different column.
I selected Labels In First Row because the fr
and not data.
I selected cell I53 of the current worksheet a
By selecting Summary Statistics, I ensured th
descriptive statistics measures for both GM a
When you click OK, Excel calculates the descripti
Fig
URE 42-2
Descriptive statistics results for Cisco and GM st

Chapter
Summarizing
42
Data by Using
337
Descriptive Statistics
Now let’s interpret the descriptive statistics th
for Cisco’s monthly stock returns. The Descrip
central location: mean (or average), median, a
Mean
The mean of a data set is written as
x
a
observations in the sample. If the data val
1
,
2
,…,
x
x
n
, then the follow
equation calculates the mean.
n
1
x
i
i – n
i – 1
x =
Here,
n
equals the number of observations i
i
is the
observati
in the sample. We fnd that Cisco’s mean month
It is always true that the sum of the devia
Thus, you can think of a data set’s mean as a “
without using the Descriptive Statistics op
by applying the AVERAGE function to the app
Median
The median of a sample is the “middle” o
from smallest to largest. If a sample contai
median is the observation that has as many o
a sample of nine, the median would be the f
When a sample includes an even number of ob
two middle observations. Essentially, the m
For example, the median monthly return on C
this information by using the MEDIAN functi
Mode
The mode is the most frequently occurrin
occurs more than once, the mode does not ex
more than once for the years 1990–2000, so th
mode was approximately 5.14 percent. In ver
could also use the MODE function to compute th
more than once, the MODE function returned #
The problem is that a data set canfunction
have mor
simply returned the frst mode it found. For thi
functions: MODE.SNGL and MODE.MULT (see the fl
MODE.SNGL performs exactly as the MODE func
versions. Earlier versions of Excel, howeve
MODE.MULT is an array function. You’ll learn m
“Array Functions and Formulas.” To use the M
function) you must frst select the range of c
Next, enter the function or formula. Finall
down the Ctrl key followed by the Shift key a

338
Microsoft Excel 2010: Data Analysis and Business Modeling
MODE.MULT function is that you do not know in a
has, so you do not know the correct size of th
The fle Modefunctions.xlsx (see Figure 42-3) s
involving modes.
Fig
URE 42-3
Examples of Excel’s MODE functions.
The data set displayed in Figure 42-3 has two m
“old school” MODE function with the formula M
mode it found (3). In cell F14 the
formula MO
After selecting the cell range E16:E17, I arr
and Excel returned both the modes (3 and 5). A
three-cell range), I array-entered the same f
because the data set had no third mode to fll th
range E20 and array-entered the same formula. B
single cell, Excel returned only the frst mod
The mode is rarely used as a measure of centr
however, that for a symmetric data set, the m
A natural question is whether the mean or med
location. Essentially, the mean is the best m
does not exhibit an excessive skew. Otherwise
-
sure of central location. If a data set is hi
In this case, the median is a better measure o
U.S. government reports median family income i
family income is highly positively skewed.

Chapter
Summarizing
42
Data by Using
339
Descriptive Statistics
The skewness measure reported by the Descri
data set is highly skewed.
A skew greater than +1 indicates a high d
A skew less than –1 indicates a high degr
A skew between –1 and +1 inclusive indica
Thus, monthly returns of GM and Cisco exhib
Because the skewness measure for each data s
measure of a typical return than the median
compute the skew of a data set.
Kurtosis, which sounds like a disease, i
Kurtosis near 0 means
peakedness”
data set
close
exhibits
to the“ n
bell-shaped) curve. (I’ll discuss the norma
Variable.”) Positive kurtosis means that
-
a da
dom variable, whereas negative kurtosis mea
random variable. GM monthly returns are mor
Cisco monthly returns are less peaked than a n
How can I measure how much a data set spreads f
Let’s consider two investments that each yield a
deciding which investment you prefer, you’d li
the investment. The most important measures of th
its mean are sample variance, sample standard d
Sample variance and sample
The sample
standard
variance
deviati
s
2
is defned
by the following formula.
n – 1
1
( x
i
– x )
2
i – n
i – 1
s
2
=
You can think of the sample variance as the a
its mean. Intuitively, it seems like you sh
squared deviation, but for technical
.
reason
Dividing the sum of the squared deviations by
an unbiased measure of the true variance of th
data is drawn.
The sample standard deviation
s
is just the s
2
.
Here is an example of these computations fo
3 – 1
1
[ ( 1 – 3 )
2
+ ( 3 – 3 )
2
+ ( 5 – 3 )
2
] = 4
s
2
=

340
Microsoft Excel 2010: Data Analysis and Business Modeling
We fnd that
s =
4 =
2
In the stock example, the sample standard dev
percent with a sample variance of 0.015%
2
. Naturally
2
is hard
, % to interpret
usually look at the sample standard deviation
8.97 percent.
In previous versions of Excel the sample varia
the VAR function, and the sample standard dev
function. You can still use these functions i
equivalent functions VAR.S and
.) STDEV.S.
The -new func
(The S s
tions VAR.P and STDEV.P compute the populatio
deviation. To compute a population variance o
in the denominator of the defnition of
s
2
by
.
n
RangT
e
he range of a data set is the largest
smallestnu
number. Here, the range in the monthly Cisco r
range for GM monthly returns is 52 percent.
Together, what do the mean and standard deviatio
Assuming that a histogram follows a Gaussian, or n
us the following:
Approximately 68 percent of all. observations a
Approximately 95 percent of all .observations a
Approximately 99.7 percent of all. observation
For example, you would expect that approximately 9
are from –19 percent through 30 percent, as show
Mean–2s=.056-2*(.122)=–19% and Mean+2s=.056+2*(.1
Any observation more than two standard deviation
.
For the Cisco data, 9 of 130 observations (or ro
In general, the rule of thumb is less accurate f
accurate for relatively symmetric data sets, eve
population.
Many valuable insights can be obtained by fnding c
to ensure that the causes of “good outliers” occ
outliers occur less frequently.

Chapter
Summarizing
42
Data by Using
341
Descriptive Statistics
Using Conditional Formatting to H
You’ll fnd that it is often useful to highligh
Figure 42-4 (see the
Stockprices
worksheet in th
Fig
URE 42-4
Outliers for Cisco highlighted with conditional f
For example, to highlight the outliers for the C
for an
mean–2s
outlier
) in (
cell J69 and the
mean+2s
upper
) incutoff
cell Jf
Next, select the entire range of Cisco returns (
range (F52), select Conditional Formatting on th
Formatting Rule dialog box, select Use A Formu
then fll in the rest of the dialog box as show
Fig
URE 42-5
Conditional formatting rules to select outliers, a

342
Microsoft Excel 2010: Data Analysis and Business Modeling
This condition ensures that
s
above
if cell
or F52
below
is eithe
m
monthly Cisco return, the format you select (a r
to cell F52. This formatting condition is automa
outliers show up in red.
How can I use descriptive statistics to compare d
You can use descriptive statistics to summarize th
example, between Cisco and GM monthly returns. L
and spread of a typical value, you can conclude th
Typically (looking at either the mean or the m
than GM.
Cisco monthly returns are more variable (look
range) than monthly GM returns.
Both Cisco and GM monthly returns exhibit sli
are more peaked than a normal curve, whereas C
than a normal curve.
For a given data point, can I easily find its per
example, how can I find the ninetieth percentile o
In previous versions of Excel, the PERCENTILE an
you wanted to determine an observation’s relativ
functions have been added in Excel 2010: PERCENT
INC, PERCENTRANK.EXC. The functions PERCENTILE.I
identical to the old PERCENTILE and PERCENTRANK
-
f
sions of Excel do not recognize these new functi
work are in the fle Percentile.xlsx, shown in Fi
Fig
URE 42-6
Examples of PERCENTILE and PERCENTRANK Functions.

Chapter
Summarizing
42
Data by Using
343
Descriptive Statistics
The PERCENTILE, PERCENTILE.INC, AND PERCENTILE
of a data set that you specify. The syntax of th
INC(
data,k
), which returns
th percentile
the
k
of the information i
data
.
Consider a data set consisting of
n
pieces of d
PERCENTILE.INC functions
th percentile
returned
(0<p<1)
the
p
as the
in the data set. For example, in H13, the form
ninetieth percentile of the data in C4:C18 as 1
That is, assuming the data is sorted in ascend
of the way between the thirteenth data point (
yields 136.
The PERCENTILE.EXC function
th percentile
computes
as the
k
(n+1)
data set. PERCENTILE.EXC computes the ninetieth p
is the 14.4 ranked item. That is, the ninetieth p
ascending order) is computed to be 40 percent o
point (140) and the ffteenth data point (300). T
can see that the two functions return drastica
to have been drawn by sampling from a large se
data you’ve seen, there is much more than a 10 p
be more than 136. After all, two of the 15 dat
reasonable to say that the ninetieth percentil
ninetieth percentile is 204 seems more reasona
function instead of the .INC function. Note
-
th
centile for 0 and 1. The .EXC stands for the f
the zero and one hundredth percentiles.
The PERCENTRANK, PERCENTRANK.INC, and PERCENTR
ranking of an observation relative to all valu
PERCENTRANK.EXC function, for
data,value
example,
)
.
The
is PERC
PERCENTRANK and PERCENTRANK.INC functions both c
k
th smallest number in. the
Thus,
data
as set
shown
as in
(k-1)/(n
cell E
or PERCENTILE.INC function yields a rank of 0 f
PERCENTRANK.EXC function th
computes
smallest
thedata
rank
. In
poin
of th
cell D4, the PERCENTRANK.EXC function returns a r
of 6.25 percent seems more realistic than a ra
to think that a value of 10 is the smallest da
was sampled.
Not
The PERCENTILE and PERCENTRANK functions are ea
PERCENTILE yields a value of the data, whereas PER

344
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I easily find the second largest or secon
The formula
=LARGE(range,k)
th largest
returns
number the
in a
k
cell r
=SMALL(range,k)
th returns
smallestthe
number
k
in a cell range. F
Trimmean.xlsx, in cell F1, the formula
=LARGE(C4
in the cell range C4:C62 (99), whereas in cell F
second smallest number in the cell range C4:C62 (
Fig
URE 42-7
Examples of the LARGE and SMALL functions, the RAN
trimmed mean.
How can I rank numbers in a data set?
In previous versions of Excel, you used the RANK f
The syntax of the RANK
number,array,
function
0). Excel
is 2010
RANK(
-
includes a n
tion, RANK.EQ, which returns results identical t
rank of a number in a given array, where, the lar
the second largest
, and
number
so on.
is The
number,array,
ranksyntax
2
1) orRANK(
RANK.
EQ(
number,array,
1) results in assigning a rank of
1
to th
of
2
to the second smallest number, and so on. I
copying the formula
RANK.EQ(C4,$C$4,$C$62,0)
fro
of each test score. For example, the score of 10
scores of 98 in cells C21 and C22 tied for third hi
a 3 for both scores of 98.

Chapter
Summarizing
42
Data by Using
345
Descriptive Statistics
The new Excel 2010 function RANK.AVG
functions,
has the s
but in the case of ties, RANK.AVG returns the a
example, since the two scores of 98 ranked thi
I generated the average ranks by copying the f
to E5:E62.
What is the trimmed mean of a data set?
Extreme skewness in a data set can distort the m
people usually use median as a measure of the d
is unaffected by many changes in the data. For e
sets:
Set 1: –5, –3, 0, 1, 3, 5, 7, 9, 11, 13, 15
Set 2: –20, –18, –15, –10, –8, 5, 6, 7, 8, 9, 1
These data sets have the same median (5), but t
“typical” value than the frst. The Excel TRIMM
values than the AVERAGE function, but it is mo
median. The formula
=TRIMMEAN(range,percent)
c
deleting the data points at the top percent di
2. For example, applying the TRIMMEAN function w
after deleting the top 5 percent and bottom 5 p
Trimmean.xlsx, the formula
=TRIMMEAN(C4:C62,.1
C4:C62 after deleting the three highest and th
F4, formula
the
TRIMMEAN(C4:C62,.05)
=
computes the mean o
deleting the top and bottom scores. This- calcu
dicate the deletion of 1.48 of the largest obs
1.48 results
deleting only the top and bottom observa
When I select a range of cells, is there an ea
describes the data in those cells?
To see the solution to this question, select th
the lower-right corner of your screen, the Exc
describing the numbers in the selected cell ra
range C4:C36, the mean is 90.39, there are 33 n
est value is 100. If you right-click the statu
Fig
URE 42-8
Statistics shown on the status bar.

346
Microsoft Excel 2010: Data Analysis and Business Modeling
Why do financial analysts often use the geometric m
on a stock?
The fle Geommean.xlsx contains the annual return
Fig
URE 42-9
Geometric mean.
Cell C9 indicates that the average annual return o
annual return on Stock 2 is 10 percent. This wou
investment. If you think about it, however, what w
year you will lose 50 percent and the next gain 7
$1.00 becomes.
1(1.7)(.5)=.85
Because Stock 1 never loses money
the better investment. Using the geometric mean a
helps to correctly conclude that Stock 1 is the b
numbers is th
simply
root the
of the
n
product of the numbers
mean of 1 and 4 is the square root of 4 (2), whe
cube root of 8 (also 2). To use the geometric me
an investment, you add 1 to each annual return a
numbers. Then subtract 1 from this result to obt
return.
The formula
GEOMMEAN(range)
=
fnds the geometric mean of n
estimate the average annual return on each stock
1.
Compute
1+each annual return
by copying
.
from C
2.
Copy from C16 to D16 the formula
.
=GEOMEAN(C12
The annual average return on Stock 1 is estimate
return on Stock 2 is –7.8 percent. Note that if S
during two consecutive years, $1 becomes
1(1–.07
2
=.85
, which agrees with com

Chapter
Summarizing
42
Data by Using
347
Descriptive Statistics
Problems
1.
Use the data in the fle Stock.xlsx to gener
stock.
2.
Use your answer to Problem 1 to compare the m
3.
City Power & Light produces voltage-regulati
equipment to Chicago. A voltage regulator i
voltage of 25–75 volts. The voltage held by e
each unit is shipped. The voltage is measur
sample of voltage measurements from each ci
Using descriptive statistics, comment on w
held by units before and after shipment.
What percentage of units are acceptable b
Do you have any suggestions about how to i
Light’s regulators?
Ten percent of all New York regulators ha
Five percent of all New York regulators h
value?
4.
In the fle Decadeincome.xlsx, you are given a s
1980 dollars) for a set of families sampled i
are representative of the whole United Stat
better off in 1990 than in 1980 because ave
5.
Use descriptive statistics to compare the a
bonds. Use the data contained in the fle Hi
6.
In 1970 and 1971, eligibility for the U.S. a
basis of a draft lottery number. The number wa
366 balls, one for each possible birth date
frst ball selected was given the number
-
1
i
days corresponded to the lowest numbers wer
contains the actual results of the 1970 and 1
drawing, January 1 received the number 305. U
that the 1970 draft lottery was not random a
the AVERAGE and MEDIAN functions to compute th
for each month.)

348
Microsoft Excel 2010: Data Analysis and Business Modeling
7.
The fle Jordan.xlsx gives the starting salari
graduates from the University of North Caroli
“typical” starting salary for a geography maj
highest average starting salary in 1984 was g
player Michael Jordan was a geography major!
8.
Use the LARGE or SMALL function to sort the a
Historicalinvest.xlsx. What advantage does thi
Sort button?
9.
Compare the mean, median, and trimmed mean (tr
data) of the annual returns on stocks, T-Bill
Historicalinvest.xlsx.
10.
Use the geometric mean to estimate the mean a
T-Bills in the fle Historicalinvest.xlsx.
11.
The fle Dow.xlsx contains monthly returns on th
years. Use this data to determine the three s
returns.
12.
Using the Dow.xlsx data again, determine the th
variability.
13.
Using the Dow.xlsx data, determine the three s
14.
Using the Dow.xlsx data, how do the trimmed-m
returns) differ from the overall mean returns
15.
The fle Incomedata.xlsx contains incomes of a r
the years 1975, 1985, 1995, and 2005. Describ
over this time period.
16.
The fle Coltsdata.xlsx contains yards gained by t
rushing and passing play. Describe how the ou
plays differ.

349
Chapter 43
Using PivotTables a
Describe Data
Questions answered in this chapter:
What is a PivotTable?
How can I use a PivotTable to summarize groc
What PivotTable layouts are available in Exc
Why is a PivotTable called a PivotTable?
How can I easily change the format in a Piva
How can I collapse and expand felds?
How do I sort and flter PivotTable felds?
How do I summarize a PivotTable by using a P
How do I use the Report Filter section of th
How do Excel 2010 slicers work?
How do I add blank rows or hide subtotals ia
How do I apply conditional formatting to a P
How can I update my calculations when I add n
I work for a small travel agency for which I n
funds are limited, so I want to mail the br
on travel. From information in a random sam
age, and the amount these people spent on tr
determine how gender and age influence a per
conclude about the type of person to whom I s
I’m doing market research about Volvo Cross C
what factors influence the likelihood that a f
information in a large sample of families, I k
family income (high or low). How can I dete
the likelihood that a family will purchase a s

350
Microsoft Excel 2010: Data Analysis and Business Modeling
I work for a manufacturer that sells microchi
predicted sales for Canada, France, and the Uni
I’m also given the, variance,
between actual
or
difference
and budgete
For each month and each combination of countr
following data: actual revenue, budgeted reve
a percentage of annual revenue, and variance a
How can I display this information?
What is a calculated feld?
How do I use a report flter or slicer?
How do I group items in a PivotTable?
What is a calculated item?
What is “drilling down”?
I often have to use specifc data in a PivotTa
sales in France of Chip 1. Unfortunately, thi
added to my PivotTable. Does Excel have a fun
April’s Chip 1 sales in France from the Pivot
Answers to This Chapter’s Quest
What is a PivotTable?
In numerous business situations, you need to ana
important insights. Imagine that you sell differ
different points in time. You might have hundred
PivotTables let you quickly summarize your data i
for your grocery store data, you could use a Piv
Amount spent per year in each store on each p
Total spending at each store
Total spending for each year
In a travel agency, as another example, you migh
whether the average amount spent on travel is in
factors. In analyzing automobile purchases, you’
families that buy a station wagon to the fractio
wagon. For a microchip manufacturer, you’d like t
for example, during April, and so on. A PivotTab
can use to slice and dice data. The easiest way t
to walk through some carefully constructed examp

Chapter
Using
43
PivotTables and Slicers
351
to Describe Data
anintroductory example and then illustrate many a
subsequent examples.
Note
Excel 2010 contains
slicers
a new that
feature
make
called
it much eas
to examine your data from many perspectives. I dis
How can I use a PivotTable to summarize grocer
The
Data
worksheet in the fle Groceriespt.xlsx c
(See Figure 43-1.) Each row contains the numbe
store, as well as the month and year of the sa
or ice cream) is also included. You would like t
each product group and product at each store. Y
breakdown during any subset of months in a giv
during January–June).
Fig
URE 43-1
Data for the grocery PivotTable example.
Before creating a PivotTable, you must have he
that the grocery data contains headings (Year, M
Revenue) in row 2. Place your cursor anywhere i
the Tables group on the Insert tab. Excel open
Figure 43-2, and makes an assumption about you
guessed that the data range was C2:I924.) By s
also refer to a database as a source for a Piv

352
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-2
The Create PivotTable dialog box.
After you click OK, you see the PivotTable Field L
Fig
URE 43-3
The PivotTable Field List.
You fll in the PivotTable Field List
, into
by dragging
the boxe
or
zones
. This step is critical to ensuring that the P
data in the manner you want. The four zones are a
Row Labels
Fields dragged here are listed on the l
in which they are added to the box. For examp
felds Year, Group, Product, and Store, in tha
data frst by year, then for each product grou
within each group, and fnally each product by s
a different zone or reorder the felds within a z
zone or by clicking the arrow to the right of th

Chapter
Using
43
PivotTables and Slicers
353
to Describe Data
Column Labels
Fields dragged here have their valu
PivotTable. To start out this example, we ha
Values
Fields dragged here are summarized math
Units and Revenue (in that order) to this z
culation you want to perform on a feld. In thi
and Units should be summed, which happens t
method of calculation for a data feld to an a
click the data feld and choose Value Field S
Value Field Settings command later in the c
Report
Beginning
Filter
in Excel 2007,
Report Filte
Field area. For felds dragged to the Report Fi
the feld values so that the PivotTable shows c
this example, I dragged Month to the Report Fi
subset of months, for example January–June, a
those months. Slicers in Excel 2010 make re
The completed PivotTable Field List is shown i
in Figure 43-5 and in the
All Row Fields
works
you can see that 233,161 units were sold for $
Ti
H
p
ere is some advice about navigating workbooks (
many worksheets. In the lower-right corner of the E
names), you will see four arrows. Clicking the lef
clicking the right-most arrow shows the last works
one worksheet to the left or right.
Not
T
e
o see the feld list, you need to be in a feld i
list, right-click any cell in the PivotTable and s
Fig
URE 43-4
Completed PivotTable Field List.

354
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-5
The Grocery PivotTable in compact form.
What PivotTable layouts are available in Excel 2
The PivotTable layout shown in .Figure
In the43-5
compact
is caf
the row felds are shown one on top of another. T
anywhere within the table. On the Design tab, in th
choose one of the following: Show In Compact For
(see Figure 43-6 and the
Outline Form
worksheet)
the
Tabular Form
worksheet).
Fig
URE 43-6
The outline format.

Chapter
Using
43
PivotTables and Slicers
355
to Describe Data
Fig
URE 43-7
The tabular format.
Why is a PivotTable called a PivotTable?
You can easily pivot felds from a row to a col
For example, by dragging the Year feld to the C
layout shown in Figure 43-8. (See the
Years Co
Fig
URE 43-8
The Years feld pivoted to the column feld.
How can I easily change the format in a PivotT
If you want to change the format of an entire c
heading and select Number Format from the Valu
format you want. For example, in the
Formatted $
as currency by double-clicking the Sum Of Reve
You can also change the format of a value feld by c

356
Microsoft Excel 2010: Data Analysis and Business Modeling
feld in the PivotTable Field List. Select Value Fi
then you can reformat the column as you want it.
From any cell in a PivotTable, you can select th
PivotTable styles.
How can I collapse and expand fields?
Expanding and collapsing felds (a feature introd
PivotTables. In Figure 43-5, you see minus (–) s
the minus sign collapses a feld and changes the s
expands the feld. For example, if you click the mi
you will fnd that in each year, cereal is contra
longer listed. See Figure 43-9 and the
Cerealcol
A6 brings back the detailed or expanded view lis
Fig
URE 43-9
The cereal feld collapsed.
You can also expand or contract an entire feld. G
feld, and select PivotTable Tools Options on the r
the green Expand Entire Field button (labeled wi
Field button (labeled with a minus sign). (See Fi
Fig
URE 43-10
The Expand Entire Field and Contract Entire Field b

Chapter
Using
43
PivotTables and Slicers
357
to Describe Data
For example, suppose you simply want to see fo
Pick any cell containing a group’s name (for e
on the ribbon, and click the Collapse Entire Fi
Figure 43-11 (the
Groups Collapsed
worksheet). S
brings you back to the original view.
Fig
URE 43-11
The Group feld collapsed.
How do I sort and filter PivotTable fields?
In Figure 43-5, the products are listed alphab
chocolate
is the frst type of milk listed. If y
alphabetical order, simply move the cursor to a
in the
All Row Fields
worksheet) and click the d
entry in A5. You will see the list of fltering o
A would list
whole milk
frst for milk,
plums
f
Initially, our PivotTable displays results frs
to see the data for 2005 frst, move the cursor t
and choose Sort Smallest To Largest from the a
At the bottom of the fltering optionsproducts
dialog b
to be displayed. You may want to frst clear Se
want to show.

358
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-12
PivotTable fltering options for the Product feld.
For another example of fltering, look at the
Dat
shown in Figure 43-13. The worksheet data contai
customer number, the amount paid, and the quarte
received. After dragging Customer to the Row Lab
and Paid to the Values box, the PivotTable shown i
worksheet in the Pcustomers.xlsx fle.)
Fig
URE 43-13
The Customer PivotTable data.

Chapter
Using
43
PivotTables and Slicers
359
to Describe Data
Fig
URE 43-14
The Customer PivotTable.
Naturally, you might like to show a list of ju
simply click the Row Labels arrow and select
-
V
tain the layout shown in Figure 43-15 (see the
Clear Filter, you can return to the original l
Fig
URE 43-15
Top 10 customers.
Suppose you simply want to see the top custome
Select the Row Labels fltering icon, select Va
shown in Figure 43-16.

360
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-16
Confguring the Top 10 Filter dialog box to show cu
The resulting PivotTable is in the
Top half
work
see, the top 14 customers generate a little more th
Fig
URE 43-17
The top customers generating half of the revenues.
Now let’s suppose you want to sort your customer
worksheet.) Right-click anywhere in the Quarter
Largest To Smallest. (See Figure 43-18.) The res1
that Customer 13 paid the most in Quarter 1, Cus
Fig
URE 43-18
Sorting on the Quarter 1 column.

Chapter
Using
43
PivotTables and Slicers
361
to Describe Data
Fig
URE 43-19
Customers sorted on Quarter 1 revenue.
How do I summarize a PivotTable by using a Piv
Excel makes it easy to visually summarize
laying
Pivot
out the data the way you want it inexpand
PivotCha
felds. In the grocery example, suppose you wan
food group’s unit sales. (See the
Chart 1
work
move the Year feld to a column feld and delete Re
to collapse the entire Group feld in the Row L
PivotChart. Simply click anywhere inside the t
pick the chart type you want to create. I chos
the chart in Figure 43-20. The chart shows tha
in 2006.

362
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-20
PivotChart for unit group sales trend.
How do I use the Report Filter section of the Pi
Recall that I placed Months in the Report Filter s
report flter, suppose that you want to summarize s
clicking the Filter icon in cell B2 of the
First 6 m
This results in the PivotTable shown in Figure 4
sold by product, group, and year for the months J
Fig
URE 43-21
A PivotTable summarizing January–June sales.

Chapter
Using
43
PivotTables and Slicers
363
to Describe Data
How do Excel 2010 slicers work?
The problem with a report flter is that a view
cannot easily see that the table summarizes Ja
solves this problem. To create a slicer for an
PivotTable, place your cursor anywhere
ribbon’s
in the P
Insert tab. In the worksheet Slicers of the fl
menu. Then I selected the Month and Product fe
Using a given slicer, you can select any subse
table.In the Month slicer, I selected (one at a t
months January through June. I did nothing to th
January–June sales. The slicers are shown in Fi
Fig
URE 43-22
Example of slicers for the Month and Product fel
If you click in a slicer, you see formatting o
How do I add blank rows or hide subtotals in a P
If you want to add a blank row between each gr
on the ribbon, click Blank Rows, and then clic
to hide subtotals or grand totals, select Pivot
Grand Totals. After adding blank rows and hidi
rows no totals
worksheet, shown in Figure 43-2
you can select PivotTable Options to open the
box, you can replace empty cells by using any c
using a 0.
Fig
URE 43-23
Grocery PivotTable without totals.

364
Microsoft Excel 2010: Data Analysis and Business Modeling
How do I apply conditional formatting to a Pivot
Suppose you want to apply data bars to the Units c
problem you’ll encounter is that subtotals and g
make the other data bars smaller than apply
they shoul
to all product sales, not the subtotals and gran
workbook Groceriespt.xlsx.) To apply the data ba
by placing the cursor in a cell containing a pro
then select the Sum Of Units column data (the ce
Conditional Formatting followed by Data Bars, an
New Formatting Rule dialog box shown in Figure 4
Fig
URE 43-24
New Formatting Rule dialog box for using condition
By selecting All Cells Showing “Sum of Units” Va
data bars apply only to cells listing unit sales f
worksheet and Figure 43-25.

Chapter
Using
43
PivotTables and Slicers
365
to Describe Data
Fig
URE 43-25
Data bars for a PivotTable.
How can I update my calculations when I add ne
If the data in your original set of rows chang
data changes by right-clicking the table and s
after choosing Options.
If you want data you add to be automatically i
you refresh it, you should name your original d
(See Chapter 26, “Tables,” for more informatio
If you want to change the range of data used t
Change Data Source on the Options tab. You can a
by selecting Move PivotTable.
I work for a small travel agency for .which
My
I n
funds are limited, so I want to mail the broch
ontravel
. From information in a random sample of 9
age, and the amount these people
. How can
spent
I use
on trav
thi
determine how gender and age influence a person
conclude about the type of person to whom I sh
To understand this data, you need to break it d
Average amount spent on travel by gender
Average amount spent on travel for each age g
Average amount spent on travel by gender fo

366
Microsoft Excel 2010: Data Analysis and Business Modeling
The data is included on the
Data
worksheet in th
in Figure 43-26. For example, the frst person is a 4
Let’s frst get a breakdown of spending by gender
extracts the range A2:D927. After clicking OK, p
appears. Next, drag the Gender column to the Row L
Travel to the Values zone. This results in the P
You can tell from the heading Sum Of Amount Spen
total amount spent on travel, but you actually wa
men and women. To calculate these quantities, do
and then select Average from the Value Field Set
Fig
URE 43-26
Travel agency data showing amount spent on travel, a
Fig
URE 43-27
PivotTable summarizing the total travel expenditur
Fig
URE 43-28
You can select a different summary function in the

Chapter
Using
43
PivotTables and Slicers
367
to Describe Data
You now see the results shown in Figure 43-29.
Fig
URE 43-29
Average travel expenditures by gender.
On average, people spend $908.13 on travel. Wo
men spend $914.99. This PivotTable indicates
-
th
sity to travel. By clicking the Row Labels arr
Now you want to see how age influences travel s
PivotTable, simply click Gender in the Row Lab
remove it from the Row Labels area. Then, to b
row area. The PivotTable now appears as it’s s
Fig
URE 43-30
PivotTable showing the average travel expenditur
Age seems to have little effect on travel expe
in its present state. You need to group data by a
age, right-click anywhere in the Age column an
you can designate the interval by which to defn
you obtain the PivotTable shown in Figure 43-3
On average, 25–34 year olds spend $935.84 on tr
travel, and so on. This information is more us
ages tend to spend about the same amount on tr
determine who you should mail your brochure to

368
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-31
Use the Group And Show Detail command to group det
Finally, let’s get a breakdown of average travel s
separately. All you have to do is drag Gender to th
resulting in the PivotTable shown in Figure 43-3
Fig
URE 43-32
Age/gender breakdown of travel spending.
Now we’re cooking! You can see that as age incre
men spend less. Now you know who should get the b
men. As one of my students said, “That would be s
A graph provides a nice summary of this analysis
PivotTable and choosing PivotChart, select the f
is the chart shown in Figure 43-33. If you want t
Tools. Then, for example, if you choose Layout, y
make other changes.
Fig
URE 43-33
PivotChart for the age/gender travel expenditure b

Chapter
Using
43
PivotTables and Slicers
369
to Describe Data
Each age group spends approximately the same o
spend more than men. (If you want to use a dif
type by right-clicking the PivotChart and then c
Notice that the bars showing expenditures by m
representing the amount spent by women increas
that showed only gender and age data failed
-
to u
ple population are men and half are women, we f
people does not depend on the age. (Notice tha
age is approximately the same.) We also found th
women was approximately the same. You can see thi
blue and red bars have approximately equal
-
hei
ously across age and gender does a much better j
i’m doing market research about Volvo Cross Cou
what factors influence the likelihood that a fa
From information in a large sample of families
and the family income (high or low). How can i
influence the likelihood that a family will pur
In the fle Station.xlsx, you can fnd the follow
Is the family size large or small?
Is the family’s income high or low?
Did the family buy a station wagon? Yes or N
A sample of the data is shown in Figure 43-34 (
family listed is a small, high-income family th
Fig
URE 43-34
Data collected about income, family size, and th

370
Microsoft Excel 2010: Data Analysis and Business Modeling
You want to determine how family size and income i
will purchase a station wagon. The trick is to l
family size and how family size affects purchase
To begin, choose Insert Pivot Table, and then se
the PivotTable Field List, drag Family Size to th
Column Labels area, and any of the three felds t
shown in Figure 43-35 (see the
1st Table
- workshe
marize the data appropriately by counting the nu
example, 34 high-salary, large families did not b
large families did buy one.
Fig
URE 43-35
Summary of station wagon ownership by family size a
You would like to know for each row in the Pivot
purchased a station wagon. To display the data i
PivotTable data and then choose Value Field Setti
dialog box. In the dialog box, click Show Values A
Data As list. You now obtain the PivotTable show
Breakdown
worksheet.)
Fig
URE 43-36
Percentage breakdown of station wagon ownership by i
From Figure 43-36 you learn that for both large a
on whether the family purchases a station wagon. N

Chapter
Using
43
PivotTables and Slicers
371
to Describe Data
size affects the propensity to buy a station wa
To do this, move Salary above Family Size in th
shown in Figure 43-37 (see the Final Percent B
Fig
URE 43-37
Breakdown of station wagon ownership by family s
From this table, you learn that for high-incom
buy a station wagon than a small family. Simil
also more likely to purchase a wagon than a sm
has a much greater effect on the likelihood th
does income.
I work for a manufacturer that
. I’m given
sells monthly
microchip
a
predicted sales for Canada, France, and the Un
I’m also given the variance, or difference,
.
be
For each month and each combination of country a
following data: actual revenue, budgeted reven
percentage of annual revenue, and variance
. How as a p
can I display this information?
In this scenario, you are a fnance manager for a mi
products in different countries and at differe
your data in a format that’s easily understood
The fle Ptableexample.xlsx includes monthly ac
Chip 1, Chip 2, and Chip 3 in Canada, France, a
variance, or difference, between actual revenu
data is shown in Figure 43-38 (see the data wo
sales of Chip 1 totaled $4,000, although sales o
variance of –$1,454.

372
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-38
Chip data from different countries for different m
variance revenues.
For each month and each combination of country a
following data:
Actual revenue
Budgeted revenue
Actual variance
Actual revenue as a percentage of annual reve
Variance as a percentage of budgeted revenue
To begin, select a cell within the range of data y
frst row must include headings), and then choose I
determines that your data is in the range A1:F20
If you drag Month to the Row Labels area, Countr
to the Values area, for example, you obtain the t
feld you add to the Report Filter area (Product, f
by using values in that feld. By adding Product t
of only Chip 1 by month for each country. Given th
any combination of country and product, you shou
of the PivotTable and both Country and Product t
Revenue, and Budget to the Values zone. You have n
in Figure 43-39. (See the 1st Table worksheet.)

Chapter
Using
43
PivotTables and Slicers
373
to Describe Data
Fig
URE 43-39
Monthly summary of revenue, budget, and variance
For example, in January, total revenue was $87
actual sales fell $4,297 short of the forecast
You want to determine the percentage of revenu
Revenue from the feld list to the Values area o
column, and then choose Value Field Settings. I
Show Values As. In the Show Values As list, se
Of Revenue2, as shown in Figure 43-40.
Fig
URE 43-40
Creating each month’s percentage of annual reven
You now obtain the PivotTable shown in Figure 4
sales provided 8.53 percent of revenue. Total r

374
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-41
Monthly revenue breakdown.
What is a calculated field?
Now you want to determine for each month the var
do this, you can create
. Select
a
calculated
cell anywhere
feld
withi
PivotTable, and then choose Formulas on the Opti
display the Insert Calculated Field dialog box. A
your feld, and then enter your formula.You
Thecan
form
enter the formula yourself or use the list of fe
the formula. After clicking Add and then OK, you s
(See the
Calc Field
worksheet of the Ptableexamp
Fig
URE 43-42
Creating a calculated feld.

Chapter
Using
43
PivotTables and Slicers
375
to Describe Data
Fig
URE 43-43
The PivotTable with calculated feld for variance p
Thus, in January, sales were 4.7 percent lower th
Calculated Field dialog box again, you can mod
How do I
report
use afilter or slicer?
To see sales of Chip 2 in France, for example, y
Product and Country felds in the Report Filter a
would see the PivotTable shown in Figure 43-44
table with slicers (see the
Slicers
worksheet)
Fig
URE 43-44
Sales of Chip 2 in France.
In the worksheet
Slicers,
I used Slicers to cr
and selected Slicers from the Insert tab. Then I c
selecting the Product and Country felds. Selec
from the Country slicer yields the relevant co
in France. If you want to resize a slicer, hol

376
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-45
Sales of Chip 2 in France with slicers.
How do I group items in a PivotTable?
Often, you want to group headings in a PivotTabl
sales for January–March. To create a group, sele
the selection, and then choose Group And Show De
Group 1 to Jan-March, you obtain the PivotTable s
Fig
URE 43-46
Grouping items together for January, February, and M
Remarks About Grouping
You can disband a group by selecting Group An
You can group nonadjacent selections by holdi
nonadjacent rows or columns.

Chapter
Using
43
PivotTables and Slicers
377
to Describe Data
With numerical values or dates in a row fel
arbitrary intervals. For example, you can c
average income for all 25–34 year olds.
What is a calculated item?
A calculated item works just like a calculated f
rather than a column. To create a calculated i
of the PivotTable, not an item in the body
-
of th
lect Formulas, followed by Calculated Item. Se
chapter for an example of creating a calculate
example, you could not create a calculated ite
Revenue feld.
What is “drilling down”?
“Drilling down” is double-clicking a cell in a
summarized in that feld. For example, double-c
scenario displays the data that’s related to M
I often have to use specific data in a PivotTab
in France . of
Unfortunately,
Chip 1
this data moves arou
my PivotTable
. Does Excel have a function that enabl
sales in France from the PivotTable?
Yes, there is such a function. The GETPIVOTDAT
to extract sales of Chip 1 in France during Ap
worksheet in the fle Getpivotdata.xlsx. (See Fi
GETPIVOTDATA(A4,”April France Chip 1 Sum of Re
even if additional products, countries, and mo
also determine the resulting revenue by pointi
France (cell D24).
The frst argument for this function is in the c
(cell A4). You enclose in quotation marks (sep
defne the entry you want. The last entry must s
be listed in any order. Thus, the formula here m
corner is in cell A4, fnd the Sum of Revenue f
returns the correct answer even if the sales d
different location in the PivotTable.

378
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 43-47
Use the GETPIVOTDATA function to locate April Chip 1 S
If you want to simply return total revenue ($1,0
GETPIVOTDATA(A4,”Sum
.
of Revenue”)
Often, the GETPIVOTDATA function is a nuisance. I
to use it. Suppose you want to refer to data in c
your workbook. You would probably use the formul
Hopefully, this would extract B6, B7,…, B11 to th
GETPIVOTDATA option is active, you get a bunch o
the same cell. If you want to turn off GETPIVOTD
Select Formulas, and under Working With Formulas
PivotTable References. This ensures that clickin
rather than a GETPIVOTDATA function.
Finally, note that you can also combine the MATC
Chapter 5, “The MATCH Function,” and Chapter 22, “
extract various PivotTable entries.
Problems
1.
Contoso, Ltd. produces microchips. Five types o
known to occur. Chips are manufactured by two o
machines (1–4). You are given data about a sa
the type of defect, the operator, machine num
occurred. Use this data to chart a course of a
possible, to improved product quality. You sh
defects with respect to type of defect, day o
working. You might even want to break down th
on. Assume that each operator and machine mad
fnd this data in the fle Contoso.xlsx.

Chapter
Using
43
PivotTables and Slicers
379
to Describe Data
2.
You own a fast food restaurant and have don
better understand your customers. For a ran
the income, gender, and number of days per w
Use this information to determine how gende
with which a person goes out to eat fast fo
3.
Students at the School of Fine Art apply to s
been assigned to determine whether the Scho
women in admitting students to the school o
data on the School of Fine Art’s students:
Female or male
Major applied for: English (Eng) or Scien
Admit? Yes or No
Assuming that women are as equally qualifed f
indicate that the college discriminates agai
information. The data is in the fle Fineart
4.
You have been assigned to evaluate the quali
at Emergency Room (ER) and Chicago Hope (CH
following patient data:
Hospital (ER or CH).
Risk category (high or low). High-risk pe
low-risk people.
Patient outcome (live or die).
Use this data to determine which hospital i
attack patients. Hint: Use all the data. Th
5.
You are given the monthly level of the Dow J
Does this data indicate any unusual seasona
extract the month (January, February,
TEXT(A4,”mmm”
and s
copied to any column. The data is in the fl
6.
The fle Makeupdb.xlsx contains information a
each transaction, you are given the followi
Name of salesperson
Date of sale
Product sold
Units sold
Transaction revenue

380
Microsoft Excel 2010: Data Analysis and Business Modeling
Create a PivotTable to compile the following i
The number of sales transactions for each s
For each salesperson, the total revenue by p
Using your answer to the previous question, c
Jen’s lipstick sales.
Total revenue generated by each salesperson b
Total revenue by salesperson and year. (Hin
7.
For the years 1985–1992, you are given monthl
money one year after the day they’re bought. I
are more volatile—tend to change more—when in
in the fle Intratevol-volatility.xlsx support thi
standard deviations.
8.
For the grocery example, prepare a chart that s
sales at each store.
9.
For the grocery example, create a calculate f
price received for each product.
10.
For the grocery example, create a PivotChart t
at each store for the years 2005 and 2006.
11.
For the data in the fle Calcitemdata.xlsx, cr
of dessert
cakes+puddings
() and
apples+grapes
fruits).(
12.
In the chip PivotTable example, create a Pivot
Chips 1 and 3 in France and the U.S.
13.
In the customer PivotTable example, show the t
bottom 5 customers in another table.
14.
The fle Ptablepartsdata.xlsx contains sales o
either Part (for
) or
computer
Comp (for
).
part
Create
computer
a PivotTable th
only sales of Parts. (Hint: Use a labels flte
15.
For the data in Problem 14, summarize the tot
16.
The fle Cigarettedata.xlsx contains the age o
smoke cigarettes or cigars, and whether they d
you conclude from this data?
17.
The fle Collegedata.xls tells you the
applied
followi
to graduate school at Kelley University: gend
rejected. If you construct the appropriate Pi
accepted than men. Do you think Kelley discri

381
Chapter 44
Sparklines
Questions answered in this chapter:
How can you graphically summarize daily cus
branches in a single cell?
How can you modify sparklines?
How can you summarize an NFL team’s sequence o
Do sparklines automatically update when new d
Sparklines are exciting graphics that can summ
The term
sparkline
was frst used by Edward
-
Tuf
tation of data and its analysis. Tufte describ
word-sized graphics.” Microsoft Excel 2010 mak
reside in a single cell.
Answers to This Chapter’s Ques
How can you graphically summarize daily custom
in a single cell?
The fle Sparklines.xlsx contains daily custome
state bank. See Figure 44-1.
Fig
URE 44-1
Data for sparklines.
Let’s say that you want to summarize the weekl
daily counts for each branch in a single cell. S
your
sparklines to go (I chose I8:I14), and then f
Sparklines group shown in Figure 44-2.

382
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 44-2
Sparkline choices.
Then fll in the dialog box below with the data o
Fig
URE 44-3
Creating line sparklines.
You now see a line graph (Figure 44-4) that summ
You can see this in the worksheet
Line Sparkline
Fig
URE 44-4
Line sparklines summarizing branch traffc.
You can see that for each branch, Monday and Fri
How can you modify sparklines?
If you click in any cell containing a sparkline, t
selecting the Design tab, you can make many chan
shown in Figure 44-5, I selected the high and low p
The resulting sparklines are shown in Figure 44-
Sparklines.xlsx.

Chapter
Sparklines
44
383
Fig
URE 44-5
Selecting high and low points to mark on sparkli
Fig
URE 44-6
High and low points marked on sparklines.
These sparklines make it clear that Friday is th
Wednesday is the least busy day.
From the Design tab you can make the following c
Change the type of sparkline (line, column, o
sparklines later in the chapter.
Use the Edit Data command to change the dat
also change the default setting so that hid
Select any combination of the high point, l
point to be marked.
Change the style or color associated with th
By selecting Axis, you can change the way th
example, you can make the x-axis or y-axis s
default is to base the scale for each axis o
is the scaling used in Figure 44-4. The Cus
lower limit for each axis.
When data points occur at irregularly space
Axis option so that the graphed points
- are s
tional to the differences in dates.
irregularly
Figure s
dates (see the worksheet
Date Axis
in the fl
is graphed as though the dates are spaced a
choosing the range C10:C13 to use as the dat
irregular date spacing.

384
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 44-7
Sparklines with a data axis.
You can also change line sparklines to column sp
selecting Column from the Sparklines Tools Desig
Column Sparkline
in the fle Sparklines.xlsx.
Fig
URE 44-8
Column sparkline graph.
How can you summarize an NFL team’s sequence of w
The fle Nflwinslosses.xlsx contains theduring
game by ga
the 2009 regular season. A subset of this data i
worksheet).
Fig
URE 44-9
Sparklines summarizing wins and losses for NFL tea

Chapter
Sparklines
44
385
A 1 denotes a win, and a –1 a loss. Each win/l
“up block” and any negative number as a “down b
create the win/loss sparklines, select the ran
range C8:C39), and then select Win/Loss from t
choose the data range E8:T39. The sparklines m
see the amazing starts of the Indianapolis Col
that the Tennessee Titans started poorly and th
well and then hit a rough patch. Win/loss spar
progress toward meeting quotas or goals. See P
Do Sparklines automatically update when new da
If you want your sparklines to automatically u
the data a table (see Chapter 26, “Tables”) or c
Chapter 22, “The OFFSET Function.”)
Problems
1.
For the bank branch data, make your line sp
2.
The data Dow.xlsx contains the values of th
2010. Create a line sparkline to show the up
3.
Use win/loss sparklines to capture the mark
Dow.xlsx.
4.
The fle Goals.xlsx shows the percentage amo
to meet their goals each month. Summarize thi

387
Chapter 45
Summarizing Data wi
Statistical Functio
Questions answered in this chapter
Joolas is a small makeup company that track
Excel 2010 worksheet. Often, they want to a
How many dollars worth of lip gloss did J
What was the average number of lipstick u
the East region?
What was the total dollar amount of all m
region?
How many dollars worth of lipstick were s
region?
How many lipstick transactions were not i
How many dollars worth of lipstick did Je
How many units of makeup were sold for a p
What is the total dollar amount each sale
What helpful tricks can I use to set up c
I have a database that lists for each sales
product ID code. Given the date sold and th
way to extract the transaction’s revenue?
As you saw in Chapter 43, “Using PivotTables a
are a great tool for summarizing
PivotTable
data.
gives
Often,
you mh
information than you need.
Database statistica
“reporting” question without having to create a P
You are already familiar with functions such a
prefxing a
D
(which
) to
stands
thesefor
and
database
other functio
statistical functions. But what does the- DSUM f
tion can’t? Whereas the SUM function adds up e
enables you to specify (by using criteria) a s

388
Microsoft Excel 2010: Data Analysis and Business Modeling
example, suppose you have a sales database for a s
following information about each sales transacti
Name of salesperson
Transaction date
Product sold
Units sold
Dollars of revenue generated per transaction
Region of the country where the transaction t
You can fnd this data in the fle Makeupdb.xlsx, w
Fig
URE 45-1
We’ll use this data to describe how to work with da
Using the DSUM function with appropriate criteria
revenue generated only by transactions involving l
Essentially, the criteria you set up flags those r
Within these rows, the DSUM function acts like th
The syntax of the DSUM function is
DSUM(database
Database
is the cell range that makes up the d
labels for each column.
Field
is the column containing the values you wa
the feld by enclosing the column label in quot
designate the Dollars column by entering “Dol
by using the position of the column in the da
example, the makeup transaction database woul

Chapter
Summarizing
45
Data with Database
389
Statistical Functions
include the Transactions column as part of th
as
feld 1
and column
.
M as
feld 6
A
criterion
refers to a cell range that spe
operate. The frst row of a criteria range m
only exception to this
, which
rule is
I’ll
computed
discuss
-
cri
in th
ples in this chapter.) As the examples illus
understand that multiple criteria in the sa
different rows are joined by OR.
Now let’s go on to some examples that illustra
statistical functions.
Answers to This Chapter’s Ques
How many dollars’ worth of lip gloss did Jen s
In this example, you want to apply DSUM to col
the dollar volume for each transaction. (I gav
of the range H4:M1895.) The criteria range in O
Name equals Jen
and
Product equals lip gloss. T
the formula
DSUM(data,5,O4:P5)
calculates the t
You could have also entered the .formula
Jen sold
as $5,4
DSU
worth of lip gloss. In cell N6 you can fnd the s
Chapter 21, “The SUMIF, AVERAGEIF, SUMIFS, and A
=
SUMIFS(Dollars,Name,”Jen”,Product,”lip
.
gloss”
Fig
URE 45-2
Database statistical functions at work.

390
Microsoft Excel 2010: Data Analysis and Business Modeling
What was the average number of lipstick units so
region?
You can compute this number by entering .in cell N
Using 4 as the value for
feld
specifes the Units c
rows in the database in which Name equals Jen, P
East. Using DAVERAGE ensures that you average th
see that on average, Jen sold 42.25 units of lip
N9, you can calculate the same
AVERAGEIFS(Units,Name
answer by using th
Product,”lipstick”,Location,”east”)
.
What was the total dollar amount of all makeup s
In cell N11, you can compute the total dollars (
East by using the formula
. The
DSUM(data,5,O10:P12)
criteria in O10:P12 fl
East
or
by Emilee, because criteria in different r
programmers at Microsoft have ensured that this f
sales in the East. Here, you cannot use SUMIFS t
How many dollars’ worth of lipstick were sold by C
The formula
DSUM(data,5,O13:Q15)
in cell N14
generated
computes
through Colleen and Zaret’s sales ($1,073.20) in th
criteria that selects Colleen’s lipstick sales i
selects Zaret’s lipstick sales in the East. Reme
OR. In cell N15, the answer to this question is c
=SUMIFS(Dollars,Name,”Colleen”,Product,”lipstick”,Location,”east”)
+SUMIFS(Dollars,Name,”Zaret”,Product,”lipstick”,Location,”east”)
How many lipstick transactions were not in the E
In cell N17, you can compute the total number of l
region with the formula
. You
DCOUNT(data,4,O16:P17)
use DCOUNT in this p
you want to specify criteria by which the functi
lipstick sales and regions other than the East. E
range as “not East.” For this problem, using SUM
function for each region.
Because the COUNT function counts numbers, you n
numerical values. Column 4, the Units column, co
umn in the formula. The formula
DCOUNT(data,3,O1
no numbers in the database’s third column (which i
the formula
DCOUNTA(data,3,O16:P17)
would return th
counts text as well as numbers.

Chapter
Summarizing
45
Data with Database
391
Statistical Functions
How many dollars’ worth of lipstick did Jen se
The trick here is knowing how to flag only sale
row of your criteria range a reference to the
and
<1/1/2005
captures only the 2004 sales. Th
DSUM(data,5,O18:R19)
computes the total lipsti
2004, and before January 1, 2005. In cell N20, t
the formula
=SUMIFS(Dollars,Date,”>=1/1/2004”,
me,”Jen”).
How many units of makeup were20?
sold for a price o
This example involves
. Basically,
computed
computed
criteria
criteria fl
database on the basis of whether a computed co
question, you want to flag each row that contai
a computed criteria (see Figure 45-3), the lab
must not
be a column label. For example, you c
from row 4 of this worksheet. The computed cri
True based on the frst row of information in th
the average price is greater than or equal to $
your criteria range below a heading that is not a c
not satisfy this condition, you will see FALSE i
rows having a unit price that’s greater than o
DSUM(data,4,O21:O22)
computes the total number o
for which the unit price was greater than or e
formula
=(L5/K5)>=3.2
Fig
URE 45-3
Computed criteria.
What is the total dollar amount each salespers
For this problem, I’d like to use a DSUM functi
Name and Product columns. Using a data table,
-
I c
binations of Name and Product in the criteria r
Name and Product combination.
I begin by entering any name in cell X26 and a
Q25 the formula
DSUM(data,5,X25:Y26)
which computes total sales r
Betsy and eye liner. Next, I enter each salesp
product in the cell range R25:V25. Now select th
tab, in the Data Tools group, click What-If An
X26 as the column input cell and Y26 as the row i

392
Microsoft Excel 2010: Data Analysis and Business Modeling
in Figure 45-4. Each entry in the data table com
name/product combination because the data table c
X26 and the products to be placed in cell Y26. F
lipstick.
Fig
URE 45-4
Combining data tables with a DSUM function.
This example shows how combining data tables with d
quickly generate many statistics of interest. Not
from cell R37 to R37:V45
SUMIFS(Dollars,Name,$Q37,Produc
the formula
=
What helpful tricks can I use to set up criteria r
Here are some examples of little tricks that mig
range. Suppose the column label in the frst row o
containing text (for example, column H).
*Allie*
will flag records containing the text s
A?X
will flag a record if the record’s column H e
third character. (The second character can be a
<>*B*
will flag a record if column
s.
H’s entry do
If a column (for example, column I) contains num
>100
will flag a record if column I contains a v
<>100
will flag a record if column I contains a v
>=1000
will flag a record if column I contains a v
I have a database that lists for each sales tran
product ID
. Given
code the date sold and the ID code fo
way to capture the transaction’s revenue?
The fle Dget.xlsx (see Figure 45-5) contains
product a d
ID codes for a series of sales transactions. If y

Chapter
Summarizing
45
Data with Database
393
Statistical Functions
for a transaction, how can you fnd the transac
simple. The syntax of the DGET function
. Given aiscell
DGE
r
for
database
and a value for
feld#
in the data
the range), the DGET function returns the entr
satisfying the criteria. If no record satisfes th
error message. If more than one record satisfe
#NUM! error message.
Suppose that you want to know the revenue for a tr
62426 that occurred on 1/9/2006. Assuming that th
the given date is unique, the formula (entered i
transaction’s revenue of $169. Note that I use
is listed in the frst column of the database (
The criteria range G5:H6 ensures that you fnd a t
1/9/2006.
Fig
URE 45-5
Using the DGET function.
Problems
1.
How many units of lip gloss did Zaret sell d
2.
Create a data table that contains each pers
3.
How many units of lip gloss did Colleen sel
4.
Using the data in fle Makeupdb.xlsx, create a d
unit revenue generated by each person for s
exceeded $3.30.

394
Microsoft Excel 2010: Data Analysis and Business Modeling
5.
Use the data in the fle Sales.xlsx to determi
Total dollar sales in the Midwest
Total dollars that Heather sold in the East
Total dollars that Heather sold or that wer
Total dollars sold in the East by Heather o
Number of transactions in the East region
Number of transactions with greater than av
Total sales not in the Midwest
6.
The fle Housepricedata.xlsx contains the foll
Square footage
Price
Number of bathrooms
Number of bedrooms
Use this information to answer the following q
What is the average price of all homes havi
bedrooms greater than or equal to six?
How many homes sell for more than $300,000 a
bedrooms and bathrooms less than or equal t
How many homes have at least three bathroom
bedrooms and bathrooms is less than or equa
What is the highest price of a home
total
having a
number of bedrooms and bathrooms less than o
DMAX function to solve this problem.)
7.
The fle Deciles.xlsx contains the unpaid bala
to compute the total unpaid balances in each d

395
Chapter 46
Filtering Data and R
Duplicates
Questions answered in this chapter:
Joolas is a small company that manufactures ma
transaction in a Microsoft Excel 2010 workshee
out,” a subset of their sales data. For exampl
that answer the following questions:
How can I identify all transactions in whic
How can I identify all transactions in whic
the East or South region?
How can I copy all transactions in which Ci
East or South region to a different workshe
How do I clear flters from a column or data
How can I identify all transactions that in
than 90 units?
How can I identify all sales occurring in 2
How can I identify all transactions in the l
months of 2006?
How can I identify all transactions for whi
How can I identify all transactions for whi
colored in red?
How can I identify all transactions in the
was the salesperson?
How can I easily obtain a complete list of s
How can I view every combination of salespe
the database?
If my data changes, how can I reapply the s
How can I extract all foundation transactio
Emilee or Jen was the salesperson and the a
Microsoft Excel 2010 has fltering capabilities th
snap. Excel also makes it easy to remove dupli

396
Microsoft Excel 2010: Data Analysis and Business Modeling
for this chapter in the fle Makeupflter.xlsx. Fo
(Figure 46-1 shows a subset of the data), you ha
Transaction number
Name of the salesperson
Date of the transaction
Product sold
Units sold
Dollar amount of the transaction
Transaction location
Fig
URE 46-1
Makeup sales data.
Each column (C through I) of our database
. Each row
(cell r
of the database that contains
. (Thus,data
the is
records
calledina o
r
contained in the cell range C4:I1894.) The frst r
For example, the name of the feld in column F is P
can query the database using AND criteria to ide
you can use queries of the form “Find all record
and
Field 2 satisfes certain conditions,
and
Fie
examples illustrate the capabilities of the Exce

Chapter
Filtering
46
Data and Removing
397
Duplicates
Answers to This Chapter’s Ques
How can I identify all transactions in which J
To begin, place your cursor anywhere in the da
group on the Data tab on the ribbon. As shown i
now has an arrow in the heading row (see the
D
Fig
URE 46-2
AutoFilter heading arrows.
After clicking the arrow for the Name column, y
You could choose Text Filters, which allows
-
yo
son’s name (more on this later). For now, you ju
clear the Select All check box, then select th
see only those records for which Jen was the s
and select the lipstick check box. Then go to th
box. You now see only those transactions for w
Figure 46-4 and the
Lipstick Jen East
workshee
cone in the columns in which you set up flteri

398
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 46-3
Choices for fltering or sorting the Name column.
Fig
URE 46-4
Jen sells lipstick in the East region.
How can I identify all transactions in which Cic
East or South region?
You simply select Cici and Colleen from the Name c
the Product column list, and East and South from t
meeting this fltering criteria are shown in Figu
Masc
worksheet).

Chapter
Filtering
46
Data and Removing
399
Duplicates
Fig
URE 46-5
Transactions in which Cici or Colleen sold lipst
How can I copy all transactions in which Cici o
or South region to a different worksheet?
The trick here is to frst press F5, click Spec
Now when you copy your data, Excel includes on
selected by the fltering criteria). Select all th
lipstick, and mascara) and paste them into a b
worksheet in your workbook by right-clicking a
Worksheet, then clicking OK. The worksheet
Vis
Cici or Colleen sold lipstick or mascara in th
How do I clear filters from a column or databas
Clicking Filter on the Data tab removes all fl
you created a flter displays an option to clea
How can I identify all transactions that invol
90 units?
After clicking Filter on the Data tab, frst cl
shown in Figure 46-6.

400
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 46-6
Filtering options for a numerical column.
You can check any subset of numerical unit value
sales were –10 or –8 units). I clicked Number Fi
Fig
URE 46-7
Number Filters options.
Most of the options you see in the fgure are sel
Than option and then fll in the dialog box as sh

Chapter
Filtering
46
Data and Removing
401
Duplicates
Fig
URE 46-8
Selecting all records where units sold is greate
Next, go to the Dollars column and click to in
is greater than $280. You obtain the records s
dollars > $280
worksheet). Note that all selec
dollars greater than $280.
Fig
URE 46-9
Transactions where more than 90 units were sold f
How can I identify all sales occurring in 2005 o
After clicking Filter on the ribbon, click the a
choices in Figure 46-10.

402
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 46-10
Filtering options for the Date column.
After selecting 2005 and 2006, you see only thos
shown in Figure 46-11 (see the
Sales In 2005 And 2
Fig
URE 46-11
Sales during 2005 and 2006.
Note that you could also have selected Date Filt
Figure 46-12.

Chapter
Filtering
46
Data and Removing
403
Duplicates
Fig
URE 46-12
Date Filters options.
Most of these options are self-explanatory as w
select any range of dates as your fltering cri
How can I identify all transactions in the las
months of 2006?
After clicking the arrow for the Date column,
earlier. Clicking the + sign to the left of th
October through December of 2005 and then Janu
sales during those months. (See Figure 46-13 a
Fig
URE 46-13
All sales during October 2005–March 2006.

404
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I identify all transactions for which th
Simply click the Name column arrow, and choose T
the dialog box shown in Figure 46-14, choose Beg
Fig
URE 46-14
Custom AutoFilter dialog box set up to select all r
begins with C.
How can I identify all transactions for which th
colored in red?
Click the Product column arrow, and then choose
color to use as a flter. As shown in Figure 46-1
the product is colored in red. Figure 46-16 show
worksheet).
Fig
URE 46-15
Dialog box for fltering by cell color.

Chapter
Filtering
46
Data and Removing
405
Duplicates
Fig
URE 46-16
All records where the product cell color is red.
How can I identify all transactions in the top 3
was the salesperson?
After clicking Filter on the ribbon, you click th
check boxes for Hallagan and Jen. Then you cli
Number Filters. From the Number Filters list, s
dialog box as shown in Figure 46-17. You have n
values in which Jen or Hallagan is the salespe
30 $s With Hallagan Or Jen
worksheet). Note th
or Jen as the salesperson. You can also select T
for any numerical column.
Fig
URE 46-17
Dialog box to select the top 30 records by dolla
Fig
URE 46-18
Top 30 records by dollar value for which Jen or H
How can I easily obtain a complete list of sal
Here we want a list of all the salespeople, wi
selecting Remove Duplicates on the Data tab on th
dialog box shown in Figure 46-19. After choosi
box, and then click OK. This setting flters th
salesperson’s name. See the results in Figure 4
worksheet.

406
Microsoft Excel 2010: Data Analysis and Business Modeling
Important
Because selecting Remove Duplicates removes so
making a copy of your data before selecting Remove D
Fig
URE 46-19
Remove Duplicates dialog box.
Fig
URE 46-20
List of salespersons’ names.
How can I view every combination of salesperson, p
the database?
Here again you need to click Remove Duplicates o
Remove Duplicates dialog box as shown in Figure 4

Chapter
Filtering
46
Data and Removing
407
Duplicates
Fig
URE 46-21
Finding unique salesperson, product, and locatio
Figure 46-22 lists the frst record for each co
occurring in the database (see the
Unique Name P
and eighty unique combinations occurred. Note th
because it included Zaret selling lip gloss in th
picked up this combination.
Fig
URE 46-22
List of unique salesperson, product, and locatio
If my data changes, how can I reapply the same fil
Simply right-click any cell in your fltered re
changes to your data are reflected in the flter

408
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I extract all foundation transactions in t
Emilee or Jen was the salesperson and 20?
the averag
The AutoFilter feature (even with the Custom opti
columns. This means, for example, that you cannot f
by Jen during 2005
OR
foundation sales by Zaret d
queries such as this one, you need to use the Ad
you set up a criteria range that specifes the re
described in detail in Chapter 45, “Summarizing Da
After specifying the criteria range, you tell Ex
to the current location or to a different locati
the frst six months of 2005 for which Emilee or J
average per-unit price was more than $3.20, you c
range O4:S6 in Figure 46-23. (See the
Jen + Emil
Fig
URE 46-23
Setting up a criteria range to use with an advance
In cells R5 and R6, I entered
. Recall
thefrom
formula
Chapter
=(L5/K
45 th
formula creates computed criteria that flags each r
than $3.20. Also remember that your heading for a
name. I used Price as the feld heading here. The c
Jen is the salesperson, the date is between 1/1/
foundation, and the per-unit price is more than $
in which Emilee is the salesperson, the date is b
sold is foundation, and the per-unit price is mo
exactly the records you want. Remember that crit
You can now select any cell within the database r
Filter group on the Data tab. Then fll in the dia
Fig
URE 46-24
Advanced Filter dialog box settings.

Chapter
Filtering
46
Data and Removing
409
Duplicates
With these settings, you are telling Excel to e
G4:M1895) that satisfy the criteria specifed i
range whose upper-left corner is cell O14. The r
O14:U18. Only the four records shown in Figure 4
+ Emilee
worksheet again).
Fig
URE 46-25
Advanced flter results.
If you select Unique Records Only in the Advan
are returned. For example, if Jen had another f
3/19/2005 for one unit for $4.88, only one of th
Problems
1.
Find all transactions in which Hallagan sol
2.
Find all transactions that rank in the top 5 p
3.
Find the top 20 revenue-generating transacti
4.
Find all transactions involving sales of at l
per-unit price was a maximum of $3.10.
5.
Find all foundation transactions during the fr
per-unit price was larger than the average p
entire time period.
6.
Find all transactions in which Zaret or Bet
7.
Find all unique combinations of product and s
8.
Find all of the top 30 sales (by units) occu
mascara.
9.
Find all sales by Jen between August 10 and S
10.
Find all sales of lipstick sold by Colleen f
than the average number of units in a lipsti
11.
Find all unique combinations of name, produ
three months of 2006.
12.
Find all records in which the product cell i

411
Chapter 47
Consolidating Data
Question answered in this chapter:
My company sells products in several region
records of the number of units of each prod
February, and March. Is there an easy way t
combines each region’s sales and gives a ta
in the U.S. during each month?
A business analyst often receives worksheets th
monthly product sales) from different affliate
overall proftability, the analyst usually need
a single Microsoft Excel workbook. PivotTables b
be used to accomplish this goal, but the littl
tab on the ribbon) is another way to accomplis
that
changes in the individual worksheets are aut
worksheet.
Answer to This Chapter’s Quest
My company sells products in several
. Each regionske
o
records of the number of units of each product s
February, and
. Is March
there an easy
master
way workbook”
to create that
“ a
combines each region’s sales and gives a tally o
theS..U during each month?
The fle East.xlsx (shown in Figure 47-1) displ
eastern U.S. during January, February, and Mar
Figure 47-2) displays monthly unit sales of Pr
through March. Your need is to create a consol
product’s total sales by month.

412
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 47-1
East region sales during January–March.
Fig
URE 47-2
West region sales during January–March.
Before you use the Consolidate command, it’s hel
the screen. To do this, open both workbooks, cli
View tab, and select the Tiled option. Your scre

Chapter
Consolidating
47
413
Data
Fig
URE 47-3
East and West sales arranged on the same screen.
Now open a blank worksheet in a new workbook, a
In the blank worksheet, click Consolidate in th
see the Consolidate dialog box, shown in Figur
Fig
URE 47-4
Consolidate dialog box.
To consolidate the data from the East and West r
enter the ranges you want to consolidate in th
clicking Add after selecting each range. By se
boxes in the Use Labels In area, you ensure th
looking at labels in the top row and left colu
Data option enables changes in the selected ra
worksheet. Select Sum in the Function box beca

414
Microsoft Excel 2010: Data Analysis and Business Modeling
sales of each product by month. Selecting Count, f
transactions for each product during each month; s
sales transaction for each product during each m
flled out as shown in Figure 47-5.
After clicking OK, the new worksheet looks like th
Eastandwestconsolidated.xlsx.) You can see, for e
sold in February, 597 units of Product F were so
Fig
URE 47-5
Completed Consolidate dialog box.
Fig
URE 47-6
Total sales after consolidation.
Now go to cell C2 of East.xlsx and change the Fe
Notice that in the consolidated worksheet, the e
increased by 100 (from 1,317 to 1,417). This cha
Source Data option was selected in the Consolida
the 2 right below the workbook name in the conso
grouped the data to perform the consolidation.) T
Eastandwestconsolidated.xlsx.

Chapter
Consolidating
47
415
Data
If you frequently download new data to your so
West.xlsx), it’s a good idea to name the range
is automatically included in the consolidation
rows below the current data set. When you popu
picks up the new data when it performs the con
data range a dynamic range (see Chapter 22, “T
Problems
The following problems refer to the data in fl
contains the unit sales, dollar revenues, and p
month.
1.
Create a consolidated worksheet that gives th
each product by region.
2.
Create a consolidated worksheet that gives th
product by region from the standpoint of re

417
Chapter 48
Creating Subtotals
Questions answered in this chapter:
Is there an easy way to set up a worksheet t
by region?
Can I also obtain a breakdown by salesperso
Joolas is a small company that manufactures ma
name of the salesperson, the location of the tr
the revenue. The managers want answers to ques
chapter.
PivotTables can be used to slice and dice data i
an easier way to summarize a list or a databas
you might want to create a summary of sales re
by product, and a summary of sales revenue by s
in which specifc data is listed, the Subtotal c
on the basis of the values in the column. For e
location, you can calculate total revenue and u
just below the last row for that region. As an
product, you can use the Subtotal command to c
each product and display the totals below the r
section, we’ll look at some specifc examples.
Answers to This Chapter’s Ques
Is there an easy way to set up a worksheet to c
region?
The data for this question is in the fle Makeu
subset of the data as it appears after sorting th
To calculate revenue and units sold by region, p
and then click Subtotal in the Outline group o
the values as shown in Figure 48-2.
By selecting Location from the At Each
created
Change I
at each point in which the value in the Locati
different regions. Selecting Sum from the Use F
and dollars for each different region. By sele

418
Microsoft Excel 2010: Data Analysis and Business Modeling
Subtotal To area, you indicate that subtotals sh
these columns. The Replace Current Subtotals opti
computed subtotals. Because you haven’t created a
this option is selected for this example. If the
Excel inserts a page break after each subtotal. S
causes Excel to place subtotals below the data. I
created above the data used for the computation. C
from the list.
Fig
URE 48-1
After sorting a list by the values in a specifc co
data.
Fig
URE 48-2
Subtotal dialog box.

Chapter
Creating
48
Subtotals
419
A sample of the subtotals results is shown in Fi
sold in the East region, earning revenue of $5
Fig
URE 48-3
Subtotals for each region.
Notice that in the left corner of the window, b
1, 2, and 3 appear. Clicking the largest numbe
you click the 2 button, you see just the subtot
the 1 button yields the Grand Total, as shown i
number reduces the level of detail shown.
Fig
URE 48-4
When you create subtotals, Excel adds buttons th
both subtotals and details.
Fig
URE 48-5
Displaying the overall total without any detail.

420
Microsoft Excel 2010: Data Analysis and Business Modeling
Can I also obtain a breakdown by salesperson of s
If you want to, you can nest subtotals. In other wo
sales by each salesperson in each region, or you c
each salesperson sold of each product in each re
Todemonstrate the creation of nested subtotals, l
salesperson in each region.
To begin, you must sort your data frst by Locati
breakdown for each salesperson of units sold and r
frst by Name and then by Location, you would get a b
for each salesperson by region. After sorting th
the subtotals by region. Then you click Subtotal a
Figure 48-6.
Fig
URE 48-6
Creating nested subtotals.
You now want a breakdown by Name. Clearing the Re
that you will not replace your regional breakdow
by each salesperson in each region as shown in Fi

Chapter
Creating
48
Subtotals
421
Fig
URE 48-7
Nested subtotals.
Problems
You can fnd the data for this chapter’s proble
Subtotal command for the following computation
1.
Find the units sold and revenue for each sa
2.
Find the number of sales transactions for e
3.
Find the largest transaction (in terms of r
4.
Find the average dollar amount per transacti
5.
Display a breakdown of units sold and reven
results for each product by region.

423
Chapter 49
Estimating Straight L
Relationships
Questions answered in this chapter:
How can I determine the relationship betwee
monthly
operating costs?
How accurately does this relationship explai
operating costs?
How accurate are my predictions likely to b
When estimating a straight line relationshi
slope and intercept of the line that best f
Suppose you manage a plant that manufactures s
tells you how many refrigerators to produce ea
to forecast your monthly operating costs and n
focus of this chapter.
Every business analyst should have the ability t
business variables. In Microsoft Excel, the tr
as in Chapter 50, “Modeling Exponential Growth
often helpful in determining the relationship
-
b
lysts try to predict is
. The
called
variable
the
dependent
you use f
v
called the
independent
. Here are
variable
some examples of busi
want to estimate.
Independent variableDependent variable
Units produced by plant
Monthly
in a cost
monthof operating plan
Dollars spent on advertising
Monthly sales
in a month
Number of employees
Annual travel expenses
Company revenue
Number of employees (headcount
Monthly return on theMonthly
stock market
return on a stock (for e
Square feet in home
Value of home
The frst step in determining how two variables a
using the Scatter Chart option) so that the in

424
Microsoft Excel 2010: Data Analysis and Business Modeling
dependent variable is on the y-axis. With the ch
points are then displayed in blue), click Trendl
Layout tab, and then click More Trendline Option
You’ll see the Format Trendline dialog box, whic
Fig
URE 49-1
Format Trendline options.
If your graph indicates that a straight line is a r
option. If the graph indicates that the dependen
the Exponential (and perhaps Power) option proba
that the dependent variable increases at a decre
decreases at a decreasing rate, the Power option i
In this chapter, I’ll focus on the Linear option
option, and in Chapter 51, I’ll cover the Power o
to Understand Time Series,” I’ll discuss the mov
Products by Using Tie-Ins,” I’ll discuss the pol
value in this discussion, so I won’t address it.

Chapter
Estimating
49
Straight
425
Line Relationships
Answers to This Chapter’s Ques
How can I determine the relationship between m
operating costs?
The fle Costestimate.xlsx, shown in Figure 49-
the monthly plant operating cost for a 14-month p
monthly operating costs from units produced, w
operating budget and better understand the cos
Fig
URE 49-2
Plant operating data.
Begin by creating an XY chart (or a scatter pl
produced) on the x-axis and the dependent varia
column of data that you want to display on the x
umn of data you want to display on the y-axis. T
range C2:D16 (including the labels in cells C2 a
on the Insert tab, and
Scatter
select
With
theOnly
frstMarkers)
option (a
You’ll see the graph shown in Figure 49-3.
Fig
URE 49-3
Scatter plot of operating cost vs. units produce

426
Microsoft Excel 2010: Data Analysis and Business Modeling
If you want to modify this chart, you can click a
Tools contextual tab. Using the commands on the
Change the chart type.
Change the source data.
Change the style of the chart.
Move the chart.
Using the commands on the Chart Tools Layout tab, y
Add a chart title.
Add axis labels.
Add labels to each point that give the x and y c
Add gridlines to the chart.
Looking at the scatter plot, it seems reasonable th
exists between units produced and monthly operati
that best fts the points by adding a trendline t
and then click a data point. All the data points a
point. Right-click, and then click Add Trendline
the Linear option, and then select the Display E
Value On Chart check boxes, as shown in Figure 4
Fig
URE 49-4
Selecting trendline options.

Chapter
Estimating
49
Straight
427
Line Relationships
After clicking Close, you’ll see the results s
the chart and labels for the x-axis and y-axis by s
and then Axis Titles in the Labels group on th
Fig
URE 49-5
Completed trend curve.
If you want to add more decimal points to the v
trendline equation, and after selecting Layout f
Now after selecting Number, you can choose the n
How does Excel determine the best ftting line?
all lines that could be drawn) the sum of the s
line. The vertical distance from
, or
each
residual
. The
point
line
to th
created by Excel is called
. You minimize
the
least-squares
the
errors
sum
- rath
of
l
s
er than the sum of the errors because
negative
in simpl
errors can cancel each other out. For example, a p
100 units below the line cancel each other if y
the fact that your predictions for each point a
ftting line.
Thus, Excel calculates that the best ftting str
from monthly units produced as follows:
(Monthly operating cost)=37,894.0956+64.2687(Units produced)
By copying the*
C3+37894.
formula
0956
64.2687
from cell E3 to the ce
compute the predicted cost for each observed d
produced, the predicted cost is $123,118. (See Fi
You should not use a least-squares line to pre
lie outside the range for which you have data. T

428
Microsoft Excel 2010: Data Analysis and Business Modeling
to predict monthly plant operating costs during m
approximately 450 and 1,300 units.
The intercept of this line is $37,894.10,So,
which c
even if the plant does not produce any refrigera
that the plant will still incur costs of $37,894
each extra refrigerator produced increases month
producing a refrigerator is estimated to be $64.
In cells F3:F16, I computed the errors (or resid
each data point as the amount by which the point v
month, error equals the observed cost minus the p
the formula
D3-E3
computes the error for each da
is above the least-squares line, and a negative e
least-squares line. In cell F1, I computed the s
for any least-squares line, the sum of the error
rounded the equation to four decimal points.) Th
least-squares line has the intuitively satisfyin
How accurately does this relationship explain th
cost?
Clearly, each month both the operating
question
cost and th
is, What percentage of the monthly variation in
variation in units produced? The answer to this q
2
value (0.69 shown i
Figure 49-5). You can state that the linear rela
monthly operating costs. This implies that 31 pe
costs is explained by other factors. Using
multi
you can try to determine other factors that influ
People always ask, what is a good R
2
value? There is really no defni
question. With one independent variable, of cour
2
value indicates a b
the data than a smaller R
2
value. A better measure of the accur
standard error
,
of
which
the
I’ll
regression
describe in the next s
How accurate are my predictions likely to be?
When you ft a line to points, you obtain
measuresstand
the “spread” of the points around the least-squa
with a least-squares line can be computed with th
function
yrange
is,
xrange
STEYX(
), where
yrange
contains the value
variable, and
xrange
contains the values of the i
the standard error of the cost estimate line in th
STEYX(D3:D16,C3:C16)
. The result is shown in Figure 49-6.

Chapter
Estimating
49
Straight
429
Line Relationships
Approximately 68 percent of the points should b
(SER) of the least-squares line, and about 95 p
of the least-squares line. These measures are r
thumb that I described in Chapter 42, “Summari
In this example, the absolute value of around 6
or smaller, and the absolute value of around 9
2*13,772
) or smaller. Looking at the errors in col
71 percent, of the points are within one SER o
the points are within two standard SER of the l
two SER from the least-squares
. Looking
line
foriscauses
calledo a
often help you improve the operation of -your b
tual operating costs are $30,000 higher than a
side. If you could ascertain the cause of this hi
you would clearly improve plant effciency. Simi
are $30,000 less than expected. If you could a
ensure it occurred more often, you would impro
Fig
URE 49-6
Computation of slope, intercept, RSQ, and standa
When estimating a straight line relationship, w
and intercept of the line that best fits the da
The Excel
yrange
SLOPE(
,
xrange
) and INTERCEPT(
yrange
,
xrange
) functions return th
and intercept, respectively, of the least-squa
SLOPE(D3:D16,C3:C16)
(see Figure 49-6) returns th
Entering in cell I2 the formula
INTERCEPT(D3:D
of the least-squares
yrange
line.
,
xrange
)By
function
the way,returns
the RSQth
2
value
associated with a least-squares line. So, ente
returns the R
2
value of 0.6882 for the least-squares l
Problems
The fle Delldata.xlsx contains monthly returns f
Dell stock. The
beta
of a stock is defned as th
the monthly return for a stock from the monthl
1.
Estimate the beta of Dell.
2.
Interpret the meaning of Dell’s beta.

430
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
If you believe a recession is coming, would y
beta stock?
4.
During a month in which the market goes up 5 p
Dell’s stock price will increase between whic
The fle Housedata.xlsx gives the square footage a
Bellevue, Washington.
5.
You are going to build a 500-square-foot addi
think your home value will increase as a resu
6.
What percentage of the variation in home valu
7.
A 3,000-square-foot house is selling for $500
real estate values in Bellevue? What might ca
8.
We know that 32 degrees Fahrenheit is equival
degrees Fahrenheit is equivalent to 100
-
degre
mine the relationship between Fahrenheit and C
your initial chart, before clicking Finish, y
not rows, because with only two data points, E
different rows.
9.
The fle Betadata.xlsx contains the monthly re
as well as the monthly returns on Cinergy, De
Estimate the beta of each stock.
10.
The fle Electiondata.xlsx contains, for sever
Republicans gained from voting machines
-
(coun
age Republicans gained from absentee ballots (
that during an election, Republicans obtained 4
and 62 percent of the absentee ballot votes. T
What do you think?

431
Chapter 50
Modeling Exponentia
Question answered in this chapter:
How can I model the growth of a company’s r
If you want to value a company, it’s important t
Although the future might not be like the past
corporation by studying the company’s revenue
-
g
lysts like to ft a trend curve to recent reven
on the x-axis (for example, the frst year of d
and so on), and on the y-axis, you plot the co
Usually, the relationship between time and rev
straight line always has the same slope, which i
(in this case, the year) is increased by 1, th
increases by the same amount. For most compani
percentage each year. If this is the case,
-
as r
enue also increases. After all, revenue growth o
grows by $100,000. Revenue growth of 10 percen
by $10 million. This analysis implies that a t
more steeply and have an increasing slope. The
as the independent variable increases by 1, th
percentage. This relationship is exactly what y
The equation for the exponential function is
y
bx
. Here,
x
is the value o
variable (in this example, the year), whereas
case, annual revenue). The value
e
(approximat
you select Exponential from Excel’s trendline o
that best ft the data. Let’s look at an exampl
Answers to This Chapter’s Ques
How can I model the growth of a company’s reve
The fle Ciscoexpo.xlsx, shown in Figure 50-1, c
1990 through 1999. All revenues are in million
revenues were $103.47 million.

432
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 50-1
Cisco’s annual revenues for the years 1990 through 1
To ft an exponential curve to this data, begin by s
the Insert tab, in the Charts group, click Scatt
Only Markers) creates the chart shown in Figure 50
Fig
URE 50-2
Scatter plot for the Cisco trend curve.
Fitting a straight line to this data would be ri
increasing, as in this example, an exponential g
data.
To obtain the exponential curve that best fts thi
turn blue), and then click Add Trendline. In the
Exponential option in the Trendline Options area
Chart and Display R-Squared Value On Chart check b
trend curve shown in Figure 50-3.
The estimate of Cisco’s revenue in year
x
(remem
from the following formula
Estimated Revenue=58.552664e
569367x

Chapter
Modeling
50
Exponential
433
Growth
I computed estimated revenue in the cell range C
formula
=58.552664
*
EXP(0.569367
*
A4)
. For example, the estimate o
(year 10) is $17.389 billion.
Fig
URE 50-3
Exponential trend curve for Cisco revenues.
Notice that most of the data points are -very c
tern indicates that exponential growth does a g
during the 1990s. The fact that the R
2
value (0.98) is very close to 1 i
visual evidence of a good ft.
Remember that whenever
x
increases by 1, the e
by the same percentage. You can verify this
-
fa
mated revenue to the previous year’s estimated r
D5 to D6:D13
=C5/C4
the
. You’ll
formulafnd that the estimate o
percent per year, which is the best estimate o
through 1999.
Of course, to use this estimated annual revenu
to ask yourself whether it’s likely that this g
that exponential growth cannot continue foreve
trend curve to forecast revenues for 2005 (yea
be $530 billion. If this estimate were realize
-
enues of the world’s largest company (Walmart)
that during its early years, the revenue growth f
growth. After a while, the growth rate slows d
this fact during the late 1990s, the Internet s
during 1999, Cisco’s actual revenue fell well s
This fact may well have indicated the start of th
late 2000.

434
Microsoft Excel 2010: Data Analysis and Business Modeling
By the way, why must you
? use
If you
x=1
used
,instead
Excel
x=1990
would
of
x=19
ha
to juggle numbers around the size of e
1990
. A number this large causes E
diffculty.
Problems
The fle Exponentialdata.xlsx contains annual sal
Use this data to work through the frst fve probl
1.
For each company, ft an exponential trend cur
2.
For which company does exponential growth hav
3.
For which company does exponential growth hav
growth?
4.
For each company, estimate the annual percent
5.
For each company, use your trend curve to pre
6.
The fle Impalas.xlxs contains the price of 20
2010. From this data, what can you conclude a
grows older?

435
Chapter 51
The Power Curve
Questions answered in this chapter:
As my company produces more of a product, i
effciently. Can I model the relationship be
to produce a unit?
A power curve is calculated with the equation
b
. In the equation,
a
an
Using a trend curve, you can determine the val
ft a scatter plot diagram. In most situations,
slope of the power curve
, as
depends
follows:
on the value o
For ,
b>1
y
increases as
x
increases, and the sl
increases.
For
0<b<1
,
y
increases as
x
increases, and the s
increases.
For ,
b=1
the power curve is a straight line.
For ,
b<0
y
decreases as
x
increases, and the pow
Here are examples of different relationships th
examples are contained in the fle Powerexample
If you are trying to predict total production c
fnd a relationship similar to that shown
-
in Fi
tioned previously, the
withcost
thisofvalue
production
of
b
incre
units produced. The slope becomes steeper, whi
more to produce. This relationship might occur b
overtime labor, which costs more than regular l
Fig
URE 51-1
Predicting cost as a function of the number of u

436
Microsoft Excel 2010: Data Analysis and Business Modeling
If you are trying to predict sales as a function o
curve similar to that shown in Figure 51-2.
Fig
URE 51-2
Plotting sales as a function of advertising.
Here,
b
equals 0.5, which is between 0 and 1. Wh
with increased advertising but at a decreasing r
model the idea of diminishing return—that each a
provide less beneft.
If you are trying to predict the time needed to p
the number of units produced to date, you often f
Figure 51-3.
Here you fnd that
b
equals –0.1. Because
b
is le
unit decreases, but the rate
learning”—slows
of decrease—that
down.
is T
relationship means that during the early stages o
time occur. As you make more of a product, howev
rate. The relationship between cumulative units p
last unit is called the
learning
or
experience
c
Fig
URE 51-3
Plotting the time needed to produce a unit based on c

Chapter
The
51Power Curve
437
A power curve has the following properties:
Property
If
x
1
increases by 1 percent,
y
increas
Property
Whenever
2
x
doubles,
y
increases by the s
Suppose that demand for a product as a functio
–2
.
Property 1 then implies that a 1 percent incre
of price) by 2 percent. In this case, the expo
elasticity
. I will discuss elasticity further in Cha
background, let’s take a look
.
at how to ft a p
Answer to This Chapter’s Quest
As my company produces more of a product, it l
efficiently
. Can I model the relationship between un
produce a unit?
The fle Fax.xlsx contains data about the numbe
(in 1982 dollars) of producing the “last” fax m
example, 70,000 fax machines were produced, an
was $3,416. The data is shown in Figure 51-4.
Fig
URE 51-4
Data used to plot the learning curve for produci
Because a learning curve tries to predict eith
from data about cumulative production, -I’ve ca
ber of fax machines produced by the end of eac
the number of fax machines produced in 1982. B
SUM($B$4:B4)
, I compute cumulative fax machine produ
You can now create a scatter plot that shows c
unit cost on the y-axis. After creating the ch
points will be displayed in blue), then right-
Trendline dialog box, select the Power option a

438
Microsoft Excel 2010: Data Analysis and Business Modeling
Chart and the Display R-Squared Value On Chart c
obtain the chart shown in Figure 51-5. The curve d
fts the data.
Fig
URE 51-5
Learning curve for producing fax machines.
The power curve predicts the cost of producing a f
Cost of producing fax machine=65,259(cumulative units produced)
-.2533
Notice that most data points are near the ftted p
2
value is near
indicating that the power curve fts the data wel
By copying from cell E4*
C4^–0.2533
to E5:E10
, you the
compute
formula
the
65
predicted cost for the last fax machine produced d
which is located over the 6 key, is used to rais
If you estimated that 1,000,000 fax machines wer
total 1989 production (2,744,000) in cell C11, y
to predict that the last fax machine produced in 1
Remember that Property 2 of the power curve stat
the same percentage. By entering twice cumulativ
your forecast formula in E10 to cell E12, you’ll fn
reduces the predicted cost to 83.8 percent of it
reason, the current learning curve is known as a
double units produced, the labor required to mak
If a curve gets steeper, the exponential curve mi
does. A natural question is which curve fts the d
be answered simply by eyeballing the curves
-
and c
ter ft. More precisely, you could compute the Su
(obtained by adding up for each data point the sq
value) and choose the curve with the smaller SSE

Chapter
The
51Power Curve
439
The learning curve was discovered in 1936 at W
Ohio, when it was found that whenever the cumu
doubled, the time required to make each airpla
Wikipedia
gives the following learning curve e
Aerospace: 85 percent
Shipbuilding: 80–85 percent
Complex machine tools for new models: 75–85 p
Repetitive electronics manufacturing: 90–95 p
Repetitive machining or punch-press operati
Repetitive electrical operations: 75–85 per
Repetitive welding operations: 90 percent
Raw materials: 93–96 percent
Purchased parts: 85–88 percent
Problems
1.
Use the fax machine data to model the relati
produced and total production cost.
2.
Use the fax machine data to model the relati
produced and average production cost per ma
3.
A marketing director estimates that total s
as shown in the following table. Estimate th
and predict demand for a $46 price. A 1 per
by what percentage?
Price
Demand
$30.00
300
$40.00
200
$50.00
110
$60.00
60

440
Microsoft Excel 2010: Data Analysis and Business Modeling
4.
The brand manager for a new drug believes tha
function of the number of sales calls on doct
Estimate sales of the drug if 80,000 sales ca
Sales calls
Units sold
50,000
25,000
100,000
52,000
150,000
68,000
200,000
77,000
5.
The time needed to produce each of the frst te
Unit
Hours
1
1,000
2
800
3
730
4
630
5
600
6
560
7
560
8
500
9
510
10
510
Estimate the total number of hours needed to p

441
Chapter 52
Using Correlations t
Relationships
Questions answered in this chapter:
How are monthly stock returns for Microsoft
Trend curves are a great help in understanding h
however, you need to understand how more than t
correlation between any pair of variables can p
move up and down in value together.
The correlation (usually
) betweendenoted
two variables
by)
r
is
(call
unit th
measure of the strength of the
. The
linear
correlation b
any two variables is always between –1 -and +1. A
pute the correlation between two variables isn
correlation between the variables is.
A correlation near +1 means that
x
and
y
have a s
is, when
x
is larger than average,
y
tends to b
than average,
y
also tends to be smaller than a
data, there will be a straight line with a pos
points. As an example, for
x=units
the data
produced
shown in
andFi
production
,
x
and
cost)
y
have a correlation of +0.90. (
Figures 52-1 through 52-3.)
Fig
URE 52-1
A correlation near +1, indicating that two varia

442
Microsoft Excel 2010: Data Analysis and Business Modeling
On the other
correlation
hand, a near –1 means that there i
relationship .between
That is,
x
and
when
y x
is larger than av
than average, and when
x
is smaller than average
When a straight line is applied to the data, the l
jobftting
of
the points. As an example, for the dat
correlation of –0.90.
Fig
URE 52-2
A correlation near –1, indicating that two variable
A correlation near 0 means that
x
and
y
have a w
whether
x
is larger or smaller than its mean tel
or smaller than its mean. Figure 52-3
y
)
shows
on
a gr
years of sales
x
). Years
experience
of experience
(
and unit sale
In this data set, the average experience is 10 y
than 10 years of sales experience, his or her sa
that when a person has fewer than 10 years of sa
Although experience and sales have little or no l
relationship (see the ftted curve) between years o
not measure the strength of nonlinear relationshi
Fig
URE 52-3
A correlation of 0, indicating a weak linear relati

Chapter
Using
52
Correlations to Summarize
443
Relationships
Answer to This Chapter’s Quest
How are monthly stock returns for Microsoft, G
The fle Stockcorrel.xlsx (see Figure 52-4) show
Intel, GM, and Cisco during the 1990s. You can u
movements in these stocks are related.
To fnd the correlations between each pair of s
on the Data tab, and then select the Correlati
(as described in Chapters 41 and 42) before yo
the Correlation dialog box as shown in Figure 5
Fig
URE 52-4
Monthly stock returns during the 1990s.
Fig
URE 52-5
Correlation dialog box.

444
Microsoft Excel 2010: Data Analysis and Business Modeling
The easiest way to enter the input range is to s
then press Ctrl+Shift+Right Arrow, followed by C
First Row option if the frst row of the input ra
upper-left cell of the output range. After click
Fig
URE 52-6
Stock return correlations.
The correlation between Cisco and Microsoft
-
is 0
tion between GM and Microsoft is 0.069. The anal
Microsoft are most closely tied together. Becaus
stocks is around 0.5, these stocks exhibit a mod
if one stock does better than average, it is lik
do better than average. Because Cisco, Intel, an
technology spending, their fairly strong correla
monthly returns on Microsoft and GM are virtuall
that when Microsoft stock does better than avera
will do better or worse than average. Again, thi
really a high-tech company and is more susceptib
Filling In the Correlation Matrix
As you can see in this example, Excel left some e
example, the correlation between Microsoft
-
and G
tween GE and Microsoft) is omitted. If you want t
click the matrix, and then click Copy. Right-cli
click Paste Special. In the Paste Special dialog b
its side. Now right-click the flipped data, and c
matrix, and click Paste Special again. In the Pa
then click OK. The transposed data is copied to th
not copy the blank cells from the transposed dat
Figure 52-7.

Chapter
Using
52
Correlations to Summarize
445
Relationships
Fig
URE 52-7
The complete correlation matrix.
Using the CORREL Function
As an alternative to using the Correlation opti
CORREL function. For example, entering in cell I
confrms that the correlation between monthly r
(shown in column E) is 0.159.
Relationship Between Correlation a
2
In Chapter 49, “Estimating Straight Line Relati
2
value for unit
produced and monthly operating cost of 0.688. H
between units produced and monthly operating c
data is simply
R
2
value
for the trendline, where you choose the sign f
of the slope of the trendline. Thus the correl
operating cost for the data in Chapter 49 is
+
.688 = + .829
Correlation and Regression Towar
You have probablyregression
heard the toward
phrase the
“ statement
mean.” E
means that the predicted value of a dependent v
average value than the independent variable. M

446
Microsoft Excel 2010: Data Analysis and Business Modeling
dependent variable
y
from
. If
an
x
independent
is
k
standard
variabl
devia
average, then your prediction for
y
will be
rk
s
r=correlation
).
between
Because
x
and
r
is
y
between -1 and +1, t
standard deviations away
. This
from
is the mean
real than
defnitio
x
toward the mean.” See Problem 5 for an -interesti
sion toward the mean.
Problems
The data for the following problems is in fle Ch
1.
The
Problem 1
worksheet contains the number o
outdoor lot and in the parking garage near th
Business. Find and interpret the correlation b
outdoor lot and in the parking garage.
2.
The
Problem 2
worksheet contains daily sales v
printer cartridges, and school supplies. Find a
these quantities.
3.
The
Problem 3
worksheet contains annual retur
and interpret the correlations between the an
investments.
Here are two more problems:
4.
The fle Dow.xlsx contains the monthly returns b
Dow Jones Index. Find the correlations betwee
conditional formatting to highlight the three s
(Of course, you should not highlight a stock a
5.
NFL teams play 16 games during the regular se
of the number of games won by all teams
-
is 2, a
ber of games a team wins in two consecutive s
during a season, what is your best prediction f
next season?

447
Chapter 53
Introduction to Mul
Questions answered in this chapter:
Our factory manufactures three products. How c
factory based on the number of units produc
How accurate are my forecasts for predictin
I know how to use the Data Analysis command t
a way to run the regression without using thi
results in the same worksheet as the data?
Answers to This Chapter’s Ques
Our factory manufactures
. How can
three
I predict
productsthe cos
factory based on the number of units produced?
In Chapters 49 through 51, I described how to u
to predict one, variable
or the
dependent
(called
y
variable) fro
or the
independent
variable). However, you oft
variable (called the
1,2,
independent
x
)
x
to
n
predict
variables
the value
x
o
variable. In these cases, you can use either th
Analysis feature or the LINEST function to esti
Multiple regression assumes that
1,2,
xn
the
… has
relations
the
following form:
Y=Constant+B1X1+B2X2+...BnXn
Excel calculates ,the
1,
B
2,
B
values
Bn
… to make
of
Constant
the prediction
equation as accurate (in the sense of minimizi
following example illustrates how multiple reg
The
Data
worksheet in the fle Mrcostest.xlsx (
plant over 19 months, as well as the number of u
produced during each month.

448
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 53-1
Data for predicting monthly operating costs.
You would like to fnd the best forecast for month
form (which I’ll refer to as Form 1):
Monthly operating cost=Constant+B1
*
(Units A produced)+B2
*
(Units B produced)
+B3
*
(Units C produced)
The Excel Data Analysis feature can fnd the equa
Click Data Analysis in the Analysis group on the Da
the Regression dialog box as shown in Figure 53-
Not
I
e
f you haven’t previously installed the Analysis T
and then click Add-Ins. With Excel Add-ins selected i
Analysis ToolPak box, and then click OK.
Fig
URE 53-2
Regression dialog box.

Chapter
Introduction
53
to Multiple
449
Regression
Input Y Range (B3:B22 in this example) contai
(including the Cost label) that you want to p
Input X Range (C3:E22) contains the data or i
A Made, B Made, and C Made) that you want t
of 15 independent variables, which must be i
Because both the Input X and Input Y ranges i
box.
I chose to place the output .
in a new worksh
Selecting the Residuals check box causes Ex
prediction from Form 1 and the residual, whi
predicted cost.
After clicking OK in the Regression dialog box
and 53-4. (See the
Regression
worksheet.)
Fig
URE 53-3
Original multiple regression output.
Fig
URE 53-4
Original multiple regression residual output.

450
Microsoft Excel 2010: Data Analysis and Business Modeling
What is the best prediction equation? You’ll fnd i
summary output) that the best equation of Form 1 t
is the following:
Predicted monthly cost=35,102.90+2.07(AMade)+4.18(BMade)+4.79(CMade)
A natural question is, Which of our independent v
cost? After all, if you choose the number of gam
one-month period as an independent variable, you w
have little effect on predicting monthly operati
independent variable has a
p-value
between 0 and 1
p-value (see column E) of less than or equal to 0
the dependent variable. Thus, the smaller the p-
independent variable. Our three independent varia
0.025 (for B Made), and 0.017 (for C Made). Thes
When you use B Made and C Made to predict mon
percent chance (1–0.23) that A Made adds pred
When you use A Made and C Made to predict mon
percent chance (1–0.025) that B Made adds pre
When you use A Made and B Made to predict mon
percent chance (1–0.017) that C Made adds pre
Our p-values indicate that A Made does not add m
C Made, which means that if you know B -
Made and C M
erating cost about as well as you can if you inc
Therefore, you can opt to delete A Made as an in
and C Made for your prediction. I copied the dat
deleted the A Made column (column C). I then adju
In the worksheet
, youtitled
can see
NoA
the regression output s
Figure 53-6.
Fig
URE 53-5
Multiple regression output with A Made data remove

Chapter
Introduction
53
to Multiple
451
Regression
Fig
URE 53-6
Residual output calculated when A Made data is r
You can see that A Made and B Made each have v
respectively). These values indicate that both th
predictive power. Using the new coeffcients in c
operating cost using the following equation:
Predicted monthly operating cost=35,475.3+5.32(BMade)+5.42(CMade)
How accurate are my forecasts for predicting m
In the regression output in cell B5 of the
NoA
2
equals 0.61
An
2
R
value such as this one means that together, B M
of the variation in monthly operating costs. N
included A Made as an independent variable, R2 e
of A Made as an independent variable explains o
operating costs. Having such a minor differenc
A Made as an independent variable.
In the regression output in cell B7 in the
NoA
regression with B Made and C Made as independe
about 68 percent of your multiple regression f
error, and 95 percent to be accurate within tw
fromactual
the
value by more than two standard err
your
forecasted operating cost
2*1274
is ),
in you
error
consider
by mor th
observation to be an outlier.
In the Residual portion of the output, shown e
observation the predicted cost and the residua
predicted cost. For the frst observation, for e
residual of $1,057.95 indicates that the predi

452
Microsoft Excel 2010: Data Analysis and Business Modeling
I know how to use the Data Analysis. command
Is thereto
a r
w
to run the regression without using this command a
the same worksheet as the data?
The Excel LINEST function can be used to insert th
into a workbook. To use the LINEST function when th
by selecting a blank cell range consisting of fv
LINEST to deposit the results. In the
A Removed
w
The syntax of the LINEST
(KnownYs,KnownXs,True,True).
function is LINEST
I
argument is changed to False, Excel estimates th
Changing the fourth argument to False causes the L
computations and return only the multiple regres
With the upper-left cell of the target range sel
of the size you want (in this case, the cell ran
=LINEST(B4:B22,C4:D22,True,True)
. At this point,
do not
press Ent
function (see Chapter 83, “Array Formulas and Fu
functions), so you must
frst
hold down Ctrl+Shif
work correctly. After using this key combination
(See the
A Removed
worksheet.)
Fig
URE 53-7
Using the LINEST function to calculate a multiple r
In row 5, you fnd the prediction equation (coeff
intercept) of
Predicted monthly cost=35,475.3+5.
Row 6 contain
standard errors for each coeffcient estimate, bu
the
2
value
R
of 0.61, and cell G7 contains the regr
9 contain information (F statistic, degrees of f
squares residual) that is less important.
Not
Pr
e
oblems that you can work with to learn more abo
the end of Chapter 55.

453
Chapter 54
Incorporating Quali
into Multiple Regres
Questions answered in this chapter:
How can I predict quarterly U.S. auto sales
How can I predict U.S. presidential electio
Is there an Excel function I can use to eas
equation?
In the frst example of multiple regression in C
Regression,” I forecasted the monthly cost of p
of each product manufactured at the plant. Bec
a product produced at a plant, you can refer t
and Product C as
quantitative
. In many
independent
situations,
-
varia
h
dent variables can’t be easily quantifed. In thi
qualitative factors such as seasonality, gende
multiple regression
.
analysis
Answers to This Chapter’s Ques
How can I predict
S.. auto
quarterly
sales? U
Suppose you want to predict quarterly U.S. aut
the year impacts auto sales. We’ll use the dat
shown in Figure 54-1. Sales are listed in thou

454
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 54-1
Auto sales data.
You might be tempted to defne an independent var
quarter, 2 during the second quarter, and so on.
fourth quarter to have four times the effect of th
quarter of the year is a.
qualitative
To model a qualitative
independent
i
v
variable, you create an independent variable cal
qualitative variable’s possible values. -(It is a
ple, I chose to omit Quarter 4.) The
qualitative
dummy varia
variable occurs. Thus, we’ll have a dummy variab
with the following properties:
Quarter 1 dummy variable equals 1 if the quar
Quarter 2 dummy variable equals 1 if the quar
Quarter 3 dummy variable equals 1 if the quar
A Quarter 4 observation will be identifed by the f
through Quarter 3 equal 0. You can see why you d
In fact, if you include a dummy variable- for Qua
gression, Microsoft Excel returns an error messa
relationship exists between any set of independe
-
ematical equivalent of dividing by 0 (an impossi
In this example, if you include a Quarter 4 dumm
following exact linear relationship:
(Quarter 1 Dummy)+(Quarter 2 Dummy)+(Quarter 3 Dummy)+(Quarter 4 Dummy)=1

Chapter
Incorporating
54
Qualitative Factors
455
into Multiple Regression
Not
A
e
n exact linear relationship
0,1,occurs
N,
… such
if that
therefor
ex
each data
0 +
1
point
x
1
c
+2
x
2
c c
+ N…
x
N
c
= 0.1Here,
through
N
x
are
x
the values of t
independent variables.
To create the dummy variable for Quarter 1, I c
IF(B12=1,1,0)
. This formula places a 1 in column G wh
a 0 in column G whenever the quarter is not th
dummy variables for Quarter 2 (in H12:H42) and Q
of the formulas in Figure 54-2.
Fig
URE 54-2
Using dummy variables to track the quarter in wh
In addition to seasonality, we’d like to use m
product (GNP, in billions of 1986 dollars), in
car sales. Suppose, for example, that you are tr
of 1979. Because values for GNP, interest rate
beginning of the second quarter in 1979, you c
rate, and unemployment rate to predict Quarter 2 1
ues for GNP, interest rate, and unemployment r
By copying from J12 to, J12:L42
you create
the the
formula
lagged
=D1
v
frst of our macroeconomic independent variable
GNP, unemployment rate, and interest rate for th
You can now run the multiple regression by cli
selecting Regression in the Data Analysis dial
G11:L42 as the Input X Range, select the label

456
Microsoft Excel 2010: Data Analysis and Business Modeling
the Residuals check box. After clicking OK, you o
Regression
worksheet and in Figures 54-3 through 5
Fig
URE 54-3
Summary output and ANOVA table for auto sales data
In Figure 54-4, you can
equation
see that
1) used
the equation
to predict
( q
sales is as follows:
Predicted quarterly sales=3154.7+156.833Q1+379.784Q2+203.03 6Q3+.174(LAGGNP
–93.83(LAGUNEMP)–73.91(LAGINT)
Also in Figure 54-4, you see that each independe
to 0.15. You can conclude that all independent v
auto sales. You interpret all coeffcients in a r
that each coeffcient gives the effect of the ind
effects of all other variables in the regression
Fig
URE 54-4
Coeffcient information for auto sales regression.
Here’s an interpretation of each coeffcient:
A $1 billion increase in last quarter’s GNP i
An increase of 1 percent in last quarter’s un
sales by 93,832.
An increase of 1 percent in last quarter’s in
by 73,917.

Chapter
Incorporating
54
Qualitative Factors
457
into Multiple Regression
To interpret the coeffcients of the dummy varia
effect of seasonality relative to the value le
In Quarter 1, car sales exceed Quarter 4 ca
In Quarter 2, car sales exceed Quarter 4 ca
In Quarter 3, car sales exceed Quarter 4 ca
You fnd that car sales are highest during the s
and summer are coming) and lowest during the thi
why buy a new car when winter salting will rui
From the Summary output shown in Figure 54-3, y
The variation in the independent variables (
explains 78 percent of the variation in the d
The standard error of regression is 190,524 c
of your forecasts to be accurate within 190
forecasts to be accurate
2*190,524
).
within 381,048 car
There are 31 observations used to ft the re
The only quantity of interest in the ANOVA tab
(0.00000068). This measure implies that there a
together, all of the independent variables are u
be quite sure that the independent variables a
Figure 54-5 shows, for each observation, the p
the second quarter of 1979 (observation 1), pr
thousand and the residual
2910–2728.6
).isNote
181,400
that cars
no residu
(
381,000 in absolute value, so you have no outl
Fig
URE 54-5
Residuals for the auto sales data.

458
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I S..predict
presidential
U
elections?
When asked which factors drive presidential elec
said, “It’s the economy, stupid.” Yale economist R
in thinking that the state of the economy
-
has a l
tial elections. Fair’s dependent variable (see th
shown in Figure 54-6) for each election (1880 th
party vote (ignoring votes received by third par
party. He tried to predict the incumbent party’s p
independent variables such as:
Party in power. In our data, I use 1 to denot
and 0 to denote when the Democratic party was i
Percentage growth in GNP during the frst nine m
Absolute value of the inflation rate during th
You use the absolute value because either a p
Number of quarters during the last four years i
Strong economic growth is defned as growth at a
Length of time an incumbent party has been in o
in offce, 1 for two terms, 1.25 for three ter
terms or more. This defnition implies that ea
less influence on the election results than th
Elections during wartime. The elections in 19
and 1948 (World War II was still underway in 1
(Elections held during the Vietnam War were n
During wartime years, the variables related t
were deemed irrelevant and were set to 0.
The current president running for re-election
1; otherwise, this variable is set to- 0. In 1
dent running for re-election because he was n
vice-president.
Not
The data comes from Roy Fair’s excellent book
Pre
Things
(Stanford University Press, 2002).

Chapter
Incorporating
54
Qualitative Factors
459
into Multiple Regression
Fig
URE 54-6
Presidential election data.
I’ve attempted to use the data from the electi
multiple regression equation that can be used t
saved the 2008
validation
election point.”
as a “
When ftting a r
a good idea to hold back some of your data for u
Holding back data allows you to determine wheth
job of forecasting data it hasn’t seen. Any fo
seen should not be used to predict the future.
To run the regression, click Data Analysis in th
select the Regression tool in the Data Analysi
Range and C16:I48 as the Input X Range. I also s
labels). I placed the output in the
Results
wo
Fig
URE 54-7
Regression output for predicting presidential el

460
Microsoft Excel 2010: Data Analysis and Business Modeling
In Figure 54-7, you can see that War? and Presid
0.15. Therefore, you should rerun the regression w
The results of this regression. are
In this
shownworkshee
in work
remaining independent variables have p-values le
fnal prediction equation. From the coeffcients s
that the best equation to predict
equation
elections
2):
is g
Predicted presidential election percentage=51.69+.53GROWTH-.80ABSINF+.58GOODQUARTERS
-3.48DURATION+3.18REP
Fig
URE 54-8
Final presidential election equation.
The coeffcients of the independent variables can b
for all other independent variables used in equa
A 1 percent increase in the annual GNP growth r
0.53 percent to the incumbent party.
A 1 percent deviation from the ideal (0 perce
0.80 percent of the vote.
Every good quarter of growth during an incumb
someday soon) vote by 0.58 percent.
Relative to having one term in offce, the sec
incumbent’s vote by 3.48 percent, and each la
by 0.25*(3.48 percent)=0.87 percent.
A Republican has a 3.18 percent edge over a D
Sixty-three percent of the variation in the perc
presidential election is explained by our indepe
percent indicates that about 95 percent of our f

Chapter
Incorporating
54
Qualitative Factors
461
into Multiple Regression
From the residuals, shown in Figure 54-9, you c
1892 and 1904 elections. In 1892 the incumbent c
much worse than expected, while in 1904 the in
performed much better than expected.
Fig
URE 54-9
Residuals from the presidential election equatio
Is there an Excel function I can use to easily m
equation?
It’s tedious to make forecasts using an equati
function makes it easy to generate forecasts f
to run a regression with the Data Analysis com
To illustrate the use of the TREND function, I
1880 through 2008 elections using data from on
by selecting the cell range (in this example, H
you want your forecasts to go. With the pointe
the formula
TREND(B17:B48,C17:G48,C17:G49)
. Next, press Ctrl+Shift+E
(see Figure 54-10) the forecast for each electi
forecast for the 2008 election (using data onl
receive 50.9 percent of the vote. This is fair

462
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 54-10
Residuals from presidential election equation.
The TREND function is an.example
I’ll provide
of an
array
more
fun
co
discussion of array functions in Chapter 83, “Ar
some background about array functions:
Before entering an array function, you must a
want the results of the array function to be l
Instead of pressing Enter to perform the calc
complete the entry of an array function.
After entering an array function, you’ll see a c
select a cell in which the array function’s r
the results in the cell were computed with an a
You can’t modify data in any part of a range c
Not
Pr
e
oblems that you can work with to learn more abo
the end of Chapter 55.

463
Chapter 55
Modeling Nonlineari
Interactions
Questions answered in this chapter:
What does it mean when we say that an indep
a dependent variable?
What does it mean when we say that the effe
dependent variable interact?
How can I test for the presence of nonlinea
Answers to This Chapter’s Ques
What does it mean when we say that an independ
dependent variable?
An independent variable often influences a depe
relationship. For example, if you try to predi
Sales=500–10
*
Price,
price influences sales linearly. T
in price will (at any price level) reduce sale
price were governed by an *
Price–.40
equation
*
Price
such as
Sal
2
, price and s
would be related nonlinearly. As shown in Figu
decreases in demand (see the
Nonlinearity
work
the change in the dependent variable caused by a u
is not constant, there is a nonlinear relation
variables.
Fig
URE 55-1
Nonlinear relationship between demand and price.

464
Microsoft Excel 2010: Data Analysis and Business Modeling
What does it mean when we say that the effects o
dependent variable interact?
If the effect of one independent variable on a d
of another independent variable, you can say tha
interaction
. For example, suppose you try to predict s
on advertising. If the effect of changing the le
price is small and small when the price is high, p
effect of changing the level of advertising doll
price do not exhibit any interaction.
How can I test for the presence of nonlinearity a
To see whether an independent variable has a non
simply add an independent variable to the
- regres
dent variable. If the squared term has a low p-v
nonlinear relationship.
To check whether two independent variables exhib
the regression that equals the product of the in
p-value (less than 0.15), you have evidence of i
To illustrate, let’s try to determine how gender a
manufacturing company. For each employee, you ar
fnd the information in the
Data
worksheet in the fl
Annual salary (in thousands of dollars)
Years of experience working in the manufactur
Gender (1=female, 0=male)
We’ll use this data to predict salary (the depen
and gender. To test whether years of experience h
term Experience Squared by copying
. To
from
test
D2 wheth
to D3
experience and gender have a signifcant interacti
by copying from E2 to
*
C2
.E3:E98
I ran the
a regression
formula
B2
with a
A1:A98 and an Input X Range of B1:E98. After sel
dialog box and clicking OK, I got the results sh

Chapter
Modeling
55
Nonlinearities
465
and Interactions
Fig
URE 55-2
Data for predicting salary based on gender and e
Fig
URE 55-3
Regression results that test for nonlinearity an
You can see that gender is insignifcant (its p
independent variables are signifcant (meaning th
0.15). You can delete the insignifcant gender v
I copied the data into a new worksheet called
click Move Or Copy, and then select the Create A C
column, you obtain the regression results incl
shown in Figure 55-4.

466
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 55-4
Regression results after deleting insignifcant gen
All independent variables are now signifcant (ha
Therefore, you can predict salary (in thousands o
(equation 1):
Predicted salary=59.06+.78(EXP)-.033EXP
2
–2.07(EXP*GENDER)
The negative EXP
2
term indicates that each additional yea
salary, which means that experience has a nonlin
that after 13 years of experience, each addition
Remember that gender equals 1 for a woman and 0 f
gender in equation 1, a woman’s salary can be pr
Predicted salary=59.06+78EXP-.033EXP
2
–2.07(EXP*1)=59.06-.033EXP2–1.29EXP
For a man (substituting
), the following
gender=0
equation can be u
Predicted salary=59.06+.78EXP-.033EXP
2
–2.07(EXP*0)=59.06+.78EXP-.033EXP
Thus, the interaction between gender and experie
of
experience benefts a woman an average of 0.78–(
indicates that women are not being treated fairl

Chapter
Modeling
55
Nonlinearities
467
and Interactions
Problems for Chapters 53 Throug
Fizzy Drugs wants to optimize the yield from a
thinks that the number of pounds produced each ti
of the container used, the pressure, and the t
effect of changing one variable might depend o
the process container must be between 1.3 and 1
4 and 4.5 mm, and temperature must be between 2
patiently set up experiments at the lower and u
obtain the data shown in the fle Fizzy.xlsx.
1.
Determine the relationship between yield, s
2.
Discuss the interactions between pressure, s
3.
What settings for temperature, size, and pr
Here are additional multiple regression proble
4.
For 12 straight weeks, you have observed th
tomatoes at Mr. D’s Supermarket. (See the fl
of the following:
Was a promotional notice for canned tomat
Was a coupon for canned tomatoes given to e
Was a price reduction (none, 1, or 2 cent
Use this data to determine how the above fa
canned tomatoes during a week in which you u
and reduce price by 1 cent.
5.
The fle Countryregion.xlsx contains the fol
countries:
Infant mortality rate
Adult literacy rate
Percentage of students fnishing primary s
Per capita GNP
Use this data to develop an equation that c
there any outliers in this set of data? Int
what value should 95 percent of your predic

468
Microsoft Excel 2010: Data Analysis and Business Modeling
6.
The fle Baseball96.xlsx gives runs scored, si
bases stolen for each major league baseball t
to determine the effects of singles, doubles, a
7.
The fle Cardata.xlsx provides the following i
Cylinders
Displacement
Horsepower
Weight
Acceleration
Miles per gallon (MPG)
Determine an equation that can be used to pre
independent variables are not signifcant?
8.
The fle Priceads.xlsx contains weekly unit sa
and advertising expenditures. Explain how adv
sales.
9.
The fle Teams.xlsx contains runs scored, hit-
triples, and home runs for major league baseb
Use this data to build a model that predict
based on the team’s hitting statistics.
How accurate is this model for predicting h
a season?
Suppose a team had a positive residual exce
standard error. What might cause such a res
10.
A hitter’s on-base percentage (OPS) is calcul
hits/(at bats + hit-by-pitcher + walks+ sacri
(SLG) is total bases (home runs gets credit f
and singles, 1) divided by at bats. The fle O
league teams during the 2000–2006 seasons.
Use this data to build a model that can be us
team’s OBP and SLG.
Would you recommend a team use this model o
predict runs scored?
How could this model be used to evaluate in
Why might you be skeptical if this model wa
of a truly great hitter like Albert Pujols o

Chapter
Modeling
55
Nonlinearities
469
and Interactions
11.
The fle NFlinfo.xlsx contains the following d
seasons:
Margin = Number of points by which a team o
NYP/A = Yards gained passing per pass att
YR/A = Yard gained per rushing attempt.
DNYP/A = Yards gained passing by opponent
DYR/A = Yards gained rushing by opponents p
TO = Turnovers by team.
DTO = Turnovers by a team’s opponents.
Does this data indicate that passing or rus
success?
Around how many points does a turnover cost a te
Many football fans believe you need a good r
Does this data give any support to that vie
12.
The fle Qbinfo.xlsx lists the famous quarte
the 2009 season. The quarterback rating is b
percentage, percentage of passes that resul
and percentage of passes that are intercept
Develop a formula to predict a quarterbac
How accurate are your predictions?

471
Chapter 56
Analysis of Varianc
ANOVA
Questions answered in this chapter:
The owner of my company, which publishes com
the position of our books in the computer b
More specifcally, does it really matter whe
or middle of the computer book section?
If I am determining whether populations hav
technique called?
analysis of variance
How can I use the results of one-way ANOVA f
Data analysts often have data about several di
determine whether the data about the groups di
Is there a signifcant difference in the len
the hospital after they give birth?
Does the production yield for a new drug de
in which the drug is produced is large, sma
Does the drop in blood pressure attained af
drug taken?
When you’re trying to determine whether the me
one factor are signifcantly different, one-way a
tool to use. In the examples given above, the f
the drug, respectively. In analyzing the data, y
Null hypothesis
, which indicates that the means of a
Alternative
, which
hypothesis
indicates that there is a s
between the groups’ means.
To test these hypotheses in Microsoft Excel, y
in the Data Analysis dialog box. If the p-valu
or equal to 0.15), you can conclude that the a
signifcantly different). If the p-value is gre
populations have identical means). Let’s look a

472
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
The owner of my company, which publishes compute
the position of our books in the computer
.
book s
More specifically, does it really matter whether t
middle of the computer book section?
The publishing company wants to know whether its b
in the front, back, or middle of the computer bo
monitored at 12 different stores. At fve stores, t
stores, in the back; and at three stores, in the mi
Signif
worksheet in the fle Onewayanova.xlsx, whi
indicate that the location of the books has a si
Fig
URE 56-1
Book sales data.
You can assume that the 12 stores have similar s
same size. This assumption allows you to use one
most one factor (the position of the display in th
(If the stores were different sizes, you would n
which I’ll discuss in Chapter 57, “Randomized Bl
To analyze the data,
Data
on Analysis,
the Data tab,
and then
clickselec
Fill in the dialog box as shown in Figure 56-2.
Fig
URE 56-2
Anova: Single Factor dialog box.

Chapter
Analysis
56
of Variance:
473
One-Way ANOVA
I used the following confgurations:
The data for our input range, including lab
Select the Labels In First Row option becau
labels.
I selected the Columns option because the d
I selected C12 as the upper-left cell of th
The selected alpha value is not important. Y
After clicking OK, you obtain the results show
Fig
URE 56-3
One-way ANOVA results.
In cells F16:F18, you see average sales depend
display is at the front of the computer book s
is at the back of the section, sales average 1
average 1,100. Because the p-value of 0.003 (i
that these means are signifcantly different.
If I am determining whether populations have s
technique called analysis of variance?
Suppose that the data in our book sales study i
Insig
, shown in Figure 56-4 (and also in the fle O
ANOVA on this data, you obtain the results show
Fig
URE 56-4
Book store data for which the null hypothesis is a

474
Microsoft Excel 2010: Data Analysis and Business Modeling
Note that the mean sales for each part of the st
.66 indicates that you should accept the null hy
display in the computer book section doesn’t aff
that in the second data set, you have much more v
position in the computer book section. In the fr
when the display is at the front is between 700 a
variation in sales is between 200 and 2,000. The v
is measured by the sum of the squares of data wi
D24 in the frst data set and in cell F24 in the s
of data within groups is only 22, whereas in the s
groups is 574! This large variation within the d
variation between the groups (store positions)
-
t
clude for the second data set that the differenc
signifcant.
Fig
URE 56-5
Anova results accepting the null hypothesis.
How can I use the results of a one-way ANOVA for f
If there is a signifcant difference between grou
simply the group’s mean. Therefore, in the frst d
Sales when the display is at the front of the c
per week.
Sales when the display is at the back will be 1
Sales when the display is in the middle will b
If there is no signifcant difference between the g
observation is simply the overall mean. Thus, in th
of 1,117, independent of where the books are pla

Chapter
Analysis
56
of Variance:
475
One-Way ANOVA
You can also estimate the accuracy of your for
MS (mean square) is the standard deviation of th
shown in Figure 56-6, the standard deviation o
Signif
worksheet again). By the rule of thumb, t
During 68 percent of all the weeks in-which b
puter section, sales will be between 900–151
During 95 percent of all weeks in which boo
book section, sales will be between 900–2(1
books.
Fig
URE 56-6
Computation of forecast standard deviation.
Problems
You can fnd the data for the following problem
1.
For patients of four cardiologists, you are g
in the hospital after open-heart surgery.
Is there evidence that the doctors have d
You are 95 percent sure that a patient
-
of D
tween what range of days?

476
Microsoft Excel 2010: Data Analysis and Business Modeling
2.
A drug can be produced by using a 400-degree, 3
are given the pounds of the drug yielded when v
temperatures.
Does temperature appear to influence the pro
What is the range of pounds of the product t
produced with a 200-degree oven?
If you believe that pressure within the con
does this analysis remain valid?

477
Chapter 57
Randomized Blocks a
ANOVA
Questions answered in this chapter:
I am trying to analyze the effectiveness of m
addition to a sales representative’s effecti
sells depends on the district to which he o
district assignments of my representatives i
Based on my knowledge of sales representati
How accurate are my sales forecasts?
How can I determine whether varying the pri
the sales of a video game? How can I determi
signifcantly?
How can I interpret the effects of price an
absence of signifcant interaction between p
In many sets of data, two factors can influence a
examples.
Factors
Dependent variable
Sales representative andSales
district assignment
Product price and advertising
Sales expenditure
Temperature and pressureProduction yield
Surgeon and brand of stent
Health
usedof patient after ope
When two factors might influence a dependent va
analysis of variance (ANOVA) can be used to de
signifcant influence on the dependent variable.
-
W
termine whether two factors exhibit a signifca
trying to predict sales by using product price a
interact signifcantly if the effect of adverti
In a randomized block model, you observe each p
once. You can’t test for interactions in a ran
model, you observe each combination of
). factors th
In this case,
k
must be greater than 1. In a t
for interactions.

478
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
I am trying to analyze the . effectiveness
The problem isofthat
my si
addition to a sales representative’s effectivene
depends on the district to. How
which
canheI incorporate
she is as t
assignments of my representatives into my analys
Suppose you want to determine how a sales repres
representative is assigned influence product sale
you can have each of four sales reps spend a mon
resulting sales
Randomized
are given
worksheet
Blocks
in the
Twowayanova.xlsx
in the fle
a
shown in Figure 57-1. For example, Rep
assigned
1 soldto
20 u
District 4.
Fig
URE 57-1
Data for the randomized blocks example.
This model is called a
two-way ANOVA without rep
sales representative) can potentially influence s
pairing each representative with each district. T
design because you’d like to randomize (chronolo
to districts. In other words, you’d like
-
to ensu
signed to District 1 is equally likely to be the fr
randomization hopefully lessens the effect of ti
better over time) on your analysis; in a sense, y
you try to compare sales representatives.
To analyze this data in Microsoft Excel, click Da
the Anova: Two-Factor Without Replication option
Figure 57-2.
I used the following information to set up this a
The input range data is in cells C5:G10.
I selected Labels because the frst row of the i
I entered B12 as the upper-left cell of the o
The alpha value is not important. You can use th

Chapter
Randomized
57
Blocks and Two-Way
479
ANOVA
Fig
URE 57-2
Anova: Two-Factor Without Replication dialog box f
The output you obtain is shown in Figure 57-3. (
by the Excel Data Analysis feature. I entered f
chapter.)
Fig
URE 57-3
Randomized blocks output.
To determine whether the row factor (districts
a signifcant effect on sales, just look at the p
than .15), the factor has a signifcant effect o
umn p-value (.024) are both less than .15, so b
signifcant effect on sales.

480
Microsoft Excel 2010: Data Analysis and Business Modeling
Based on my knowledge of sales representatives a
How accurate are my sales forecasts?
How should you predict product sales? You can pr
equation 1, shown here:
Predicted sales=Overall average+(Rep effect)+(District effect)
In this equation,
Rep effect
equals 0 if the sal
factor is signifcant,
Rep effect
equals the mean f
Likewise,
District effect
equals 0 if the distri
signifcant,
District effect
equals the mean for th
I computed the overall average (17.6) in
. The
cell G1
representative and district effects are computed by c
formula
E15–$G$12
. As an example, you can compute predic
as 17.6–2.85+3.6=18.35. This value is computed i
G12+G16+G24
. If the district effect is signifcant an
predicted sales for Rep 4 in District 2 would be 1
Fig
URE 57-4
Forecast for sales in District 2 by sales Rep 4.
As in one-way ANOVA, the standard deviation of th
mean square error shown in cell E31. I computed thi
formula
SQRT(E31)
. Thus, you can be 95 percent sure that i
monthly sales will be between 18.35–2(3.99)=10.3
computed in cell D39 and *
E32
D40 and
with
*
E32
D38+2
,the
respectively
formulas
D
How can I determine whether varying the price an
the sales of a video game? How can I determine w
significantly?
When you have more than one observation for each c
factors, you have a two-factor ANOVA
with
replic
Excel requires that you have the same number of o
combination.
In addition to testing for the signifcance of th
signifcant interaction between them. For example
advertising affect sales, an interaction between p

Chapter
Randomized
57
Blocks and Two-Way
481
ANOVA
effect of an advertising change would depend o
of a price change would depend on the advertis
and advertising would mean that the effect of a p
of advertising.
As an example of two-factor ANOVA with replica
price and advertising level affect the monthly s
No Interaction
worksheet in the fle Twowayanov
Figure 57-5. During the three months in which a
for
example, 21, 20, and 16 units were sold.
Fig
URE 57-5
Video game sales data; no interaction.
Notice that for each price/advertising combina
In cell D1, I computed the overall average (25
AVERAGE(D4:F12)
. In cells G4, G7, and G10, I computed
-
th
ing. For example, the effect of having a low l
advertising minus the overall average. In cell G
–5.59 with the formula
. In
AVERAGE(D4:F6)–$D$1
a similar fashion, I c
each price level by copying from D13 to
. E13:F1
To analyze this data, click Data Analysis on th
Factor With Replication in the Data Analysis d
Figure 57-6.
Fig
URE 57-6
Anova: Two-Factor With Replication dialog box fo
with replication.

482
Microsoft Excel 2010: Data Analysis and Business Modeling
I used the following information to set up the a
The input range data, including labels, is in C
Excel requires a label for each level of the c
in the input range. Thus, I entered Low, Mediu
the possible price levels. Excel also require
the frst column of the input range. These lab
thbeeginning of the data for each level. Thus, I p
medium, and high levels of advertising in cel
In the Rows Per Sample box, I entered 3 becau
combination of price and advertising level.
The upper-left cell of our output range is B1
The only important portion of the output is the A
Fig
URE 57-7
Two-way ANOVA with replication output; no interacti
As with randomized blocks, an effect (including
that’s less than .15. Here, Sample (this is the r
in the row labeled Columns) are highly -signifcan
tion. (The interaction p-value is .79!) Therefor
influence sales and that the effect of advertisin
Figure 57-8 graphically demonstrates the fact th
signifcant interaction. (See the
Graph No Intera
Fig
URE 57-8
Price and advertising do not interact in this data s

Chapter
Randomized
57
Blocks and Two-Way
483
ANOVA
Notice that as advertising increases, sales in
price level is low, medium, or high.
How can I interpret the effects of price and a
of significant interaction between price and ad
In the absence of a signifcant interaction, yo
replication in the same way that you do in a t
the
equation
to use
2):
(
Predicted sales=Overall average+[Row or advertising effect(if significant)]
+[Column or price effect(if significant)]
This analysis assumes that price and advertisi
are highly seasonal, seasonality would need to b
seasonality in Chapter 59, “Winters’s Method,” a
of Special Events.”) For example, when price i
sales are given by 25.037+(–1.814)+(–8.704)=14
the
Two Way ANOVA No Interaction
worksheet agai
see that the overall average is equal to 25.03
and the high price effect =–8.704.
Fig
URE 57-9
Forecasts for sales with high price and medium a
The standard deviation of the forecast errors e
within error.
29.78 = 5.46
You can be 95 percent sure that the forecast i
you are 95 percent sure that sales during a mo
will be between 3.60 and 25.43 units.

484
Microsoft Excel 2010: Data Analysis and Business Modeling
In the
Two Way ANOVA with Interaction
previous
worksheet, I c
example to the data shown in Figure 57-10. After r
ANOVA with replication, I obtained the results s
Fig
URE 57-10
Sales data with interaction between price and adve
Fig
URE 57-11
Output for the two-factor ANOVA with interaction.
In this data set, the p-value for interaction is .
.15) for interaction,
you do not even check p-va
forecast sales for any price and advertising com
observations involving that price and advertisin
for sales during a month with high advertising a
4
34 + 40 + 32
3
=
106
= 35.555
units
The standard deviation of forecast errors is agai
(
17.11 = 4.14)
Thus, you can be 95 percent sure that the sales

Chapter
Randomized
57
Blocks and Two-Way
485
ANOVA
Figure 57-12 illustrates why this data exhibit
advertising. For a low and medium price, incre
is high, increased advertising has no effect o
equation 2 to forecast sales when a signifcant i
talk about an advertising effect when the effe
Fig
URE 57-12
Price and advertising exhibit a signifcant inter
Problems
The data for the following problems is in the fl
1.
You believe that pressure (high, medium, or l
low) influence the yield of a production
-
pro
swers to the following problems:
Use the data in the
Problem 1
worksheet t
pressure influence the yield of the proces
With high pressure and low temperature, y
yield will be in what range?
2.
You are trying to determine how the particu
sales calls (one, three, or fve) made to a d
dollars) that each doctor prescribes of
-
you
sheet to determine the answers to the follow
How do the representative and number of s
If Rep 3 makes fve sales calls to a docto
prescriptions within what range of dollar
3.
Answer the questions in Problem 2 by using th
4.
The fle Coupondata.xlsx contains informatio
when a coupon was given out (or not) and ad
paper. Describe how the coupon and advertis

487
Chapter 58
Using Moving Averag
Understand Time Ser
Question answered in this chapter:
I’m trying to analyze the upward trend in q
1996. Fourth quarter sales in the U.S. are u
sales during the frst quarter of the
- follow
ward trend in sales. Is there any way that I c
revenues?
Answers to This Chapter’s Ques
Time series data simply displays the same quan
example, the data in the fle Amazon.xlsx, a su
the time series for quarterly revenues in mill
the time interval from the fourth quarter of 1
To graph this time series, select the range C2
frst quarter is Quarter 1 and the last is Quar
millions of dollars). Then choose Chart on the I
the
Scatter
chart type
with. Smooth
(
Lines and Marker
in Figure 58-2.
Fig
URE 58-1
Quarterly revenues for Amazon sales.

488
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 58-2
Time series plot of quarterly toy revenues.
There is an upward trend in revenues, but the fa
revenues during the frst three quarters of each y
there are four quarters per year, it would be ni
last four quarters. This is. called
Using a four-quarte
perio
inaverage smooths out the seasonal influence beca
point for each quarter. Such a graph is called a
average “moves” over time. Moving average graphs a
helps you get a better idea of what is going on w
To create a moving average graph of quarterly re
graph, and then click a data point until all the d
any point, click Add Trendline, and then select t
equal to 4. Microsoft Excel now creates the four
shown in Figure 58-3. (See the fle Amazonma.xlsx
For each quarter, Excel plots the average of the c
Of course, for a four-quarter moving average, th
fourth data point. The moving average curve make
had a steady upward trend. In fact the slope of th
be increasing. In all likelihood , the slope of thi
off, resulting in a graph that looks like an S c
curves, but the Excel 2010 Solver can be used to f

Chapter
Using
58
Moving Averages to Understand
489
Time Series
Fig
URE 58-3
Four-quarter moving average trend curve.
Problem
The fle Ch58data.xlsx contains quarterly re
four-quarter moving average trend curve for e
you learn from each trend curve.

491
Chapter 59
Winters’s Method
You often need to predict future values of a t
product revenues. This is usually diffcult
series
bec
are constantly changing. Smoothing or adaptive m
forecasting future values of a time
powerful
series. In thi
smoothing method:
’s method.
Winters
To help you understand h
works, I’ll use it to forecast monthly housing s
simply the number of new homes whose constructi
describing the three key characteristics of a t
Time Series Characteristics
The behavior of most time series can be explai
base, trend, and seasonality.
The
base
of a series describes the series’ c
For example, suppose the base level for U.S
can believe that if the current month were a
of the year, 160,000 housing starts would o
The
trend
of a time series is the percentag
trend of 1.02 means that you estimate that h
each month.
The
seasonality
(index) for a periodtypical
tells y
month you can expect housing starts to be. F
index is .8, then December housing starts a
the June seasonal index is 1.3, then June h
typical month.
Parameter Defnitions
paAfter observing
, you will
monthhave
t
used all data obse
to estimate the following quantities of intere
L
t
=Level of series
T
t
=Trend of series
S
t
=Seasonal index for current month

492
Microsoft Excel 2010: Data Analysis and Business Modeling
The key to Winters’s method is the following thr
t
,
T
t
, and S
t
. In the following
, ,
bet
and
formulas,
gam
are
alp
called
. You
smoothin
choose the values of these parameters to optimiz
equals the number of periods
c
=12 months,
in a seasonal
for example)
cycle
a (
t
equals
the observed value of
. the time series at time
t
Formula 1:
L
t
=alp(x
t
/
t
s
–c
)+(1–alp)(L
t–1
*
t
T
–1
)
Formula 2:
T
=bet(L
t
/
t
L
–1
)+(1–bet)T
t–1
Formula 3:
S
t
=gam(x
t
/
t
L
)+(1–gam)s
t-c
Formula 1 indicates that the new base estimate i
observation (deseasonalized) and the last period
Formula 2 indicates that the new trend estimate i
current base to the last period’s base
period’s
(this is a c
trend. Formula 3 indicates that you update your s
average of the estimate of the seasonal index ba
estimate. Note that larger values of the smoothi
weight on the current observation.
You can defne
F
t,k
as your
F
)forecast
after period
(
.
t
This
for the
results
period
in th
formula
F
t,k
=L
t*(
T
t)
k
s
t+k–c
. (I refer to this as formula 4.)
This formula frst uses the current trend estimat
the resulting base estimate for period
t+k
is ad
nitializing Winters’s Method
To start Winters’s method, you must have initial e
seasonal indexes. I used monthly housing
initialize
starts f
Winters’s method. Then I chose smoothing paramet
forecasts for the years 1988 through 1996. See Fi
are the steps I followed.

Chapter
Winters’s
59
Method
493
Fig
URE 59-1
Initialization of Winters’s method.
Step
I
1
estimated, for example, the January seas
January
housing starts for 1986 and 1987 divided by th
for 1986 and 1987. Therefore, copying from G14 t
=AVERAGE(B2,B14)/AVERAGE($B$2:$B$25)
generates th
For example, the January estimate is 0.75 and th
Step
To
2
estimate the average monthly trend, I t
starts divided by the 1986 mean starts. I comp
with the formula
=(J1/J2)^(1/12).
Step
Going
3
into January 1987, I estimated the b
December 1987 value. This was computed
.
in C25 w
Estimating the Smoothing Const
Now I’m ready to estimate smoothing constants. I
in column D, the series trend; and in column
-
G
pute the forecast for next month, and in colum
for each month. Finally, I use the Solver to c
minimize the sum of the absolute percentage er
Step
In
1
G11:I11, I enter trial values (between 0 a
Step
In
2
C26:C119, I compute the updated series
to C27:C119 the formula
=alp*(B26/G14)+(1–alp)
.

494
Microsoft Excel 2010: Data Analysis and Business Modeling
Step
In
3
D26:D119, I use formula 2 to update the s
D27:D119 the formula
=bet*(C26/C25)+(1–bet)*D25
.
Step
In
4
G26:G119, I use formula 3 to update the s
G27:G119 the formula
=gam*(B26/C26)+(1–gam)*G14
.
Step
In
5
E26:E119, I use formula 4 to compute the f
copying from E26 to E27:E119
.
the formula
=(C25*D
Step
In
6
F26:F119, I compute the absolute percenta
from F26 to F27:F119 the. formula
=ABS(B26-E26)/B
Step
I
7
compute the average absolute percentage er
in F21 with the formula
.
=AVERAGE(F26:F119)
Step
Now
8
I use Solver to determine smoothing para
average absolute percentage error. The Solver Pa
Fig
URE 59-2
Solver Parameters dialog box for Winters’s model.
I used smoothing parameters (G11:I11) to minimiz
(cell F21). The Solver ensures that you fnd the b
Smoothing constants must be,between
bet=.01
, and 0
gam=.27
and 1. Her
minimizes the average absolute percentage error. Y
for the smoothing constants, but you should obtai
(MAPE) close to 7.3 percent. In this example, th
constants that give forecasts having approximate
forecasts are off by an average of 7.3 percent.

Chapter
Winters’s
59
Method
495
Remarks
Instead of choosing smoothing parameters to o
could, for example, choose to optimize the a
in forecasting total housing starts for the n
If at the end of month
t
you want to foreca
simply add
f
t,1
+f
t,2
+f
t,3
+f
t,4
. If you want, you could choose s
minimize the absolute percentage error incu
Problems
All the data for the following problems is in th
1.
Use Winters’s method to forecast one-quarte
2.
Use Winters’s method to forecast one-quarte
3.
Use Winters’s method to forecast one-quarte
4.
Use Winters’s method to forecast total reve
Home Depot.

497
Chapter 60
Ratio-to-Moving-Ave
Method
Questions answered in this chapter:
What is the trend of a time series?
How do I defne seasonal indexes for a time s
Is there an easy way to incorporate trend a
product sales?
Often you need a simple, accurate method to pr
corporation or future monthly sales of a produ
provides an accurate, easy-to-use forecasting m
In the fle Ratioma.xlsx, you are given sales o
in Figure 60-1 in rows 5 through 24), and you wa
quarters (quarters 21-24). This time series ha
Answers to This Chapter’s Ques
What is the trend of a time series?
A trend of 10 units per quarter means, for exa
per quarter, while a trend of -5 units per qua
units per quarter.
How do I define seasonal indexes for a time ser
We know that Walmart sees a large increase in i
of the holiday season.) If you do not recogniz
good forecasts of quarterly Walmart revenues. T
better understand a company’s sales pattern. T
revenues are as follows:
Quarter 1 (January through March): .90
Quarter 2 (April through June): .98
Quarter 3 (July through September): .96
Quarter 4 (October through December): 1.16

498
Microsoft Excel 2010: Data Analysis and Business Modeling
These indexes imply, for example, that sales dur
higher than sales during an average quarter.
Sea
To see whether you understand seasonal
question:
indexes, t
Suppose that during Quarter 4 of 2013 Walmart ha
1 of 2014 Walmart has sales of $180 billion. Are thi
The key idea here is to
deseasonalize
sales and e
average quarter. For example, the Quarter 4 2013 s
$172.4 billion in an average quarter,selling
and the Qu
180/.9 = $200 billion in an average quarter. Thu
decreased 10 percent, sales appear to be increas
quarter. This simple example shows how important i
product’s seasonal indexes.
Is there an easy way to incorporate trend and se
product sales?
Now let’s turn to the simple ratio-to-moving-ave
enables you to easily estimate a time series’ tr
to generate forecasts of future values of the ti
shown in Figure 60-1 and the fle Ratioma.xlsx.
Fig
URE 60-1
Data for the ratio-to-moving-average example.
You begin by trying to estimate the deseasonaliz
(using centered moving averages). Then you can f
estimates (in column G). Next you determine the s
you estimate the future level of the series by e
future sales by reseasonalizing the trend line e

Chapter
Ratio-to-Moving-Average
60
499
Forecast Method
Calculating moving
To begin,
averages
compute aaverage
four-quar
(four quarters eliminates seasonality)
-
for e
ter, the current quarter, and the next two q
the formula
AVERAGE(E5:E8)
. For example, for Quarter 2, t
.25*(24+44+61+79) = 52.
Calculating centered
The moving
averages
for Qu
centered at Quarter 2.5, while the moving a
3.5. Averaging these two moving averages gi
estimates the level of the process at the e
formula
AVERAGE(F6:F7)
gives you an estimat
series—without seasonality!
Fitting a trend line to the
You
centered
use the centere
moving a
averages to ft a trend line that can be use
In F1, I use the formula
SLOPE(G7:G22,B7:B22
in cell F2 I use the formula
INTERCEPT(G7:G2
trend line. You can now estimate the level o
6.94t+ 30.17. Copying from G25 to G26:G28 th
computes
estimated
the
level of the series from Qu
Computing the seasonal
Recall that
indexes
a seasonal index o
means sales in that quarter are twice sales d
index of .5 for a quarter means that sales d
quarter. To determine the seasonal indexes, b
for which you have sales
actual
. To
sales/cente
do this, co
cell H7 to H8:H22. the
You’ll
formula
see,
=E7/G7
for example, t
quarter, sales were 77, 71, 90, and 89 perce
seasonal index for Quarter 1 as the average o
calculate the initial seasonal index estima
AVERAGEIF($D$7:$D$22,J3,$H$7:$H$22)
. This formula averages th
have for Quarter 1 seasonality.
Unfortunately, the seasonal indexes do not a
seasonal indexes average to 1, copy from L3 t
K3/AVERAGE($K$3:$K$6)
.
Forecasting sales during
To create
Quarters
the sales
21–24
fore
quarter, you simply multiply the trend line e
G) by the appropriate seasonal index. Copyi
VLOOKUP(D25,season,3)*G25
computes the fnal f

500
Microsoft Excel 2010: Data Analysis and Business Modeling
If you think the trend of the
series’
has changed r
trend based on more recent data. For
moving
example, yo
averages for Quarters 13–18 to get a more recent t
SLOPE(G17:G22,B17:B22)
. This yields an estimated trend of 8
to forecast Quarter 22 sales, for example, you w
you have (from Quarter 18) of 160.13 and add 4(8
Quarter 22. Then multiplying by the Quarter 2 se
for Quarter 22 sales of (160.13+4(8.09))*(.933) = 1
Problem
1.
The fle Walmartdata.xlsx contains quarterly r
1994–2009. Use the ratio-to-moving-average me
Quarters 3 and 4 in 2009 and Quarters 1 and 2 o
a trend estimate that you use in your forecas

501
Chapter 61
Forecasting in the P
Special Events
Questions answered in this chapter:
How can I determine whether specifc factors i
How can I evaluate forecast accuracy?
How can I check whether my forecast errors a
For a student project, a class and I attempted t
the Eastland Plaza Branch of the Indiana Unive
with the branch manager made it clear that the f
customers:
Month of the year
Day of the week
Whether the day was a faculty or staff payd
Whether the day before or the day after was a h
Answers to This Chapter’s Ques
How can I determine whether specific factors in
The data collected is contained in the
Origina
shown in Figure 61-1. If you try to run a regr
(as
described in Chapter 54, “Incorporating Qual
the dependent variable would be the number of c
column E). You would need 19 independent varia
Eleven to account for the month (12 months mi
Four to account for the day of the week (5 b
Two to account for the types of paydays that o
Two to account for whether a particular day f
Microsoft Excel 2010 allows only 15 independen
in trouble.

502
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 61-1
Data used to predict credit union customer traffc.
When a regression forecasting model requires mor
can use the Excel Solver to estimate the coeffci
also use Excel to compute the R-squared values b
traffc and the standard deviation for the foreca
forecasting equation by using a lookup table to l
other factors. Then I used Solver to choose the c
yields the minimum sum of squared errors. (Each d
forecasted customers.) Here are the particulars.
I began by creating indicator variables (in colu
staff payday (SP), faculty payday (FAC), before a h
Figure 61-1.) For example, in cells G4, H4, and J
staff payday, faculty payday, and after a holida
was not before a holiday.
The forecast is defned by a constant (which help
more accurate) and effects for each day of the w
payday, a day occurring before a holiday, and a da
values for all these parameters (the Solver chan
Figure 61-2. Solver will then choose values that m
day, the forecast of customer count will be gene
Predicted customer count=Constant+(Month effect)+(Day of week effect)
+(Staff payday effect, if any)+(Faculty payday effect, if any)+
(Before holiday effect, if any)+(After holiday effect, if any)

Chapter
Forecasting
61
in the Presence
503
of Special Events
Using this model, you can compute a forecast f
K4 to K5:K257 the following formula:
$O$26+VLOOKUP(B4,$N$14:$O$25,2)+VLOOKUP(D4,$N$4:$O$8,2) +G4*$O$9+H4*$O$10+I4*$O$11+J4*$O$12
Cell O26 picks up the constant term.
VLOOKUP(B
coeffcient for the current month, and
VLOOKUP(
week coeffcient for the current week.
G4*$O$9+
the effects (if any) when the current day is c
By copying from L4 to L5:L257
, I compute
the formula
the squared
(E4-
e
day. Then, in cell L2, I compute the sum
. of sq
Fig
URE 61-2
Changing cells and customer forecasts.
In cell R4, I average the day of the week
,
chan
and in cell R5, I average the month changing
. Later,
c
I’ll constrain the average month and day of th
month or day of the week with a positive effec
and a month or day of the week with a negative e
count.
You can use the Solver settings shown in Figur
minimize the sum of squared errors.

504
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 61-3
Solver Parameters dialog box for determining forec
The Solver model changes the coeffcients for the m
and the constant to minimize the sum of square e
the week and month effect to equal 0. Using the S
obtained. For example, Friday is the busiest day o
A staff payday raises the forecast (all
) byelse
397 bei
customers.
How can I evaluate forecast accuracy?
To evaluate the accuracy of the forecast,
between
you co
thfeorecasts and the actual customer count in cel
RSQ(E4:E257,K4:K257)
. This formula computes the percentage o
customer count that is explained by the forecasti
explain 77 percent of the daily variation in cus
You compute the error for each day in column M by c
formula.
E4–K4
A close approximation to the standard e
standard deviation of the errors. This value is c
STDEVS(M4:M257)
. Thus, approximately 68 percent of the f
within 163 customers, 95 percent accurate within 3
Let’s try and spot any outliers. Recall that an o
of a forecast error exceeds two times the standa
M4:M257, and then click Conditional Formatting o
and in the New Formatting Rule dialog box, choos

Chapter
Forecasting
61
in the Presence
505
of Special Events
To Format. Fill in the rule description in the d
information about conditional formatting, see C
Fig
URE 61-4
Using conditional formatting to spot forecast ou
After choosing a format with a red font, the c
red any error that exceeds
2*(standard deviati
outliers, you can see that the model often und
three days of the month. Also, during the seco
overforecasts, and the day before spring break
To remedy this problem, in the
1st Three Days
w
of the frst three days of the month and for sp
added trial values for these new effects in ce
following formula:
$O$25+VLOOKUP(B4,$N$13:$O$24,2)+VLOOKUP(D4,$N$4:$O$8,2)+G4*$O$9+H4*$O$10+I4*$O$11+J4*$O$12
+IF(C4=1,$O$26,IF(C4=2,$O$27,IF(C4=3,$O$28,0)))
I include the effects of the frst three days o
IF(C4=2,$O$27,IF(C4=3,$O$28,0)))
picks up the e
I manually entered the spring break coeffcient
added
+O29
to the formula, and
.
in cells K53:K5
After including the new changing cells in the S
Figure 61-5. Notice that the frst three days o
(probably because of government support and So
break reduces customer count. Figure 61-5 also s
accuracy. The R squared value (RSQ) has improv
reduced to 122 customers.

506
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 61-5
Forecast parameters and forecasts including spring b
By looking at the forecast errors for the week 1
see that the model has greatly overforecasted th
It also underforecasted customer counts for the w
of the forecast errors
) also
(often
shows
called
the following:
residuals
Thanksgiving is different from a normal holid
than expected the day after Thanksgiving.
The day before Good Friday is really busy bec
Tax day (April 16) is also busier than expect
The week before Indiana University starts fal
probably because many staff and faculty take a “
hectic onrush of the fall semester.
Fig
URE 61-6
Errors for Christmas week.

Chapter
Forecasting
61
in the Presence
507
of Special Events
In the
Christmas week
worksheet, I added chang
factors. After adding the new parameters as ch
are shown in Figure 61-7. The RSQ is up to 92 p
98.61 customers! Note that the post-Christmas w
359, the day before Thanksgiving added 607 cus
customer count by 161, and so on.
Fig
URE 61-7
Final forecast parameters.
Notice also how the forecasting model is impro
something in common (like being the frst three d
factor as an independent variable and your for
How can I check whether my forecast errors are r
A good forecasting method should create foreca
random errors, I mean that your errors exhibit n
random, the sign of your errors should change
-
(
mately half the time. Therefore, a commonly
-
us
cast errors is to look at the number of sign c
nonrandomness of the errors is indicated if yo
n
2
n – 1
or more than
n
2
n – 1
+

508
Microsoft Excel 2010: Data Analysis and Business Modeling
changes in sign. In the
Christmas week
worksheet
the number of sign changes in the residuals by c
IF(M5*M4<0,1,0)
. A sign change in the residuals occurs i
consecutive residuals is negative. Therefore, thi
sign of the residuals occurs. There were 125 cha
254 = 110.6
2
254 – 1
changes in sign as the cutoff for nonrandom resi
A similar analysis was performed to predict dail
restaurant chain. The special factors correspond
Sunday (the day of the NFL’s Super Bowl) was the l
Mother’s Day were the busiest. Also, Saturday wa
Friday was the busiest day of the week for lunch
Problems
1.
How can you use the techniques outlined in thi
pens at Staples?
2.
If you had several years of data, how would y

509
Chapter 62
An Introduction to R
Variables
Questions answered in this chapter:
What is a random variable?
What is a discrete random variable?
What are the mean, variance, and standard d
What is a continuous random variable?
What is a probability density function?
What are independent random variables?
In today’s world, the only thing that’s certai
In the next nine chapters, I’ll give you some p
incorporate uncertainty in business models. Th
iu
snderstanding how to use random variables.
Answers to This Chapter’s Ques
What is a random variable?
Any situation whose outcome is
. The
uncertain
value of
is ca
variable is based on the (uncertain) outcome o
of dice is an experiment, and a random variabl
shown on each die. In this case, the random va
so on up to 12. As another example, consider th
console, for which a random variable might be d
product.
What is a discrete random variable?
A random variable is discrete if it can assume a f
some examples of discrete random variables:
Number of potential competitors for your pr
Number of aces drawn in a fve-card poker ha
Number of car accidents you have (hopefully z

510
Microsoft Excel 2010: Data Analysis and Business Modeling
Number of dots showing on a die
Number of free throws out of 12 that Phoenix S
basketball game
What are the mean, variance, and standard deviat
In Chapter 42, “Summarizing Data by Using Descri
variance, and standard deviation for a data set. I
(often denoted by µ) is the average value of the r
performed an experiment many times. The mean of a r
as the random variable’s
expected
value. The var
by
2
)
s
is the average value of the squared deviatio
you would expect if you performed an experiment m
random variable (often denoted by σ) is simply t
sets, the mean of a random variable is a summary m
variable, whereas the variance and standard devia
variable about its mean.
As an example of how to compute the mean, varian
variable, suppose you believe that the return on th
governed by the following probabilities:
Probability
Market return
.40
+20 percent
.30
0 percent
.30
-20 percent
Hand calculations show the following:
µ=.40*(.20)+.30*(.00)+.30*(–.20)=.02 or 2 percent
2
s
=.4*(.20–.02)
+.30*(.0–.02)
+.30*(–.20–.02)
=.0276
Then
=.166
σ
or 16.6 percent.
In the fle Meanvariance.xlsx (shown in Figure 62

Chapter
An62
Introduction to Random
511
Variables
Fig
URE 62-1
Computing the mean, standard deviation, and vari
I computed the mean of the market return in ce
SUMPRODUCT(B4:B6,C4:C6)
. This formula multiplies each val
probability and sums up the products.
To compute the variance of the market return, I d
value of the random variable from its mean by c
(B4–$C$9)^2
. Then, in cell C10, I computed the
-
varia
age squared deviation from the mean with
.
the f
Finally, I computed the standard deviation of th
SQRT(C10)
.
What is a continuous random variable?
A continuous random variable is a random varia
or, to all intents and purposes, an infnite nu
continuous random variables:
Price of Microsoft stock one year from now
Market share for a new product
Market size for a new product
Cost of developing a new product
Newborn baby’s weight
Person’s IQ
Dirk Nowitzki’s three-point shooting percen
What is a probability density function?
A discrete random variable can be specifed
-
by a l
rence for each value of the random variable.
-
B
sume an infnite number of values, you can’t li
of a continuous random variable. A continuous r
its
probability
. For
density
example,
function
the probability de
chosen person’s IQ is shown in Figure 62-2.

512
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 62-2
Probability density function for IQs.
A probability density function (pdf) has the fol
The value of the pdf is always greater than o
The area under the pdf equals 1.
The height of the density function for a valu
the likelihood that the random
. For
variable
example,
assum
the h
of the density for an IQ of 83 is roughly hal
This tells you that IQs near 83 are approxima
because the density peaks at 100, IQs around 1
The probability that a continuous random varia
the corresponding area under the density func
having IQs from 80 through 100 is simply the a
100.
We note that a discrete random variable which a
as a continuous random variable. (See Chapter 6
example, while the number of half gallons
-
of mi
cery store is discrete, it proves more conveni
as a continuous random variable.
What are independent random variables?
A set of random variables are independent if know
tells you nothing about the values of the other r
games won by the Indiana University football
-
tea
centage return on Microsoft during the same year
not change your view of how Microsoft stock did d

Chapter
An62
Introduction to Random
513
Variables
On the other hand, the returns on Microsoft st
are told that Microsoft stock had a high retur
were high, which tells you that Intel probably h
Problems
1.
Identify the following random variables as d
Number of games the Seattle Seahawks win n
Number that comes up when spinning a roul
Unit sales of Tablet PCs next year
Length of time that a light bulb lasts be
2.
Compute the mean, variance, and standard de
when a die is tossed.
3.
Determine whether the following random varia
Daily temperature and sales at an ice cre
Suit and number of a card drawn from a de
Inflation and return on the stock market
Price charged for and the number of units s
4.
The current price of a company’s stock is $
takeover is successful, the company’s stock p
is unsuccessful, the stock price will drop t
probability of a successful takeover that w
stock today. Assume your goal is to maximiz
Seek command, which is discussed in detail i
5.
When a roulette wheel is spun, the possible o
bet on a number coming up you win $35 if you
otherwise. What is the mean and standard de
of the game?

515
Chapter 63
The Binomial, Hyperg
Negative Binomial R
Questions answered in this chapter:
What is a binomial random variable?
How do I use the BINOM.DIST function to com
If equal numbers of people prefer Coke to P
people whether they prefer Coke to Pepsi, w
people prefer Coke to Pepsi and the probabi
Coke to Pepsi?
Of all the elevator rails my company produc
are about to ship a batch of 10,000 elevatoo d
the batch is acceptable, the customer will r
check whether each sampled rail is defectiv
-
tive, the customer will accept the batch. H
batch will be accepted?
Airlines do not like flights with empty seat
ticket purchasers show up for a flight. If th
what is the probability that the flight will b
The local Village Deli knows that 1,000 cus
20 percent order the specialty vegetarian s
How many should the deli make if they want t
of vegetarian sandwiches?
What is the hypergeometric random variable?
What is the negative binomial random variab
Answers to This Chapter’s Ques
What is a binomial random variable?
A
binomial random variable
is a discrete rando
situation in which all three of the following a
n
independent trials occur.

516
Microsoft Excel 2010: Data Analysis and Business Modeling
Each trial results in one of two outcomes: su
In each trial, the
p
) probability
remains constant.
of success (
In such a situation, the binomial random variabl
related to the number of successes in a given nu
variable denoting the number of successes occurr
probability of success
. Here on
areeach
sometrial
examples
is
p
in whi
random variable is relevant.
Coke or
Assume
Pepsi
that equal numbers of people pr
to Coke. You ask 100 people whether they pref
probability that exactly 60 people prefer Cok
through 60 people prefer Coke to Pepsi. In thi
variable defned by the following:
Trial: survey individuals
Success: prefer Coke
p
equals 0.50
n
equals 100
Let
x
equal the number of people sampled who p
probability
=60 and
thatalso
x
the probability
.
that
40
Elevator
Of
rails
all the elevator rails you -produce, 3 p
tive. You are about to ship a batch of 10,000 e
whether the batch is acceptable, the customer w
rails and check whether each sampled rail is d
defective, the customer will accept the batch
that the batch will be accepted.
You have a binomial random variable defned by th
Trial: look at a sampled rail
Success: rail is defective
p
equals 0.03
n
equals 100
Let
x
equal the number of defective rails in th
that
.x
≤ 2
Airline overbooking
Airlines don’t like flights with emp
average, 95 percent of all ticket purchasers s
tickets for a 100-seat flight, what is the pro

Chapter
The
63Binomial, Hypergeometric, and Negative
517
Binomial Random Variables
You have a binomial random variable defned by th
Trial: individual ticket holders
Success: ticket holder shows up
p
equals 0.95
n
equals 105
Let
x
equal the number of ticket holders wh
probability that
x
≥ 101.
How do I useD. IST
the function
BINOM
to compute binomial p
Microsoft Excel 2010 includes the BINOM.DIST f
binomial probabilities. If you want to compute th
binomial random variable having
n
trials with p
DIST(x,n,
. If
p,1)
you want to compute the probability o
random variable having
n
trials with probabili
.
Entering 1 as the last argument of BINOM.DIST y
0 yields
probability
the “
mass function” for any parti
of True can be used instead of a 1, and a last a
Previous versions of Excel will not recognize th
Excel you can use the BINOMDIST function, whic
DIST function. Let’s use the BINOM.DIST functi
You’ll fnd the data and analysis in the fle Bi
Figure 63-1.
Fig
URE 63-1
Using the binomial random variable.

518
Microsoft Excel 2010: Data Analysis and Business Modeling
If equal numbers of people prefer Coke to Pepsi a
whether they prefer Coke to Pepsi, what is the p
Coke to Pepsi and the probability that between 4
You have
=100
n
and
=0.5.
p
You seek the
=60 probability
and the probabilit
that
x
40
x
, ≤
where
60
x
equals the number of people who p
the probability
=60 by that
entering
x
the formula
. Excel
BINOM.DIST(
return
the value 0.011.
To use the BINOM.DIST function to ,compute
you canthe
note
pr
that the probability that
40
x
60
equals the p
that .
x
Thus,
39
you can obtain the probability that f
by entering the formula
BINOM.DIST(60,100,0.5,1)
Excel return
the value 0.9648. So, if Coke and Pepsi -
are equa
ple of 100 people, Coke or Pepsi would be more th
people shows Coke or Pepsi to be more than 10 pe
that Coke and Pepsi are equally preferred.
Of all the elevator rails my company produces,
. We
3 p
are about to ship a batch of 10,000
. To determine
elevatorwhet
rai
batch is acceptable, the customer will randomly c
whether each sampled
. Ifrail
two is
or defective
fewer sampled rail
customer will accept
. How can
theIbatch
determine the probabil
accepted?
If you let
x
equal the number of defective rails i
variable
=100
with
and
=0.03.
n p
You seek the probability that
the formula
BINOM.DIST(2,100,0.03,1)
Excel returns the value 0.42 T
accepted 42 percent of the time.
Really, your chance of success is not exactly 3 p
10 rails are defective, the chance the next rail i
frst 10 rails are not defective, the chance the n
the probability of success on the eleventh
-
trial i
cess on one of the frst 10 trials. Despite this f
as an approximation when a sample is drawn and th
the total population. Here, the population equal
probabilities involving sampling from a -fnite po
geometric random variable, which I’ll discuss la
Airlines do not like . flights
Supposewith
that,
empty
on average
seats
, 9
ticket purchasers . show
If the
up airline
for a flight
sells 105 tick
what is the probability that the flight will be o

Chapter
The
63Binomial, Hypergeometric, and Negative
519
Binomial Random Variables
Let
x
equal the number of ticket holders
=105 and
who s
p
=0.95. You seek the
101
.probability
Note that the
that
101
probability
x
equals
th
1 minus the probability
10
.
0
So, to that
compute
x
the probabili
-
booked, you enter in cell C10 the
. Excel
formula
yields
1–BI
0
which means there is a 39.2 percent chance tha
The local Village Deli knows that 1,000
. On average
custom
20 percent order the specialty
. These vegetarian
sandwiches
. Howsand
are p
many should the deli make if they want to have a 5 p
vegetarian sandwiches?
In Excel 2010 the function BINOM.INV,
trials,
probability
with the s
of
success,
),
alpha
determines the smallest number
x
for w
than or equal to
x
successes
. In earlier
is at
versions
least
alpha
of Ex
CRITBINOM(
trials, probability
) yielded
of success,
the same
alpha
results a
example,
trials
equals 1,000,
probability of s
in Figure 63-2, if the deli orders 221 sandwic
than or equal to 221 is at least 0.95. Also, t
demanded is less than 0.95.
Fig
URE 63-2
Example of BINOM.INV function.
What is the hypergeometric random variable?
The
hypergeometric random variable
governs a s
An urn contains
N
balls.
Each ball is one of two types (called succe
There are
s
successes in the urn.
A sample of size
n
is drawn from the urn.

520
Microsoft Excel 2010: Data Analysis and Business Modeling
Let’s look at an example in the fle Hypergeom.di
Excel 2010 formula
HYPERGEOM.DIST(x,n,s,N,0)
giv
are drawn from an urn containing
N
balls, of whi
formula
HYPERGEOM.DIST(x,n,s,N,1)
gives the prob
if
n
balls are drawn from an urn containing
N
ba
with the BINOM.DIST function, True can be used t
For example, suppose that 40 of the Fortune 500 c
CEOs are analogous
N=500
to the
) and
balls
the in
40 the
women
urn
are
( rep
of the
s
successes in the urn. Then, copying fro
DIST(C8,Sample_size,Population_women,Population_
of 10 Fortune 500 companies will have 0, 1, 2,…, 1
10,
Population_women
equals 40, and
Population_s
Finding a woman CEO is a success. In the sample o
of 0.431 that no women CEOs will be in the sampl
approximated this probability with
, yielding
the formula
0.434
B
which is very close to the true probability of 0
that at most 2 of the 10 people in the sample wo
HYPGEOM.DIST(2,Sample_Size,Population_women,Popu
Thus there is a 9
percent chance that at most two people in the sa
obtained this answer by adding together the shad
Fig
URE 63-3
Using the hypergeometric random variable.
What is the negative binomial random variable?
The
negative binomial random variable
applies
-
to th
dom variable, but the negative binomial random v
occurring th
before
success.
the
NEGBINOM.DIST(f,s,p,0)
Thus
=
gives th
exactly
f
failures
thwill
success
occur
when
before
the probability
the
s
o
each trial, and
=NEGBINOM.DIST(f,s,p,1)
-gives th
cur before
th success
the
s
when the probability of succes

Chapter
The
63Binomial, Hypergeometric, and Negative
521
Binomial Random Variables
consider a baseball team that wins 40 percent o
and Figure 63-4). Copying from E9 to E34 the f
the probability of 0, 1, 2,…, 25 losses occurr
equals a game won. For example, there is a 19.
one game before winning two games. In cell G10 I u
=
NEGBINOM.DIST(3,2,0.4,TRUE)
to compute the chance that
occur
at m
before our team wins two games (0.663). Of cou
simply adding up the shaded cells (E9:E12).
Fig
URE 63-4
Using the negative binomial random variable.
Problems
1.
Suppose that, on average, 4 percent of all C
are defective. The company has adopted the f
each shipment, and accept the shipment if n
determine the following:
What fraction of shipments will be accept
If the policy changes so that a shipment i
sample is defective, what fraction of shi
What is the probability that a sample siz
CD drives?

522
Microsoft Excel 2010: Data Analysis and Business Modeling
2.
Using the airline overbooking data:
Determine how the probability of overbookin
sold varies from 100 through 115. Hint: Use a o
Show how the probability of overbooking var
varies from 100 through 115, and the probab
varies from 80 percent through 95 percent. Hi
3.
Suppose that during each year, a given
beating
mutual f
the Standard & Poor’s 500 Stock Index (S&P In
what is the probability that at least 10 fund
out of 10 years?
4.
Professional basketball player Steve Nash is a 9
If he shoots 100 free throws, what is the p
15 shots?
How good a foul shooter would Steve Nash be i
of making fewer than 90 free throws out of 1
5.
When tested for extra sensory perception (ESP
shape of a card from a 25-card deck. The deck c
shapes. If a person identifes 12 cards correc
6.
Suppose that in a group of 100 people, 20 hav
select 30 people, what is the chance that at l
7.
A student is selling magazines for a school f
that a given house will buy a magazine. He ne
probability that he will need to visit 5, 6, 7
8.
Use the BINOM.DIST function to verify that th
answer to our Village Deli example.
9.
In the seventeenth century, French mathematic
were inspired to formulate the modern probabi
”Problem of the Points.” Here is a simple exa
coins. Fermat wins a point if a head is tosse
If Pascal is ahead 8-7 and the frst player wi
Pascal will win?

523
Chapter 64
The Poisson and Exp
Random Variable
Questions answered in this chapter:
What is the Poisson random variable?
How do I compute probabilities for the Pois
If the number of customers arriving at a ba
variable, what random variable governs the ti
Answers to This Chapter’s Ques
What is the Poisson random variable?
The
Poisson random variable
is a discrete rand
probabilities for situations in which events (
placed for a product) have a small probability o
specifcally, during a short
, either
time zero
interval,
or oneden
ev
the probability of one event occurring during a s
by
t
.lHere, λ is the mean number of occurrences p
Situations in which the Poisson random variabl
Number of units of a product demanded durin
Number of deaths per year by horse kick in th
Number of car accidents you have during a y.
Number of copies of
The Seat of the Soul
or
Number of workers’ compensation claims fled a
Number of defects in 100 yards of string. (

524
Microsoft Excel 2010: Data Analysis and Business Modeling
How do I compute probabilities for the Poisson r
You can use the Microsoft Excel 2010 POISSON.DIS
involving the Poisson random variable. In earlie
yielded POISSON probabilities. Just
, theremember
mean of tha
Poisson random
. The
variable
syntaxisof
t
the POISSON function i
POISSON.DIST(x,Lambda,True
or
1)
calculates the p
with a mean equal to
Lambda
.
is less than or equa
POISSON.DIST(x,Lambda,False
or
0)
calculates the p
with a mean equal to
.
Lambda
is equal to
x
Here are some examples of how to compute probabi
can fnd these examples in the fle Poisson.xlsx, s
Fig
URE 64-1
Using the Poisson random variable.
Suppose that my consulting business receives an a
a two-hour period, I want to determine the follow
The probability that exactly 60 calls will be r
The probability that the number of calls rece
than or equal to 60
The probability that from 50 through 100 call
During a two-hour period, the mean probability
number of cal
(0.05) that exactly 60 calls will be received in th
POISSON.DIST(60,C2,False)
In cell C5, I fnd the probability (
be received in two hours with the
. Informula
cell C6,
POISSO
fn
probability (0.916) that from 50 through 100 cal
formula
POISSON.DIST(100,C2,True)–POISSON.DIST(4
Not
Y
e
ou can always use 1 instead of True as an argume

Chapter
The
64Poisson and Exponential
525
Random Variable
If the number of customers arriving at
variable,
bank i
what random variable governs the time between a
The time between arrivals can be any value, whi
continuous random variable. If an average of a
arrivals follows an exponential random variabl
of
f(t)=le
-lt
,
t
³
0
. This random variable has a mean, or av
graph of the exponential pdf is shown in Figur
this example in the
Density
worksheet in the fl
Fig
URE 64-2
Exponential probability density function.
Recall from Chapter 62, “An Introduction to Ra
variable, the height of the pdf for a number
x
assumes a .
value
You can
nearsee
x
in Figure 64-2 that ex
arrivals (for example, less than 0.05 hours) a
drops off sharply.
Even though the average time between arrivals i
chance that the time between arrivals will be a
EXPON.DIST(x,1/mean,True or 1)
will give the p
with a given
mean
will assume
. Thus,
a value
the less
second
thaa
to the EXPON.DIST function is the rate per tim
to compute the probability that the time betwe
copied from cell D5 to D7 the formula
. In earlier
1–EXPON.r
v
of Excel, the EXPONDIST function yields the sa
Note that I frst converted minutes to hours (5
mean time between arrivals is 0.033 hours,
.
so I e
In short, I entered the arrival rate per time u

526
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 64-3
Computations of exponential probabilities.
Problems
1.
Beer drinkers order an average of 40 pitchers o
Bloomington, Indiana.
What is the probability that at least 100 p
period?
What is the chance that the time between or
less?
2.
Suppose that teenage drivers have an average o
What is the probability that a teenager wil
during a year?
What is the probability that the time betwe
3.
I am next in line at a fast food restaurant i
the time to serve a customer follows an expon
minutes. What is the chance that I will have t
4.
Since 1900 a fraction (.00124) of all major l
no-hitters. A team plays 162 games in a seaso
two or more no-hitters during a season?

527
Chapter 65
The Normal Random V
Questions answered in this chapter:
What are the properties of the normal rando
How do I use Excel to fnd probabilities for th
Can I use Excel to fnd percentiles for norm
Why is the normal random variable appropria
Answers to This Chapter’s Ques
What are the properties of the normal random v
In Chapter 62, “An Introduction to Random Varia
variables can be used to model quantities such a
Price of Microsoft stock one year from now
Market share for a new product
Market size for a new product
Cost of developing a new product
Newborn baby’s weight
A person’s IQ
Remember that if a discrete random variable (s
caa
nssume many possible values, you can approxi
random variable as well. As I described in Cha
hasprobability density function (pdf). The pdf f
negative function with
a
the
and following
b
are arbitrary
propertie
num
The area under the pdf is 1.
The probability
<
a
equals
that
the
X
probability
. This probability
that
X≤a
i
by the area under .
the pdf to the left of
a
The probability
>
b
equals
that
the
X
probability
. This probability
that
X≥b
i
the area under the
. pdf to the right of
b
The probability that
a<X<b
equals
. This the
probabilit
area under the pdf
.
between
a
and
b

528
Microsoft Excel 2010: Data Analysis and Business Modeling
Thus, the area under a continuous random variabl
larger the value of, thedensity
more likely
function
the random
at
X
v
a value
. near
For example,
X
if the density function of a r
density function of the random variable at 5, th
take on a value near 20 than a value near 5.
For a continuous random variable, the probabilit
example, some people are from 5.99999 feet throu
exactly 6 feet tall. This explains why you can r
or equal to sign (≤) in the probability statemen
Figure 65-1 displays the pdf for
X=IQ
of a rando
is 1. If you want to fnd the probability-that a p
ply fnd the area to the left of 90. If you want t
95 through 120, you fnd the area under the pdf f
probability that a person’s IQ is more than 130, y
to the right of 130. (See the
IQ Density
workshe
Fig
URE 65-1
IQ pdf.
Actually, the density plotted in Figure. 65-1
The is a
normal random variable is specifed by its mean a
random variable with µ=100 and σ=15. This is the p
random variable has the following properties:
The most likely value of a normal random varia
at 100 in Figure 65-1).
As the value
x
of the random variable moves a
random variable is near
x
sharply decreases.
The normal random variable is symmetric about i
as likely as IQs near 120.

Chapter
The
65Normal Random
529
Variable
A normal random variable has 68 percent of i
percent within 2σ of its mean, and 99.7 per
should remind you of the rule of thumb I de
by Using Descriptive Statistics.” In fact, t
that data is “sampled”, from
whicha explains
normal distrib
why th
does not work as well when the data fails t
For a larger σ, a normal random variable
pattern
is mo
is illustrated in Figures 65-2 and 65-3. (See th
Normalexamples.xlsx.)
Fig
URE 65-2
Normal random variable pdf with a mean equal to 6
Fig
URE 65-3
Normal random variable pdf with a mean equal to 6
How do I use Excel to find probabilities for th
Consider a normal random variable
X
with a mea
for any number
x
, you want to fnd the probabil
cumulative
. To
function
use Microsoft Excel 2010 to fnd th
formula
NORM.DIST(x,µ,
σ
,1)
. Of course, the fourth argument o

530
Microsoft Excel 2010: Data Analysis and Business Modeling
The argument
1
tells Excel to compute the normal c
function
, Excel
is
0
returns the actual value of the no
statistical functions (like NORM.DIST) have
-
been m
vide better accuracy than their counterparts (li
You can use the NORM.DIST function to answer man
probabilities. You can fnd examples in the
Norma
Normalexamples.xlsx, which is shown in Figure 65
Fig
URE 65-4
Calculating normal probability.
What fraction ofQ people
of less
have
Let
than
X
90?
equal
i
the IQ o
randomly chosen person. Then
<90,
you which
seek the
is equa
pro
to the probability
90. Therefore,
that
X≤
you can enter into c
worksheet the formula,
NORM.DIST(90,100,15,1)
and Excel returns 0.25
percent of all people have an IQ less than 90
What fraction ofQs
all
from
people
95 through
have
When fnding
120?
the probability
, youthat
use
a≤X≤b
the form
(area- under the n
tion to the
)–(area
leftunder
of
b
normal density
)
. Thus,
function
you
t
can fnd the probability that
a≤X≤b
by
enterin
NORM.DIST(a,µ,s,1)
This fact is illustrated in Figure 6
area is
)–(area
to left
)to
. You
left
of
can
b
of
answer the questi
from 95 through 120 by entering into cell C4 o
NORMDIST(120,100,15,1)–NORMDIST(95,100,15,1)
. Excel returns the pro
so 53.9 percent of all people have an IQ from 9
Probability a<=X<=b
Fig
URE 65-5
Calculating the probability that
. a random varia
What fraction ofQs
all
of people
at least
To
have
fnd
130?
the
i
probabili
X
b
, note in Figure 65-6≥
b
that
equals
the
1–probability
. You
t
X
can compute the ≥probability
by entering
that
the
X
formula
σ
,1)
.
1–N

Chapter
The
65Normal Random
531
Variable
You seek the probability
≥130. This equals
that
X
.
1–probabilit
You enter i
C5 of the worksheet
Normal
the .formula
Excel retur
1–NO
0.023, so you know that 2.3 percent of peop
Probability X>=b
Fig
URE 65-6
Calculating that the probability random varia
Can I use Excel to find percentiles for normal r
Consider a given normal random variable
X
with m
situations, you want to answer questions such a
A drug manufacturer believes that next year
will be normally distributed, with mean equ
sigma equal to 5 million DOT. How many units o
year if the company wants to have only a 1 p
Family income in Bloomington, Indiana, is n
to $30,000 and sigma equal to $8,000. The p
Bloomington are eligible for federal aid. W
In the frst example, you want to determine the ni
antidepressant. That is, you seek the number
x
demand will exceed
x
and a 99 percent
. Inchance
the sec
th
example, you want the tenth percentile of fami
the number
x
such that there is only a 10 perc
x
and a 90 percent chance .that family income w
Suppose you want
th percentile
to fnd the (expressed as a de
variable
X
with a mean and a standard deviatio
NORM.INV(p,µ,
σ
)
into Excel. This formula returns a nu
that
X≤x
equals the specifed percentile. You n
exercises on the
Normal
worksheet in the fle N
For the drug manufacturing example, let
X
equa
value
x
such that≥
x
the
equals
probability
0.01 or that
the probabi
X
Again, you seek the ninety-ninth percentile
-
of d
ing in cell C7 the formula
. Excel
NORM.INV(0.99,60,5)
returns 71.63, so th
produce 71,630,000 DOT. This assumes, of cours
no supply of the drug on hand. If, for example
DOT, they would need to produce 61,630,000 DOT d

532
Microsoft Excel 2010: Data Analysis and Business Modeling
To determine the cutoff for federal family,
aid, if
X
eq
you seek a value of
x
such that the probability th
percentile of Bloomington family income. You fnd thi
INV(0.10,30000,8000)
Excel returns $19,747.59, so aid sho
incomes smaller than $19,749.59.
Why is the normal random variable appropriate in m
A well-known mathematical result called the
Cent
together many (usually at least 30 is suffcient) i
is normally distributed. This result holds true e
normally distributed. Many quantities (such as m
ing together many independent random variables, w
variable occurs often in the real world. Here ar
the Central Limit Theorem.
The total demand for pizzas during a month at a s
even if the daily demand for pizzas is not.
The amount of money you win if you play craps 1
even though the amount of money you win on ea
Another important mathematical result shows how t
deviations of sums of independent random
- variabl
dent random variables
X
1
,
2
,…,
X
X
n
where mean
X
i
i
, and standard deviation
i
i
then the
following are true:
1.
Mean
X
1
+
X
(
2
+…
X
n
)=µ
1
2
+…
n
µ
2.
Variance
X
1
+
X
2
+…
X
n
(
)
?
=
2
+?
2
+...?
2
1
2
n
3.
Standard
X
deviation
1
+
X
2
+…
X
n
)=
?
2
+?
2
+
(
...?
2
1
2
n
Note that 1 is true even when the random variabl
through 3 with the Central Limit Theorem,
-
you ca
lems, such as the demand for pizza. Our pizza so
the fle Normalexamples.xlsx, which is shown in Fi
Fig
URE 65-7
Using the Central Limit Theorem.

Chapter
The
65Normal Random
533
Variable
Even though the daily demand for frozen pizzas i
the Central Limit Theorem that the 30-day dema
Given this, 1 through 3 above imply the follow
From 1, the mean of a 30-day
.
demand equals
1
From 2, the variance of a 30-day demand equ
=4,320
.
From 3, the standard deviation
4320 = 65.73
of a 30-day d
Thus, the 30-day demand for pizzas can be mode
with a mean of 1,350 and a standard deviation o
ity that at least 1,400 pizzas are sold as the p
least 1,399.5 (note that a demand of 1,399.6, f
formula
1–NORM.DIST(1399.5,D7,D9,TRUE)
fnd the probability tha
period for at least 1,400 pizzas is 22.6 perce
The number of pizzas that you must stock to ha
of pizzas is just the ninety-ninth percentile o
ninety-ninth percentile of the demand distribu
NORM.INV(0.99,D7,D9)
Therefore, at the beginning of a m
of pizzas up to 1,503 if you want to have only a 1 p
Problems
1.
Suppose you can set the mean number of ounc
actual number of ounces has a standard devia
If you set the mean at 12.03 ounces, and a s
least 12 ounces, what fraction of cans is a
What fraction of cans have less than 12.1 o
What should you set the mean to if you wa
contain at most 12 ounces? Hint: Use the G
2.
Annual demand for a drug is normally distri
standard deviation of 10,000 units.
What is the probability that annual deman
If you want to have only a 5 percent chan
level should you set annual production?

534
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
The probability of winning a game of craps is 0
bet the same amount on each game, what is the p
determining the mean and standard deviation o
use the Central Limit Theorem.
4.
Weekly sales of Volvo’s Cross Country station wa
mean of 1,000 and standard deviation of 250.
What is the probability that during a week, f
wagons are sold?
There is a 1 percent chance that fewer than w
sold during a week?

535
Chapter 66
Weibull and Beta Di
Modeling Machine Li
of a Project
Questions answered in this chapter:
How can I estimate the probability that a m
20 hours?
How can I estimate the probability that han
than 200 hours?
The
Weibull random variable
is a continuous ra
lifetime of a machine. If you have data about h
past, you can estimate
alpha
the
and
) two
that
beta
parameters
defne a Weibu
(
variable. You can then use the WEIBULL.DIST fu
probabilities of interest, such as an estimate o
The
Beta random variable
is a continuous rando
duration of an activity. Given estimates of th
duration, and the standard deviation of the du
Excel 2010 to determine probabilities of inter
Answers to This Chapter’s Ques
How can I estimate the probability that a mach
20 hours?
Suppose you have observed the lifetime of seve
the machines is contained in the fle Weibulles
Fig
URE 66-1
Machine lifetime data.

536
Microsoft Excel 2010: Data Analysis and Business Modeling
Reliability engineers have found that the Weibul
modeling machine lifetimes. The Weibull random v
alpha
and
. Based
beta
on the data, you can determine (u
functions in cells B13 and B14) that, on average
deviation of 7.40 hours. By copying these values t
with the settings shown in Figure 66-2, you can f
that the Weibull random variable will have a mea
In this case,
alpha
equals 2.725 and
beta
equals 2
value you enter for
alpha
and
beta
in cells E2 a
mean (computed in cell E6) and standard deviatio
varies
alpha
and
beta
until the mean and standar
the mean and standard deviation of machine
-
lifeti
mend using the Multistart option for the GRG Non
best with upper and lower bounds on the changing c
and
beta
will always work. I tried. an
If upper
the Solve
boun
makes
alpha
or
beta
bump up against your upper b
Fig
URE 66-2
Solver settings for determining parameters for a W

Chapter
Weibull
66
and Beta Distributions: Modeling
537
Machine Life and Duration of a Project
Fig
URE 66-3
Estimates of
alpha
and
beta
for a Weibull random v
Here’s the syntax of the WEIBULL.DIST function
WEIBULL.DIST(x,alpha,beta,Cumulative)
When
Cumulative
equals True, this formula
randomresu
variable with parameters
alpha
. Changing
and
beta
True
is les
to
False yields the height of the Weibull probabi
Chapter 62, “An Introduction to Random Variabl
of a continuous random variable indicates the l
value .near
Thus,
x
if the Weibull density for 20 hou
hours, you would know that a machine is twice a
than to work for 10 hours before failing.
-
Befo
abilities of interest, I’ll note that in prior v
the same
results as WEIBULL.DIST.
What is the probability that a machine
This
will l
probability (41.7 percent) is computed in ce
1–WEIBULL.DIST(20,alpha,beta,1)
Essentially, this formula c
the Weibull pdf to the right of 20 hours by s
20 hours.
What is the probability that a machine will l
hours?
This probability (66.9 percent) is comp
WEIBULL.DISTL(30,alpha,beta,TRUE)–WEIBULL.D
This formu
fnds the area under the Weibull pdf from 15 th
area to the left of 30 hours minus the area t
the probability of a machine working withou
probability of a machine working without fai
you are left with the probability that a ma
through 30 hours.

538
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I estimate the probability that hanging d
200 hours?
Since the development of the Polaris missile in th
activity durations with the Beta random variable
need to specify a minimum value,
alpha
maximum
and
).
beta
value
The data in the fle Beta.xlsx (see Figure 66-4) c
Beta distribution.
Fig
URE 66-4
Determining probabilities with the Beta random var
Suppose that you believe that the time needed to h
between 0 and 600 hours. These are your minimum a
C7 and C8. The cell range F8:F22 contains the le
buildings of a similar size. In cell F5, I used th
(78.49 hours) needed to hang drywall in these
-
15 b
tion to determine the standard deviation (47.97 h
in these buildings. Any choice of values of
alph
distribution’s pdf and the mean and standard dev
variable. If you can choose
alpha
and
beta
value
of the drywall installation times computed
-
from t
pha
and
beta
values will yield probabilities con
the mean and standard deviation for the drywall i
worksheet computes values for
alpha
(2.20)
ensurein ce
that the mean and standard deviation of the Beta r
standard deviation of the data.

Chapter
Weibull
66
and Beta Distributions: Modeling
539
Machine Life and Duration of a Project
The function
BETA.DIST(x,alpha,beta, True or 1
a Beta random variable ranging
, withfrom
parameters
lower
, thro
alp
assumes a value less
. The
than
last
ortwo
equal
parameters
to
x
are o
omitted, Excel assumes
lower
equals 0 and
uppe
BETA.DIST(x,alpha,beta,False or 0,lower,upper)
following
a Beta distribution. You can now use the BETA.
interest.
To compute the probability that hanging drywal
the formula in cell C15,
1–BETA.DIST(200,alpha
The result i
percent. This formula simply computes the prob
200 hours as
1–probability dry walling
.
takes l
The probability that hanging drywall will take a
computed with the formula in cell C16,
. And
BETA.DI
to compute the probability that the task
-
will t
cent), in cell C17 I used the formula
BETA.DIS
DIST(30,alpha,beta,True,
. This formula
lower,upper)
computes the pr
takes from 30 through 150 hours as the probabi
to 150 hours minus the probability that dry wa
The difference between these probabilities cou
from 30 through 150 hours.
Problems
The data for this chapter’s problems is contai
1.
In the
Problem 1
worksheet, you are given d
lifetime.
What is the probability that the machine w
What is the probability that the machine w
What is the probability that the machine w
2.
You need to clean your house today. In the
P
data about how long it has taken to clean y
at noon, what are the chances that you’ll b.
a movie?

541
Chapter 67
Making Probability S
Forecasts
Questions answered in this chapter:
On what basis do we evaluate forecasts?
If a drug company forecasts that it will se
the chance it will sell more than 65 million u
Each day we are constantly inundated by foreca
The government predicts the GNP will grow by 4 p
The Eli Lilly marketing department predicts th
given drug will be 400,000,000 DOT (days of th
A Wall Street guru predicts the Dow will go u
The bookmakers forecast that the Indiana Pa
in the opening game of the 2015 NBA season.
Although the forecasts we receive may be the b
incorrect. For example, the bookmaker’s predic
is incorrect unless the Pacers win by exactly s
forecast) implies a distribution for the quanti
forecast and fnd a random variable that correc
point forecast? The key to putting a distributi
historical data about the accuracy of past for
with regard to the forecast for the Dow Industr
years the forecast made in January of each yea
the actual change in the Dow for each of the 1

542
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
On what basis do we evaluate forecasts?
You can begin by seeing whether
. For
past
each
forecast,
forecasts
past
youe
determine the actual value/forecasted value. The
are
unbiased
, this average should be around 1. Any sig
signifcant bias. For example, if
actual
the average
results of
tena
be around twice the forecast.
automatically
To correct for
double
a b y
forecast. If the average of actual/forecasted is .
actual forecast, so
automatically
eliminate bias
halve
youyour
should
fo
eliminate forecast bias, you look at the standar
unbiased forecast
following
and use
normal
the random variable t
being forecasted:
Mean = the unbiased forecast
Standard deviation = (unbiased forecast)*(sta
associated with the unbiased forecasts).
The standard deviation of the percentage errors m
Clearly, a smaller standard deviation of percent
standard deviation.
The fle Drugfore.xlsx (see Figure 67-1) illustra
accuracy. The fle contains actual and forecasted s
2005–2012. I’ll frst show that these forecasts a
Fig
URE 67-1
Correcting for forecast bias and measuring forecas

Chapter
Making
67
Probability Statements
543
from Forecasts
To begin, in cells F5:F12 I check for bias by c
sales. To do this, I copy from
.
F5 to F6:F12 th
Next, in cell F2, I compute the bias of the or
forecasted value with the
.
I fnd
formula
that
AVERAGE(F5:F
actual sale
8 percent under forecast. To correct past bias
from G5 to G6:G12 .the
In H5:H12
formula
I
$F$2*E5
compute each yea
for the unbiased forecast by copying. from
As you
H5 ct
see, for example, 2005 actual sales were 16 pe
2011 actual sales were 19 percent larger than th
Now I evaluate the accuracy of the forecast er
deviation of the percentage errors
. I fnd
with the
stan
fo
deviation of past unbiased forecasts has been a
If a drug company forecasts it will sell 60 mi
chance it will sell more than 65 million units o
Forecast errors often follow a normal random v
you can assume forecast errors follow a normal r
Mean = the unbiased forecast.
Standard deviation = (unbiased forecast)*(s
associated with the unbiased forecasts).
In our example, this means that you should mod
variable with mean = 60(.918) = 55.08 million a
million. You can now use the Excel NORM.DIST f
(see Figure 65-2) the chance of selling at lea
1-NORM.DIST(65,F15,F16,TRUE)
There is a 5.7 percent chance o
units of the drug.
Fig
URE 67-2
Chance of selling more than 65 million units of d

544
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
1.
In Game 7 of the Boston Celtics-Los Angeles L
favored by seven points. Looking at -past NBA g
ers’ forecasts are unbiased. Also, the standa
past NBA games is 12 points. Before the game, w
probability that the Lakers would win the gam
2.
A leading cell phone company forecasts that i
bestselling phone. In the past, actual sales h
having a standard deviation equal to 10 perce
chances that less than 2.5 million phones wil
3.
The fle USC.xlsx contains the USC football te
2005–2009 and the bookmaker’s forecast (befor
victory. Does this data indicate that the boo
favored by 10 points, estimate the chance tha

545
Chapter 68
Using the Lognormal R
Variable to Model S
Questions answered in this chapter:
What is the lognormal random variable?
Is there a reason stock prices might follow a l
How can I model the future price of any sto
How can I compute the probability that Micr
from now?
Many people are interested in modeling the fut
oil or wheat, or a future exchange rate. For th
has been the random variable most often used t
learn about why the lognormal random variable i
how to determine the appropriate lognormal par
by showing how the Excel LOGNORM.DIST and LOGN
calculate probabilities that involve the futur
Answers to This Chapter’s Ques
What is a lognormal random variable?
A random variable Y follows a lognormal random v
variable. When using the Excel LOGNORM.DIST an
random variable Y is characterized by two para
value of ln Y, and a standard deviation Sigma e
Is there a reason stock prices might follow a l
Let Y equal the price of a stock
n
days from n
t
equal
the percentage change in.the
Then
stock’s
Y = P*X
price dur
1
X
*2
*…
n
X. Because th
logarithm of a product is the sum of the logar
1
+ ln X
2
+… ln X
n
. Suppose the changes in prices on differe
Recall from Chapter 65, “The Normal Random
-
Var
plies that the sum of many independent random v
even if the individual random variables are not n
likely to be a normal random variable, and thi

546
Microsoft Excel 2010: Data Analysis and Business Modeling
How can I model the future price of any stock as a l
At the close of trading on August 26, 2010, the p
you are interested in modeling the price -of Micr
dom variable. How can you estimate Mu
available
and Sigma? L
on the Internet to help you model the future pri
provides an estimate of a stock’s annual volatil
surrogate for a stock’s riskiness or variability
Microsoft’s implied volatility (see Figure 68-1) wa
a decimal, you write Sigma_ = .2718. (The method u
discussed in Chapter 74, “Pricing Stock Options.
Fig
URE 68-1
Implied volatility for Microsoft stock.
From the Investment section of fnance.yahoo.com, y
analysts for the price of Microsoft in a year, s
Fig
URE 68-2
Analyst’s forecasts for Microsoft stock price in o
Let S equal today’s stock price, and S
1
equal the estimated mean price i
a surrogate for the annual mean return on the st
1
/
0
S).
You know that S equals $24.10 and S
1
equals $33.06. Therefore (as c
fle Lognormal.xlsx; see Figure 68-3),
Mu_ = ln (

Chapter
Using
68
the Lognormal Random Variable
547
to Model Stock Prices
Fig
URE 68-3
Using the Lognormal to model the price of Micros
If you want to model the price of Microsoft st
Mu
t
= Mean of ln of Microsoft stock price in
t
y
t
= Standard deviati
Microsoft stock price in
t
years. It turns out th
Mu
t
= ln S +t(Mu_-.5Sigma_^2) and Sigma = Sigma_
For six months t =.5 years. In cell E9, I comp
.5
as
ln(24.10)+..5*(.322
2
)
=
3.324815.
In cell E10 I computed Sigma
.5
= (.2718)*
.5=
.192192.
Therefore, you can model the price of Microsof
variable with Mu = 3.324815 and Sigma = .19219
How can I compute the probability that Microso
from now?
The Excel 2010 function
x, Mean,
LOGNORM.DIST(
Sigma,
) computes
True
or
the
1
pr
that a lognormal random variable with paramete
.
Changing True or 1 to False or 0, .returns the h
In previous versions of Excel, the function LO
LOGNORM.DIST. In cell F13, I determine the cha
will exceed $38. This is calculated
, so Iby
formula
use
1 –
the
Pro
1-LOGNORM.DIST(38,F9,F10,True)
There is only a 5.2 percent c
Microsoft will sell for more than $38 in six m
In cell F14 I determine the chance that a shar
$20 in six months with the formula
. There
LOGNORM.DIS
is a 4.3 p
chance that a share of Microsoft will sell for $

548
Microsoft Excel 2010: Data Analysis and Business Modeling
Suppose you want to determine the median price o
price
x
such
$
that there is a 50 percent chance that t
will be less
x
than
. In or
cell
equal
F15 to
I fnd
$
the median pric
formula
LOGNORM.INV(0.5,F9,F10)
The median price in six months i
Remarks
In Chapter 74, I discuss the famous Black-Sch
Scholes formula assumes that the price of a s
variable.
In recent years it has become apparent that f
extremely high or low values more often than th
This has caused analysts to search for other r
used to model future stock prices. For more d
best-selling book
. Also,
The Black
in Chapter
Swan
71, “Simulati
Asset Allocation Modeling,” I discuss an alte
that does not assume that future stock prices f
Problems
Suppose a stock sells for $30 today. The annual v
analysts predict the expected price of the stock i
answer Questions 1–3.
1.
What is the probability that in two years the s
2.
What is the probability that in two years the s
3.
You are 95 percent sure that the price of the s
two values? Hint: Use .025 and .975 as the fr
function.

549
Chapter 69
Introduction to Mon
Simulation
Questions answered in this chapter:
Who uses Monte Carlo simulation?
What happens when I type
=RAND()
in a cell?
How can I simulate values of a discrete ran
How can I simulate values of a normal rando
How can a greeting card company determine h
Data analysts would like to accurately estimat
example, what is the probability that a new pr
present value (NPV)? What is the risk factor o
simulation enables you to model situations tha
on a computer thousands of times.
Not
The term
Monte Carlo simulation
comesduring
from the c
the 1930s and 1940s to estimate the probability th
bomb to detonate would work successfully. The phys
gambling, so they gave the simulations
.
the code na
In the next fve chapters, I provide some examp
to perform Monte Carlo simulations.
Answers to This Chapter’s Ques
Who uses Monte Carlo simulation?
Many companies use Monte Carlo simulation as a
process. Here are some examples.
General Motors, Proctor and Gamble, Pfzer, B
simulation to estimate both the average ret
At GM, this information was used by former C
products came to market.

550
Microsoft Excel 2010: Data Analysis and Business Modeling
GM uses simulation for activities such as for
predicting structural and purchasing costs,
-
a
ent kinds of risk (such as interest rate chan
Lilly uses simulation to determine the optima
Proctor and Gamble uses simulation to model a
risk.
Sears uses simulation to determine how many u
ordered from suppliers—for example, the numbe
should be ordered this year.
Oil and drug companies use simulation to valu
option to expand, contract, or postpone a proj
Financial planners use Monte Carlo simulation t
strategies for their clients’ retirement.
What happens when I type =RAND() in a cell?
When you type the formula
=RAND()
in a cell, you g
assume any value between 0 and 1. Thus, around 2
number less than or equal to 0.25; around 10 per
that is at least 0.90, and so on. To demonstrate h
the fle Randdemo.xlsx, shown in Figure 69-1.
Fig
URE 69-1
Demonstrating the RAND function.

Chapter
Introduction
69
to Monte
551
Carlo Simulation
Not
When you open the
Sheet1
worksheet in the fle R
random numbers shown in Figure 69-1. The RAND func
generates when a worksheet is opened or when new i
The
Frozen
worksheet has its values fxed to corres
I copied from cell C3 to. C4:C402
I named the formula
range
.
C3
=
Then, in column F, I tracked the average of th
COUNTIF function to determine the fractions th
0.50 and 0.75, and 0.75 and 1. When you press th
culated. Notice that the average of the 400 nu
around 25 percent of the results are in interv
the defnition of a random number. Also note
-
th
ent cells are independent. For example, if the r
number (for example, 0.99), that tells you nothi
numbers generated.
How can I simulate values of a discrete random v
Suppose the demand for a calendar is governed by th
Demand
Probability
10,000
0.10
20,000
0.35
40,000
0.3
69,000
0.25
How can you have Excel play out, or simulate, t
trick is to associate each possible value of th
calendars. The following assignment ensures th
of the time, and so on.
Demand
Random number assigned
10,000
Less than 0.10
20,000
Greater than or equal to 0.10, and less t
40,000
Greater than or equal to 0.45, and less t
69,000
Greater than or equal to 0.75
To demonstrate the simulation of demand, look a
Discretesim.xlsx (or its
Frozen
version shown i

552
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 69-2
Simulating a discrete random variable.
The key to this simulation is to use a random nu
range F2:G5 (named
). Random
lookup
numbers greater than or eq
will yield a demand of 10,000; random numbers gr
0.45 will yield a demand of 20,000; random numbe
than 0.75 will yield a demand of 40,000; and ran
will yield a demand of 69,000. I generated 400 r
C4:C402 the formula
. I then
RAND()
generated 400 trials, or i
by copying from B3 to B4:B402 .the
This formula
VLOOKU
ens
that any random number less than 0.10 generates a d
between 0.10 and 0.45 generates a demand of 20,0
I used the COUNTIF function to determine the fra
demand. When I press F9 to recalculate the rando
close to the assumed demand probabilities.
How can I simulate values of a normal random var
If you type in any cell the ,formula
you will
NORM.INV(ran
simulated
generate a
value of a normal random variable having
sigma
. I’ve
a mean
illustrated this procedure in the
Sim
worksheet i
the
Frozen
version).

Chapter
Introduction
69
to Monte
553
Carlo Simulation
Fig
URE 69-3
Simulating a normal random variable.
Let’s suppose you want to simulate 400 trials f
of 40,000 and a standard deviation of 10,000. (
named these cells
, respectively.)
mean
and
sigma
Copying the fo
C5:C403 generates 400 different random numbers
NORM.INV(C4,mean,sigma)
generates 400 differen
-
able with a mean of 40,000 and a standard devia
to recalculate the random numbers, the mean re
deviation close to 10,000.
Essentially, for, athe
random
formula
number
NORM.INV(p,mean,s
p
th percentile of a normal random variable
sigma
. with a m
For example, the random number 0.87 in cell C4 (
approximately the eighty-seventh percentile of a n
40,000 and a standard deviation of 10,000.

554
Microsoft Excel 2010: Data Analysis and Business Modeling
How can a greeting card company determine how ma
In this section, I’ll demonstrate how Monte Carl
making tool. Suppose that the demand for a Valen
following discrete random variable:
Demand
Probability
10,000
0.10
20,000
0.35
40,000
0.3
69,000
0.25
The greeting card sells for $4.00, and the varia
Leftover cards must be disposed of at a cost of $0
printed?
Basically, you simulate each possible production q
many times (for example, one thousand iterations
yields the maximum average proft over the one th
for this section in the
Sim
worksheet in the fle
Figure 69-4). I assigned the range names in cell
range G3:H6 the
. The
name
sales
lookup
price and cost paramete
Fig
URE 69-4
Valentine’s Day card simulation.
I then enter a trial production quantity (40,000 i
random number in cell C2. with
As previously
the formula
describe
=RAND(
demand for the card in cell C3 with
. (In the
formula
VLOOKU
formula,
rand
is the cell name assigned to cell C3
The number of units sold is the smaller of the p
compute revenue with the formula
. In
MIN(produced,de
cell C9, I c
total production cost with the
.
formula
produced*

Chapter
Introduction
69
to Monte
555
Carlo Simulation
If more cards are produced than are in demand, t
production minus demand; otherwise no units ar
cell C10 with the formula
unit_disp_cost*IF(pr
. Finally,
in cell C11, I compute proft as
revenue–
.
total
It would be nice to have an effcient way to pr
for each production quantity and tally the exp
one in which a two-way data table comes to the r
with Data Tables,” for details about data tabl
shown in Figure 69-5.
Fig
URE 69-5
Two-way data table for greeting card simulation.
In the cell range A16:A1015, I entered the num
trials). One easy way to create these values i
and then on the Home tab in the Editing group, c
select Series to display the Series dialog box
enter a step value of 1 and a stop value of 1,
option, and then click OK. The numbers 1 throu
in cell A16.

556
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 69-6
Using the Series dialog box to fll in the trial num
Next I enter the possible production quantities (
B15:E15. I want to calculate proft for each tria
production quantity. I refer to the formula for p
cell of the data table
.
(A15) by entering
=C11
You can now trick Excel into simulating one thou
production quantity. Select the table range (A15
on the Data tab, click What If Analysis, and the
table, choose the production quantity (cell C1) a
(I chose cell I14) as the column input cell. Aft
demand values for each order quantity.
To understand why this works, consider the value
C16:C1015. For each of these cells, Excel uses a v
input cell value of 1 is placed in a blank cell, a
The corresponding proft is then recorded in cell C
is placed in a blank cell, and the random number i
proft is entered in cell C17.
By copying from cell B13 to C13:E13
, you the
can formula
compute
average simulated proft for each production quan
the formula
STDEV(B16:B1015)
, you can compute the standard dev
profts for each order quantity. Each time you pr
are simulated for each order quantity. Producing 4
expected proft, so producing 40,000 cards appear

Chapter
Introduction
69
to Monte
557
Carlo Simulation
The Impact of Risk on Our Decisi
If you produce 20,000 instead of 40,000 cards, t
percent, but risk (as measured by the standard d
Therefore, if you are extremely averse to risk
decision. Incidentally, producing 10,000 cards a
because if you produce 10,000 cards, you will a
Not
I
e
n this workbook I set the Calculation option t
Calculation command in the Calculation group on th
data table does not recalculate unless you press F
table will slow down your work if it recalculates
-
e
sheet. Note that in this example, whenever you pre
because each time you press F9, a different sequen
to generate demands for each order quantity.
Confidence Interval for Mean Profi
A natural question to ask in this situation is
that the true mean proft will fall? This inter
for mean
. A
proft
95 percent confdence interval for th
computed by the following formula:
Mean Profit
+
_
1.96 *
profitst.dev
.
number iterations
In cell J11, I computed the lower limit for th
when 40,000 calendars are produced with
. In the
cellfo
J12, I computed the upper limit for the 95 per
D13+1.96*D14/SQRT(1000)
These calculations are shown in Fi
Fig
URE 69-7
Ninety-fve percent confdence interval for mean p
You can be 95 percent sure that your mean prof
between $55,076 and $61,008.

558
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
1.
An auto dealer believes that demand for 2015 m
with a mean of 200 and a standard deviation o
$25,000, and he sells an Envoy for $40,000. H
can be sold for $30,000. He is considering or
Envoys. How many should he order?
2.
A small supermarket is trying to determine how m
should order each week. The owner believes th
following discrete random variable:
Demand
Probability
15
0.10
20
0.20
25
0.30
30
0.25
35
0.15
The supermarket pays $1.00 for each copy of
P
copy can be returned for $0.50. How many copi

559
Chapter 70
Calculating an Opti
Questions answered in this chapter:
How do I simulate a binomial random variabl
How can I determine whether a continuous ra
normal random variable?
How can I use simulation to determine the o
When bidding against competitors on a project, t
the number of competitors and the bids submitt
you’ll make a lot of money on each project, bu
low, you’ll work on lots of projects but make v
bid is somewhere in the middle. Monte Carlo si
the bid that maximizes expected proft.
Answers to This Chapter’s Ques
How do I simulate a binomial random variable?
The formula
BINOM.INV(n,p,rand())
simulates th
trials, each of which has .a As
probability
explained of
in suc
Ch
“Introduction to Monte Carlo Simulation,” the R
likely to assume any value between 0 and 1. As s
Figure 70-1), when you press F9, the formula
B
simulates the number of free throws that Steve
makes in 100 attempts. The formula
BINOM.INV(1
-
ber of heads tossed in 100 tosses of a fair co
simulates the number of competitors entering th
three possible entrants and each competitor is a
entering the market. Of course,
.
in D3:D5, I en

560
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 70-1
Simulating a binomial random variable.
How can I determine whether a continuous random v
normal random variable?
Let’s suppose that you think the most likely bid by a c
normal probability density function (pdf)
-
is sym
mine whether a normal random variable can be use
to test for symmetry about the bid’s mean. If th
the mean of $50,000, bids of $40,000 and $60,000
be approximately equally likely. If the symmetry a
model each competitor’s bid as a normal random v
How can you estimate the standard deviation of e
rule of thumb discussed in Chapter 42, “Summariz
that data sets with symmetric histograms have ro
standard deviations of the mean. Similarly, a no
probability of being within two standard deviati
percent sure that a competitor’s bid will be bet
2*(standard deviation of competitor’s bid)
equal
competitor’s bid equals $10,000.
If the symmetry assumption is reasonable, you ca
formula
NORM.INV(rand(),50000,10000)
(See Chapter 69 for details a
normal random variables using the NORM.INV functi
How can I use simulation to determine the optima
Let’s assume that you’re bidding on a constructi
complete. It costs $1,000 to prepare your bid. Y
estimate that there is a 50-percent chance that e
competitor places a bid, its bid is assumed to f
equal to $50,000 and a standard deviation equal t
preparing bids that are exact multiples of $5,00

Chapter
Calculating
70
an Optimal
561
Bid
proft? Remember, the low bid wins! You’ll fnd th
Bidsim.xlsx, shown in Figures 70-2 and 70-3.
Fig
URE 70-2
Bidding simulation model.
Fig
URE 70-3
Bidding simulation data table.
Your strategy should be as follows:
Generate the number of bidders.
For each potential bidder who actually bids
model the bid. If a potential bidder does n
$100,000) to ensure that they do not win th
Determine whether you are the low bidder.

562
Microsoft Excel 2010: Data Analysis and Business Modeling
If you are the low bidder, you earn a proft e
$1,000 (the cost of making the bid). If you a
cost of the bid.
Use a two-way data table to simulate each pos
$35,000, … $60,000) one thousand times, and th
expected proft.
To begin, I assigned the names in the cell range D
E3 the number of bidders with
. the
Cellformula
F3 contains
BINOM.
th
formula. Next I determine which of the potential b
E10:E14 the formula
IF(D9<=Number_bidders,”yes”,
.
I then generate a bid for each bidder copying
(nonbidder
from cell F9 to F10:F14 the formula
IF(E9=”yes”,
.
Each cell in the cell range G9:G14 contains the R
whether I am the low bidder and win the project w
IF(mybid<=MIN(F9:F14),”yes”,”no”)
. In cell D19, I compute proft wi
IF(D17=”yes”,mybid–costproject–cost_
bid,–cost_bid)
recognizing that I recei
amount of the bid and pay project costs if I win th
Now I can use a two-way data table (shown in Fig
between $30,000 and $60,000. I copy the.proft to c
Then I select the table range D22:K1022. On the Da
What-If Analysis and then click Data Table to sp
column input cell is any blank cell in the works
of the bid). Clicking OK in the Data Table dialo
thousand times.
Copying from E21 to F21:K21 the formula
AVERAGE(
each bid. Each time I press F9, I see that the m
by bidding $40,000.
Problems
1.
How would the optimal bid change if you had 1
2.
Suppose you are bidding for an oil including
well that y
the cost of developing and mining the oil) in p
against you, and each competitor’s bid is ass
with a mean of $30 million and a standard dev
(within $1 million)?

Chapter
Calculating
70
an Optimal
563
Bid
3.
A commonly used continuous random variable i
uniform random variable—written
is equally likely
as
U(a,b)—
-to as
tween two given.numbers
Explain
a
why
andthe
b
formula
a+(
used to simulate
.
U(a,b)
4.
Investor Peter Fischer is bidding to take o
equally likely to be worth any amount betwe
company itself knows its true value. Peter i
immediately estimate the frm’s value at 50 p
should Peter bid per share for this company
5.
Seattle Mariner baseball player Ichiro Suzu
contract. Salary arbitration in Major Leagu
submits a salary that he thinks he should b
(without seeing the salaries submitted by th
The player is then paid the submitted salar
For example, suppose Ichiro submits a -$12 mi
mit a $7 million offer. If the arbitrator sa
$12 million, whereas if the arbitrator says a f
$7 million. Assume that the arbitrator’s es
between $8 and $11 million, and the team’s
-
o
tween $6 million and $9 million. Within $1 mi

565
Chapter 71
Simulating Stock Pr
Allocation Modeling
Questions answered in this chapter:
I recently bought 100 shares of GE stock. W
year this investment will return more than 1
I’m trying to determine how to allocate my i
T-Bills, and bonds. What asset allocation o
expected return of at least 10 percent and mi
The last few years have shown that future retu
Chapter 68, I showed how to use the lognormal r
Many fnancial experts have been critical of us
stock prices because the lognormal underestima
called
black
“ swans”). In this chapter, I’ll explai
uncertainty in future investment returns.. This a
Essentially, bootstrapping simulates future in
will be similar to the past. For example, if y
year, you can assume that each month’s percent
one of, for example, the percentage changes fo
you to easily generate thousands of scenarios f
addition to scenarios that assume that future v
threecent past, you can easily adjust bootstrap
investments will be less or more favorable tha
After you’ve generated future scenarios for in
the Microsoft Excel Solver to work out the ass
allocate your investments to attain the level o
risk?
The following two examples demonstrate the sim
approach.

566
Microsoft Excel 2010: Data Analysis and Business Modeling
Answers to This Chapter’s Quest
I recently bought 100
. What
shares
is the
of GE
probability
stock
tha
year this investment will return more than 10 pe
Let’s suppose that GE stock is currently selling f
returns on GE (as well as for Microsoft and Inte
July 2002 is included in the fle Gesim.xlsx, show
ending on August 2, 2002 (basically, this is Jul
include dividends (if any) paid by each company.
Fig
URE 71-1
GE, Microsoft, and Intel stock data.
The price of GE stock in one year is uncertain, s
of variation in the price of GE stock one
-
year f
ply estimates a return on GE during each
- of the n
turn
during each month is equally likely to be any o
In other words, the return on GE next month is e
the cell range F5:F64. To implement this idea, y
choose a “scenario” for each of the next 12 month
for next month, you use the return for GE in cel
the range, as next month’s return. The results a
values because the RANDBETWEEN function automati
you open the worksheet.)

Chapter
Simulating
71
Stock Prices and
567
Asset Allocation Modeling
To begin, you enter GE’s current price
generate
per sha
a scenario for each of the next 12 months by c
RANDBETWEEN(1,60)
. Next you use a lookup table to obt
scenario. To do this, you simply copy from
.
L6 t
As the formula indicates, the
, with
range
theB5:F64
returns
isfn
the ffth column of the lookup range. In the sc
for example, that the return for GE twelve mon
data point, that is, a -10.9 percent return. (
Figure 71-1.)
Fig
URE 71-2
Simulating GE stock price in one year.
Copying from M6 to M7:M17 the formula
(1+L6)*J
price. The formula takes the form.
(1+
Finally,
month’s
co
r
from J7 to J8:J17 the formula
=M6
computes the b
the previous month’s ending price.
You can now use a data table to generate one th
year and the one-year percentage return on you
Figure 71-3. In cell J19, you copy
. In
the
cell
ending
K19,py
enter the formula
(M17–$J$6)/$J$6
Ending
to compute
GE price
th
Beginning GE price)/Beginning
.
GE price

568
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 71-3
Data table for GE simulation.
Next, select the table range (J19:K1019), click W
Data tab, and then select Data Table. You set up a
cell as the column input cell. After you click O
one thousand scenarios for GE’s stock price
-
in o
book has been set to Automatic Except For Tables o
dialog box. You need to press F9 if you want to s
In cells M20:M24, I used the COUNTIF function (s
COUNT, COUNTA, and COUNTBLANK Functions”) to sum
occur in one year. For example, in cell M20, I c
one year with the formula
.
COUNTIF(returns,”<0”)/
(I named the range con
one thousand simulated
.) The
returns
simulation
as
Returns
indicates th
for 1997–2002, there is roughly a 40-percent cha
during the next year. You can also see the follow
There is a 45-percent probability that return
There is a 15-percent probability that return
There is a 12-percent chance that the investm
There is a 28-percent chance that the investm
The average return for the next year will be a
Many pundits believe that future stock returns w
Suppose you feel that in the next year, GE will p
than it performed during the 1997–2002 period
-
fo
corporate this assumption into a simulation by c
M17 to
(1+L17)*J17–0.05*J6
This simply reduces the ending GE p
price, which reduces your returns for the next y
the fle Gesimless5.xlsx, shown in Figure 71-4.

Chapter
Simulating
71
Stock Prices and
569
Asset Allocation Modeling
Fig
URE 71-4
Pessimistic view of the future.
Note that the estimate is now a 50-percent cha
during the next year. The average is not exactl
because each time you run one thousand iterati
I’m trying to determine how to allocate my inv
and bonds
. What asset allocation over a five-year p
expected return of at least 8 percent and mini
A key decision made by individuals, mutual fun
allocate assets between different asset classe
for these asset classes. A reasonable approach t
to
generate one thousand simulated values for th
then use the Excel Solver to determine an asse
minimizes risk. As an example, suppose you are g
bonds during the period 1973–2009. You are inv
based on the historical data, you want to know w
(as measured by standard deviation) of annual r
of at least 10 percent. You can see this data i
(Not all the data is shown.)
Fig
URE 71-5
Historical returns on stocks, T-Bills, and bonds

570
Microsoft Excel 2010: Data Analysis and Business Modeling
To begin, you use bootstrapping to generate one th
T-Bills, and bonds in fve years. Assume that eac
(See Figure 71-6.)
For each asset class, you enter an initial unit p
copying from K10 to K11:K14 the, formula
you generate
RANDBETW
a
scenario for each of the next fve years. For exa
similar to 1985; the following year will be simi
L10:N14 the formula
H10*(1+VLOOKUP($K10,lookup,L
for each asset class. For stocks, for example, t
(Ending year t stock value)=(Beginning year t stock value)*(1+Year
Fig
URE 71-6
Simulating fve-year returns on stocks, T-Bills, an
Copying from H11 to H11:J14 the formula
=L10
com
the beginning of each successive year.
You can now use a one-way data table to generate o
stocks, T-Bills, and bonds in fve years.-Begin by c
set class to cells I16:K16. Next select the tabl
Data tab, and then click Data Table. Use any bla
one-way data table. After clicking OK in the Dat
simulated values for the value of stocks, T-Bill
note that this approach models the fact that
-
sto
dently. In each of the fve years, the stock, T-B
the same row of data. This enables the -
bootstrap
dence of returns on these asset classes that has b
Problem 7 at the end of this chapter for concret
models the interdependence between the returns o

Chapter
Simulating
71
Stock Prices and
571
Asset Allocation Modeling
With this setup, we’re ready to fnd the optima
Assetallocationopt.xlsx, shown in Figure 71-7. T
fve-year asset values and paste them into a bl
In cells C2:E2, I enter trial fractions of our a
respectively. In cell F2, I add these asset
.
al
Later, I’ll add the constraint
F2=1
to the Sol
of our money in one of the three asset classes
Fig
URE 71-7
Optimal asset allocation model.
Next I want to determine the fnal portfolio
calculatio
va
I can use a formula such as
(Final portfolio v
(Final value of T-bills)+(Final
. Copying from
value
cell
of
F4
bonds
to F
SUMPRODUCT(C4:E4,$C$2:$E$2)
determines the fna
The next step is to determine the annual retur
scenario that Excel generated. Note that
(1+ A
5
equals
(Final portf
(Initial portfolio
. Because
value)
the initial portfolio valu
Annual return
equals
(Final portfolio value)
1/
5
1.
By copying from cell G4 to G5:G1003
, I compute
the formul
the an
return for each scenario during the fve-year s
G4:G1003 (which contains the simulated annual r
annual return in cell I3 with the formula
AVER
annual returns in cell I4 .with the formula
STD
Now I’m ready to use Solver to determine the s
expected annual return of at least 8 percent y
annual returns. The Solver Parameters dialog b
in Figure 71-8.

572
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 71-8
Solver Parameters dialog box set up for our asset a
I try to minimize the standard deviation of th
The changing cells are the asset allocation w
I must allocate 100 percent of the
F2=1
).
money I ha
The expected annual return
I3>=0.08
must
).
be at least 8 p
I assume that no short sales are allowed, whi
the money in each asset class to be nonnegati
Make Unconstrained Variables Non-Negative che
The minimum risk asset allocation is 24.3 per
bonds. This portfolio yields an expected annu
standard deviation of 2.3 percent.
Suppose you believe that the next 5 years will, o
are 5 percent worse than they’ve been for the la
expectations into the simulation. (See Problem 4 at th

Chapter
Simulating
71
Stock Prices and
573
Asset Allocation Modeling
Problems
Problems 1-3 utilize data in the fle Gesim.xls
1.
Assume that the current price of Microsoft s
probability that in two years the price of Mi
2.
Solve Problem 1 again, but this time with th
years, Microsoft will on average perform 6 p
during the 1997–2002 period for which you hv
3.
Assume that the current price of Intel is $
during the next three years, you will earn at l
year period) on a purchase of Intel stock?
Problems 4 through 7 utilize data in the fl
4.
Suppose you believe that over the next fve y
5 percent worse per year, on average,- than th
tion between stocks, T-Bills, and bonds tha
6 percent yet minimizes risk.
5.
Suppose you believe that it is two times mo
the next fve years will be more like the pe
For example, the chance that next year will b
that next year will be like 1980. This beli
more weight to the recent past. How would y
optimization model?
6.
Many mutual funds and investors hedge
purchasing
the r
put options. (See Chapter 74, “Pricing Stock O
options.) How could an asset allocation mod
hedging strategy that uses puts?
7.
Determine the correlations (based on the 19
stocks, T-Bills, and bonds. Then determine th
scenarios created by bootstrapping) between th
assets. Does it appear that the bootstrappi
between the returns on stocks, T-Bills, and b

575
Chapter 72
Fun and Games: Simu
Gambling and Sporti
Probabilities
Questions answered in this chapter:
What is the probability of winning at craps
In fve-card draw poker, what is the probabi
Going into the NCAA basketball Final Four, w
winning the tournament?
Gambling and following sporting events are pop
are exciting because you never know what’s goi
powerful tool that you can use to approximate g
Essentially, you estimate probability by playi
multiple times. If, for example, you have Micr
times and you win 4,900 times, you would estim
equal 4900/10,000, or 49 percent. If you play o
times and Syracuse wins 300 of the iterations, y
winning the championship as 300/1,000, or 30 p
Answers to This Chapter’s Ques
What is the probability of winning at craps?
In the game of craps, a player rolls two dice. I
If the combination is 7 or 11, thenumber,
player wins
the
player continues rolling the dice until he or s
frst roll (called
) or rolls
the 7.
point
If the player rolls th
wins. If the player rolls 7 before rolling
-
the p
tions, you can show that the probability of a p
Excel to simulate the game of craps many times (
probability.
In this example, it is crucial to keep in mind th
will take. I will show that the chance of a ga

576
Microsoft Excel 2010: Data Analysis and Business Modeling
highly unlikely, so we’ll play out 50 rolls of th
as follows:
0 equals the game is lost.
1 equals the game is won.
2 equals the game continues.
The output cell keeps track of the status of the g
indicate a win and 0 to indicate a loss. You can r
shown in Figure 72-1.
Fig
URE 72-1
Simulating a game of craps.
In cell B2, I used the RANDBETWEEN function to g
frst roll by using the.formula
The
RANDBETWEEN(1,6)
function e
that each of its arguments is equally likely, so e
1, 2, 3, 4, 5, or 6. Copying this formula to the r
Figure 72-1, I hid rolls 8 through 48.)
In the cell range B4:AY4, I compute the total di
copying from B4 to C4:AY4
. Inthe
cell
formula
B5, Istatus
SUM(B2:B3)
determine th
after the frst roll with the formula
IF(OR(B4=2,
.
Remember that a roll of 2, 3, or 12 results in a l
results in a win (1); and any other roll results i

Chapter
Fun
72and Games: Simulating Gambling
577
and Sporting Event Probabilities
In cell C5, I compute the status of the game a
IF(OR(B5=0,B5=1),B5,IF(C4=$B4,1,IF(C4=7,0,2)))
. If the game ends on the fr
the status of the game. If a roll makes our po
a loss. Otherwise, the game continues. I added a
($B4) in this formula to ensure that each roll tr
Copying this formula from C5 to D5:AY5 records th
The game result is in cell AY5, which is copie
a one-way data table to play out the game of c
the formula
, which
=C6
tracks the fnal outcome of the g
select the table range (D9:E2009), click What-
tab, and then click Data Table. I choose a one
input cell. After I press F9, Excel simulates th
In cell E8, I can compute the fraction of the s
AVERAGE(E10:E2009)
. For the two thousand iterations, I w
I had run more trials (for example, 10,000 ite
probability of winning at craps (49.3%). For i
see Chapter 17, “Sensitivity Analysis with Dat
In five-card draw poker, what is the probabilit
An ordinary deck of cards contains four cards o
so on, up to four kings. To estimate the proba
can assign the value 1 to an ace, 2 to a deuce
assigned the value 11, a queen is assigned 12, a
In fve-card draw poker, you are dealt fve card
use simulation to estimate the probability of g
have three of one type of card and no pairs. (
is a full house.) To simulate the fve cards dr
Poker.xlsx, shown in Figure 72-2.)
Associate a random number with each card in th
The fve cards chosen will be the fve cards a
numbers, which gives each card an equal cha
Count how many of each card (ace through kin

578
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 72-2
Estimating the probability that you’ll draw three o
To begin, I list in cells D3:D54 all the cards i
four 13s. Then I copy from cell E3random
to E4:E54 the R
number with each card in the deck. Copying from C
RANK.EQ(E3,$E$3:$E$54,1)
gives the rank (ordered f
random number. For example, in Figure 72-2, you c
is associated with the fourteenth smallest rando
the worksheet because the random numbers are aut
the worksheet.)
The syntax of the RANK.EQ
number,array,1
function
). If is
the
orRANK.EQ(
0
last arg
the RANK.EQ function is 1, the function returns th
smallest number receiving a rank of 1, the secon
the last argument of the RANK.EQ function
-
is 0, t
ber in the array with the largest number receivi
receiving a rank of 2, and so on.
In ranking random numbers, no ties can occur (be
match 16 digits).

Chapter
Fun
72and Games: Simulating Gambling
579
and Sporting Event Probabilities
Suppose, for example, that you are ranking the n
argument of the RANK.EQ function was 1. Excel wo
Number
Rank (smallest number has rank of 1)
1
1
3
2
3
2
4
4
Because 3 is the second smallest number, 3 wou
also be assigned a rank of 2. Because 4 is the f
a rank of 4. Understanding the treatment of ti
complete Problem 1 at the end of the chapter.
By copying from cell B3 to B4:B7 ,
the
you
formula
can draw
V
fve cards from the deck. This formula draws th
random numbers. (The lookup table.)
range
I used
C3:D54
FAL h
the VLOOKUP function because the ranks need not b
Having assigned the range name
Drawn
to the dr
J3 to J4:J15 the formula
COUNTIF(drawn,I3)
cou
drawn. In cell J17, I determine whether the ha
(AND(MAX(J3:J15)=3,COUNTIF(J3:J15,2)=0),1,0)
. This formula returns a 1 i
hand has three of one kind and no pairs.
I now use a one-way data table to simulate fou
the results of cell
J17
.
J17
Next
with
I select
the formula
the table ra
clicking What-If Analysis in the Data Tools gr
Table, I set up a one-way data table by selecti
I click OK, Excel simulates four thousand poke
probability of three of a kind. with
I estimate
the formul
the c
of three of a kind at 1.9 percent. (Using basi
probability of drawing three of a kind is 2.1 p
Going into the 2003 NCAA men’s basketball Fina
team winning the tournament?
You can rate college basketball teams using th
“Using Solver to Rate Sports Teams,” but it is d
highly respected Sagarin ratings (available
) alwaysat
gives up-to-date ratings for all college baske
Four, the Sagarin ratings of the four teams we
Kansas, 92.76; Marquette (led by Dwayne Wade
-
), 8
tion, you can play out the Final Four several th
team will win.

580
Microsoft Excel 2010: Data Analysis and Business Modeling
The mean prediction for the number of points by w
rating–underdog
. In the
rating
Final Four, there is no home t
would add fve points to the home team’s rating. (
is four points, and in college and professional f
you can use the NORM.INV function to simulate th
“The Normal Random Variable,” for a discussion o
a normal random variable.)
I calculated the likely outcome of the 2003 Fina
Figure 72-3. The semifnals pitted Kansas against M
Fig
URE 72-3
Simulating the outcome of the NCAA 2003 Final Four.
To begin, I enter each team’s name and rating in th
I use the RAND function to enter a random number f
in cell F8 I enter a random number for the Syrac
always relative to the top team listed.
In cell E4, I determine the outcome of the Kansa
Kansas) with the formula
. Note
NORM.INV(F4,D4–D5,10)
that Kansas is favo
points. In cell E8, I determine the outcome of th
of Syracuse) with the formula
. (The
NORM.INV(F8,D8–D9,
standard deviatio
winning margin of college basketball games is 10 p
In cells G5 and G6, I ensure that the winner of e
semifnal outcome of greater than 0 causes
bottom
the to
listed team wins. Thus, in cell G5, I enter the w

Chapter
Fun
72and Games: Simulating Gambling
581
and Sporting Event Probabilities
IF(E4>0,”KU”,
. In
“MARQ”)
cell G6, I enter the winner of th
formula
IF(E8>0,”SYR”,”TEX”)
.
In cell H5, I enter a random number that is us
championship game. Copying from I5 to I6 the f
obtains the rating for each team in the champi
outcome of the championship game (from the ref
cell G5) with the formula
. Finally,
NORM.INV(H5,I5–I6,10
in cell K5, I d
champion with the formula
.
IF(J5>0,G5,G6)
Now I can use a one-way data table in the usua
thousand times. The simulated winners are in th
to K13:K15 the formula
COUNTIF($M$12:$M$2011,J
-
ability for each team winning: 38 percent for K
Texas, and 14 percent for Marquette. These pro
following formula:
prob team wins
prob team loses
Odds against team winning
=
For example, the odds against Kansas are 1.63 t
(1 – 0.38)/0.38 = 1.63
This means that if you placed $1 on Kansas to w
Kansas championship, the bet is fair. Of cours
ensure that he makes money. (See Problem 6 at t
This methodology can easily be extended to sim
IF statements to ensure that each winner advan
team’s rating. See the fle Ncaa2003.xlsx-for a s
sis gave Syracuse (the eventual winner) a 4-pe
In this worksheet, I used comments to explain m
Here is some background about using comments:
To insert a comment in a cell, frst select th
group, click New Comment, and then type you
mark in the upper-right corner of any cell c
To edit a comment, right-click the cell cont
Comment.
To make a comment always visible, right-clic
Clicking Hide Comment when the comment is d
pointer is in the cell containing the comme

582
Microsoft Excel 2010: Data Analysis and Business Modeling
If you want to print your comments, click the P
small arrow in the bottom-right corner of the g
the Page Setup dialog box. In the Comments bo
whether you want comments printed as displaye
sheet.
Fig
URE 72-4
Comments in a worksheet.
Problems
1.
Suppose 30 people are in a room. What is the p
have the same birthday?
2.
What is the probability of getting dealt one p
3.
What is the probability of getting dealt two p
4.
In the game of keno, 80 balls (numbered 1 thr
are randomly drawn. Before the 20 balls
- are d
bers. If at least 5 of the numbers are drawn, t
winning?
5.
Going into the 2003 NBA fnals, the rating sys
San Antonio Spurs three points higher than th
team wins four games. The frst two games were a
Jersey, and the fnal two games were scheduled f
ity that San Antonio will win the series?
6.
What odds should the bookmaker give on
- Kansas w
maker wants to earn an average of 10 cents pe
7.
What is the probability of getting dealt a flu
8.
If you break a 1-inch stick in two places tha
smaller sticks. What are the chances that the th
9.
Suppose each hitter on a baseball team has a 50
run and a 50-percent chance of striking out. O
score in an inning?

583
Chapter 73
Using Resampling to A
Question answered in this chapter:
I produced nine batches of a product by usi
by using a low temperature. What is the pro
the high temperature?
Data analysts often need to address questions s
What is the probability that a new teaching t
What is the probability that aspirin reduce
What is the probability that Machine 1 is th
You can use a simple yet powerful technique kn
data. To make statistical inferences by using r
by sampling with replacement from your data. S
that the same data point can be chosen more th
on the results of this repeated sampling. A ke
RANDBETWEEN function. Entering
a,b
) the
yields
function
with
-
eq
RA
ability any integer between
a
and
b
(inclusive
likely to yield one of the numbers 1 through 9
Answer to This Chapter’s Quest
I produced nine batches of a product by using a h
using a low temperature
. What is the probability that the p
high temperature?
The fle Resampleyield.xlsx, shown in Figure 73
batches of a product manufactured at a high te
at a low temperature.
The mean yield at a high temperature is 39.74, a
32.27. This difference does not prove, however
-
ter than mean yield at a low temperature. You wa
probability that yield at a high temperature i
this question, you can randomly generate nine i
resampling of the high-temperature yields. For e
4, the resampled data for high-temperature yie
Next you randomly generate seven integers betw

584
Microsoft Excel 2010: Data Analysis and Business Modeling
the low-temperature yields. You can then check th
temperature mean is larger than the low-temperat
repeat this process several hundred times. (I re
In the resampled data, the fraction of the time th
the low-temperature mean estimates the probabili
superior to the low-temperature process.
Fig
URE 73-1
Product yields at high and low temperature.
To begin, you generate a resampling of the high-
to C17:C24 the formula RANDBETWEEN(1,9), as show
can be chosen more than once or not chosen at al
formula VLOOKUP(C16,lookup,2)—the range
generates
C4:E13 h
the yields corresponding to the random resamplin
resampling from the low-temperature yields. Copy
RANDBETWEEN(1,7)
generates a resampling of seven o
low-temperature data. Copying from F16 to F17:F2
generates the seven actual resampled low-tempera
Fig
URE 73-2
Implementation of resampling.
In cell D26, I compute the mean of the resampled hi
formula
AVERAGE(D16:D24)
. Similarly, in cell F26 I compute th

Chapter
Using
73
Resampling to
585
Analyze Data
low-
temperature yields with the
. Informula
cell D29,
AVERAGE(
- I det
er the resampled mean for high temperature is l
temperature with the.formula
IF(D26>F26,1,0)
To replay the resampling 400 times, you can us
numbers 1 through 400 in the cell range C32:43
Carlo Simulation,” for an explanation of how t
list of iteration values.) By typing =D29 in c
high-temperature mean is larger than low-tempe
table. After selecting the table range (C31:D4
What-If Analysis menu in the Data Tools group o
worksheet as the column input cell. You have n
the resampling 400 times. Each iteration with a v
high temperature has the larger mean. Each ite
for which low temperature has a larger mean. I
that high-temperature yield has a larger
. mean by u
In Figure 73-2, the resampling indicates a 92-
a larger mean than low temperature. Of course, p
of 400
resamplings and give you a slightly differe
temperature yield is superior to low-temperatu
Problems
1.
You are testing a new flu drug. Out of 24 flu v
better and 4 felt worse. Out of 9 flu victim
3 felt worse. What is the probability that th
2.
A talk on the dangers of high cholesterol wa
cholesterol was tested both before and afte
What is the probability that the talk cause
that reduced their cholesterol?
Cholesterol before
Cholesterol after
220
210
195
198
250
210
200
199
220
224
260
212
175
179
198
184

586
Microsoft Excel 2010: Data Analysis and Business Modeling
3.
The
beta
of a stock is simply the slope of th
monthly return on the stock from the monthly r
(S&P) 500 index. A
beta
that is larger than 1 i
the market, whereas a
beta
of less than 1 ind
market. The fle Betaresampling.xlsx contains m
Microsoft (MSFT), Pfzer (PFE), other stocks,
-
a
mine the probability that Microsoft has a low
the Excel SLOPE function to estimate the
beta
4.
The fle Lawdata.xlsx gives the LSAT scores an
students. Based on this data you are 95 perce
score and GPA is between which two values?

587
Chapter 74
Pricing Stock Optio
Questions answered in this chapter:
What are call and put options?
What is the difference between an American a
As a function of the stock price on the exe
European calls and puts?
What parameters determine the value of an o
How can I estimate the volatility of a stoc
How can I use Excel to implement the Black-
How do changes in key parameters change the v
How can I use the Black-Scholes formula to e
I don’t want somebody changing my neat opti
the formulas in my worksheet so that nobody c
How can I use option pricing to help my com
During the early 1970s, economists Fischer Bla
the Black-Scholes option-pricing formula, whic
call or put option. Scholes and Merton were awa
their efforts. (Black died before 1997, and No
work of these economists revolutionized corpor
to their important work.
Not
F
e
or an excellent technical discussion of option
Investment Science
(Oxford University Press, 1997)
Answers to This Chapter’s Ques
What are call and put options?
A
call option
gives the owner of the option th
the
exercise
. A
put
price
option
gives the owner of the o
for the exercise price.

588
Microsoft Excel 2010: Data Analysis and Business Modeling
What is the difference between an American and a E
An
American
option can be exercised on or before a d
referred to as ).
theA
expiration
European
option
date
can be exerci
date.
As a function of the stock price on the exercise d
European calls and puts?
Let’s look at cash flows from a six-month Europea
exercise price of $110. Let
P
equal the price of I
call option on these shares. is
With
$0 aifvalue
P≤110
ofand
P
b
P
you would not exercise the option. If
P
is great
to buy stock for $110 and ,immediately
thereby earning
sell
.
the
a pro
s
Figure 74-1 shows the payoff from this call opti
dollar by which the stock price exceeds the exer
be written as
. Notice
Max(0,P–110)
that the call option graph i
worksheet in the fle Optionfgures.xlsx) has a sl
exercise price. Its slope is 1 for a value of
P
g
Fig
URE 74-1
Cash flows from a call option.
You can show that if a stock pays no dividends, i
call option early. Therefore, for stock that doe
European call option both have the same value.
Now let’s look at cash flows from a six-month Eur
exercise price of $110. Let
P
equal the price of I
option ≥
is
110
$0and
110
if
PP
if.
P<110
For a value of
P
below $110, y
of stock for
P
and immediately sell .the
If stock
P
is fo
larger than $110, it would not be proftable to b
would not exercise the option to sell the stock f

Chapter
Pricing
74
Stock
589
Options
Figure 74-2 displays the payoff from this put o
Optionfgures.xlsx). In short, a put option pay
below the exercise price. A put. payoff
Note that
can the
be ws
of the put payoff is –1 for a value of
P
less th
payoff is 0 for a value of
P
greater than the e
Fig
URE 74-2
Cash flows from a put option.
An American put option can be exercised early, s
option cannot be determined without knowledge o
expiration date.
What parameters determine the value of an opti
In their derivation of the Black-Scholes optio
showed that the value of a call or put option d
Current stock price.
The option’s exercise price.
Time (in years) until the option ).
expires (r
Interest rate (per year on a compounded bas
throughout the duration of the investment.
For
T
example, if three-month T-Bills are paying 5 p
as
ln(1+0.05)
(Calculating the logarithm transform
-
pounded rate.) Compound interest simply mea
interest on your interest.
Annual rate (as a percentage of the stock p
pays 2 percent of its value each year in di

590
Microsoft Excel 2010: Data Analysis and Business Modeling
Stock
volatility
(measured on an annual basis
percent means that (approximately) the standa
changes in the stock’s price is expected to b
bubble of the late 1990s, the volatility of m
I’ll show you two ways to estimate this impor
The Black-Scholes pricing formula requires that th
random variable. See Chapter 68, “Using the Logn
Prices,” for further discussion of the lognormal r
How can I estimate the volatility of a stock bas
To estimate the volatility of a stock based on d
proceed as follows:
Determine the monthly return on the stock for a p
Determine for each month
.
ln(1+monthly return)
Determine the standard deviation
. This calculation
of
ln(1+month
g
the monthly volatility.
Multiply the monthly
12
to
volatility
convert monthly
by
volatili
volatility.
This procedure is illustrated in the fle Dellvol
of Dell stock using monthly prices from the peri
Figure 74-3, in which I’ve hidden several rows o
Fig
URE 74-3
Computing the historical volatility for Dell.
Copying from cell C2 to C3:C154 the formula
(B2–
Dell stock. Then copying from D2 to D3:D154 the f
1+month’s
. Next
return
I compute
ln(1+ month’s return)
fo
E2 to E3:E154 the
, and
formula
I compute
LN(D2)
the monthly volati
formula
STDEV.S(E2:E154)
Finally, I compute an estimate of D
the formula.
SQRT(12)*H3
Dell’s annual volatility is estimat

Chapter
Pricing
74
Stock
591
Options
How can I use Excel to implement the Black-Sch
To apply the Black-Scholes formula in Microsof
following parameters:
S
=Today’s stock price
=Duration of the option (in years)
X
=Exercise price
r
=Annual risk-free rate (This rate is assume
σ=Annual volatility of stock
y
=Percentage of stock value paid annually in d
Given these input values, the Black-Scholes pr
as follows:
Defne
?
t
Ln
(
X
S
)+(
r
y
+
2
?
2
)
t
d
1
=
and
d
2
=
d
2
?
t
Then the call price C is given by
C = Se
–yt
N
(
d
1
)
– Xe
–rt
N
(
d
2
)
Here,
N(x)
is the probability that a normal ra
to 1 is less .than
For or
example,
equal to
N(–1)=.16,N(0)=.5,
x
.
N
A normal random variable with a mean of 0 and a s
standard
.
normal
The cumulative normal probability can b
NORM.S.DIST function. Entering
NORM.S.DIST(x, T
standard normal random variable
x
. For example,
is less than
entero
NORM.S.DIST(–1,True)
in a cell will yield 0.16
with a mean of 0 and a standard deviation of 1 h
less than –1.
The price of a European put
P
can be written a
P = Se
–yt
(
N
(
d
1
)
1)
– Xe
–rt
(
N
(
d
2
)
1)

592
Microsoft Excel 2010: Data Analysis and Business Modeling
In the fle Bstemp.xlsx (see Figure 74-4), I crea
European call or put option. Enter the parameter v
a European call in D13 and a European put in D14
Fig
URE 74-4
Valuing European calls and puts.
Not
V
e
aluing American options is beyond the scope of t
refer to Luenberger’s excellent textbook.
As an example, suppose that Cisco stock sells fo
a seven-year European call option. Assume that th
percent, and the risk-free rate during the seven
year. Compounded, this translates
. Cisco does
to not
ln(1+.05)=.
pay div
annual dividend rate is 0. The value of the call o
put option with an exercise price of $24 would b
How do changes in key parameters change the valu
In general, the effect of changing an input p
given in the following table:
ParameterEuropean call American
put
American
call
put
Stock pric+
e
-
+
-
Exercise price
-
+
-
+
Time to expiration
?
?
+
+
Volatility+
+
+
+
Risk-free +
rate
-
+
-
Dividends-
+
-
+
An increase in today’s stock price always inc
value of a put.

Chapter
Pricing
74
Stock
593
Options
An increase in the exercise price always in
value of a call.
An increase in the duration of an option al
option. In the presence of dividends, an in
increase or decrease the value of a Europea
An increase in volatility always increases o
An increase in the risk-free rate increases th
to increase the growth rate of the stock pr
more than cancels out the fact that the opti
higher interest rate. An increase in the ri
because the higher growth rate of the stock t
future payoffs from the put are worth less. Ag
not affect current stock prices, but they d
Dividends tend to reduce the growth rate of a s
reduce the value of a call and increase the v
Using one-way and two-way data tables (see Cha
Tables,” for details about how to work with da
specifc effects of parameter changes on the va
How can I use the Black-Scholes formula to est
Earlier in this chapter, I showed how to use hi
volatility. The problem with a historical
backward.
vola
What you really want is an estimate of a stock
volatility
approach simply estimates a stock’s v
the Black-Scholes price match the option’s mar
the volatility value implied by the option’s m
You can easily use the Goal Seek command and th
compute an implied volatility. On July 22, 200
2003 call option with a $17.50 exercise price wa
October 18 (89 days in the future). Thus, the o
Cisco does not expect to pay dividends, and I’
acorresponding risk-free
. To
rate
determine
of
ln(1+.05)=0.0
the volati
implied by this option price, you enter the re
Ciscoimpvol.xlsx, which is shown in Figure 74-

594
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 74-5
Using implied volatility to estimate Cisco’s volati
Next you use the Goal Seek dialog box (see Figur
in cell B10) that makes the call price (the form
Fig
URE 74-6
Goal Seek settings to fnd implied volatility.
This option implies an annual volatility for Cis
Not
The Web site
www.Ivolatility.com
provides an esti
historical or implied.
I don’t want somebody changing my
. How
neat
canoption-pr
I protec
formulas in my worksheet so that nobody can chan
I’m sure that you have sent a worksheet to someo
constructed formulas. Sometimes you want to prot
only enter input data but not modify the workshe
how to protect all the formulas in the Black-Sch
Bstempprotected.xlsx.)
I begin by unlocking all the cells in the worksh
First, click the gray box in the upper-left corn
headings intersect (next to the A and the 1). Af
make affect the entire worksheet. For example, i
box, all the cells in the worksheet will use the b

Chapter
Pricing
74
Stock
595
Options
After selecting the entire worksheet, click th
on the Home tab. This displays the Format Cell
Protection tab, clear the Locked check box, as s
all cells in the worksheet are unlocked, which m
you can still access these cells.
Fig
URE 74-7
Format Cells dialog box.
Next, select all the formulas in the worksheet
dialog box. Click Special, select Formulas, an
again, and on the Protection tab, select the L
formulas.
Now you can protect the worksheet, which will p
Click Protect Sheet in the Changes group on th
select the Select Unlocked Cells check box, as s
of a template to select unlocked cells, but th
Fig
URE 74-8
Allowing user to access unlocked cells.

596
Microsoft Excel 2010: Data Analysis and Business Modeling
Now, when you click any formula, you cannot see o
try to mess up a formula! The fnal result of prot
Bstempprotected.xlsx.
How can I use option pricing to help my company m
Option pricing can be used to improve a company’
making process. The use of option pricing to eva
real options
. The idea of real options is credited to J
offcer of Merck. Essentially, real options let y
which is often missed by traditional capital bud
thceoncepts of real options.
Not
Refer to Luenberger’s book for a more detailed di
Let’s say that you own an oil well. Today, your b
$50 million. In fve years (if you own the well), y
well, at a cost of $70 million. A wildcatter is w
Should you sell the well?
Of course, the value of the oil in fve years mig
of the oil would increase by 5 percent a year, t
fve years. Traditional capital budgeting says th
develop it is more than the value of the oil in th
of the oil in the well will be different because m
change. There’s a chance that the oil will be wo
worth $80 million in fve years, developing the w
Essentially, you own a fve-year European call op
the well in fve years is the same as the payoff o
of $50 million, an exercise price of assume
$70 million
an annual volatility similar to the volatility o
30percent). If you use a T-Bill rate of 5 percent
percent, in the fle Oilwell.xlsx (see Figure 74-
option is $11.47 million, which means that you s
Of course, you do not know the actual volatility f
a one-way data table to determine how the value o

Chapter
Pricing
74
Stock
597
Options
estimate. (See Figure 74-9.) From the data tab
volatility is at least 27 percent, your oil we
Fig
URE 74-9
Oil well real options.
As a second example, consider a biotech drug c
major pharmaceutical frm. The biotech company c
is million.
$50
Of course, the value of the drug mi
price drop, the biotech company wants the drug t
in fve years. If an insurance company wants to u
to charge?
Essentially, the biotech company is asking for a p
$1 million by which the value of the drug in f
to a fve-year put option on the value of the d
the annual volatility on comparable drug stock
shown in Figure 74-10), the value of this opti
referred to as an,
abandonment
but it is equivalent
option
to a p
a one-way data table, shown in Figure 74-10, t
option depends on the assumed volatility, rang

598
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 74-10
Calculating an abandonment option.
Problems
1.
Use the monthly stock returns in the fle Vola
volatility for Intel, Microsoft, and GE.
2.
A stock is selling today for $42. The stock h
annual risk-free rate is 10 percent.
What is a fair price for a six-month Europe
$40?
How much does the current stock price have t
call option to break even in six months?
What is a fair price for a six-month Europe
$40?
How much does the current stock price have t
put option to break even in six months?
What level of volatility would make the $40 c
Goal Seek command.)

Chapter
Pricing
74
Stock
599
Options
3.
On September 25, 2000, JDS Uniphase stock s
day, a $100 European put expiring on January 2
implied volatility for JDS Uniphase stock b
percent.
4.
On August 9, 2002, Microsoft stock was sell
call option expiring on January 17, 2003, wa
estimate the implied volatility for Microso
5.
You have an option to buy a new plane in thr
estimate of the value of the plane is $21 mi
the plane’s value is 25 percent, and the ri-
buy the plane worth?
6.
The current price of copper is 95 cents per p
prices is 20 percent, and the risk-free rat
(if you want it) to spend $1.25 million to mi
can be sold at whatever the copper price is i
pound of copper from the ground. What is th
7.
You own the rights to a biotech drug. Your b
these rights is $50 million. Assuming that t
90 percent and the risk-free rate is 5 perc
rights to the drug fve years from now for $
8.
Merck is debating whether to invest in a pi
estimates that the worth of the project is –
gives Merck the option to own, if it wants t
available in four years. If Merck does not p
own the bigger project. The bigger project w
from now. Currently, Merck estimates the ne
from the bigger project to be $597 million. A
that the annual volatility for the bigger p
(This is the problem that started the whole f
9.
Develop a worksheet that uses the following i
Annual fxed cost
Unit cost
Unit price
Annual demand=
10,000–100*(price)
Protect the cells used to compute annual de

601
Chapter 75
Determining Custome
Questions answered in this chapter:
A credit-card company currently has an 80-p
company’s proftability improve if the reten
A long-distance phone company gives the com
switch. How large an incentive should it gi
Many companies undervalue their customers. Whe
look at the net present value (NPV) of the lon
the customer. (For detailed information about n
Investments by Using Net Present Value Criteria
a customer often causes a company to make poor d
cut its customer service staff by 10 percent t
service quality might cause them to lose much m
which would, of course, result in the company b
examples show how to compute customer value.
Answers to This Chapter’s Ques
A credit-card company currently. How
has will
an 80-perc
the
company’s profitability improve if the retentio
This example is based on a discussion in Frede
Effect
(Harvard Business School Press, 2001). Y
fle Loyalty.xlsx, shown in Figure 75-1. Reichh
customer based on the number of years the cust
the frst year a customer has the credit card, t
the result of customer acquisition costs and th
During each successive year, the proft generat
who has owned a card for 20 or more years gene
The credit-card company wants to determine how th
company’s retention rate. Currently, the compa
means that at the end of each year, 20 percent (
card. (I refer to the 20 percent of customers
.) The
w
credit-card company wants to determine the lon
rates of 80 percent, 85 percent, 90 percent, 9

602
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 75-1
Value of a credit-card customer.
To determine the long-term value of a customer, y
100 customers. (A
cohort
is a group of individua
size 100 is arbitrary here, but round numbers ma
yod
uetermine how many of these customers are stil
(Customers around for year t+1)=(Retention
. You can
rate)
assume that customers quit only at the end of ea
to determine the total NPV (assuming a 15-percen
nal cohort of 100 customers. The 15-percent disc
from now is worth the same as
$1.00/$1.15
of pro
the number of customers in the original cohort (
customer.
I frst assign the names in the cell range B6:B7 t
number of original customers (100) in cell C9. C
the formula
retention_rate*C9
generates the numb
example, 80 customers will be present in Year 2.
I compute the proft earned each year by multiply
each customer’s proft. To make this calculation, c
C9*B9
. In cell E4, I compute the average NPV gener
formula
(1+Interest_rate)*NPV(Interest_rate,D9:D
. I am assuming cash flow
beginning of the year and a 15-percent annual di
that reads
NPV(Interest_rate,D9:D38)
computes th
customer assuming end-of-year cash flows. Multipl
end-of-year cash flow NPV to a beginning-of-year N

Chapter
Determining
75
Customer
603
Value
With an 80-percent retention rate, the average c
the value of an individual customer varies with a c
way data table. I enter the relevant annual re
enter the formula I want the data table
=E4
to
. cal
Next, I select the table range (F8:G13) and th
command on the Data tab. After entering a colu
culations shown in Figure 75-1. Notice that in
90 percent nearly doubles the value of each cu
to these customers and against pinching pennie
Understanding the value of a customer gives mo
to increase their proftability.
A long-distance phone company gives the compet
switch
. How large an incentive should it give?
Let’s say that you work for a phone company in w
spends $400 per year and the company generates a 1
spent. At the end of each year, 50 percent
-
of th
tition, and without any incentives, 30 percent o
company. You’re considering giving the competi
switch companies. How large an incentive can y
The key to analyzing this problem (which you c
Figure 75-2) is to look at the NPV for two sit
Situation 1: 100 customers begin with the c
Situation 2: You pay the 100 customers who a
to switch to your company.
Following through each situation for a period o
Goal Seek command to determine the dollar amou
company that makes you indifferent about the f
Situation 1: You have just
x
each
paid to
100
switch
unloyal
to c
y
company.
Situation 2: The market consists of 100 unl
Assume that the analysis begins on June 30, 20
companies at most once per year. I assigned th
The key step in the analysis is to realize tha
.3*(year t competitor customers)+.5*(year
Similarly
(yeartt+1
ourcc
competition)=.7*(year t competition
.
customers)

604
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 75-2
Phone incentive analysis.
Next I enter 100 in cell D9 (customers with us) a
competition). This customer alignment correspond
is offered to 100 customers. I’m assuming that c
with the company for at least one year. Copying f
(1–probleave)*D9+probcome*E9
generates the numbe
(Years 2022 through 2029 are hidden in Figure 75
formula
probleave*D9+(1–probcome)*E9
calculates th
competition during each year.
In cell F9, I generate the proft earned during th
D9*annrevenue*proftmargin–switch_fee*100
. Note that I have subtracte
paying the 100 customers with the competition to s
the formula
D10*annrevenue*proftmargin
generates p
D5, I compute the NPV of the profts associated w
XNPV(0.1,F9:F28,B9:B28)
(See Chapter 8 for a discussion of th
In a similar fashion, in the cell range G8:I28 I g
100 customers who were originally with the compe
customers will have switched (even without incen
between the NPV with the incentive and the NPV w
Finally, I use the Goal Seek command to vary the s
to 0. The Goal Seek dialog box is shown in Figur
NPV of the two situations identical. Therefore, y
customer to switch and still have increased prof

Chapter
Determining
75
Customer
605
Value
Fig
URE 75-3
Goal Seek settings to determine the maximum ince
Problems
1.
Whirlswim Appliance is considering giving e
each VCR purchased. The company estimates th
an average of $2.50 for each VCR sold today (
market consists of 72,000 consumers whose l
86,000 consumers whose last purchase was
-
fr
cent of all consumers purchase a VCR. If th
60-percent chance that their next purchase w
was not a Whirlswim, there is a 30-percent c
Whirlswim. A purchase during the current
-
ye
tion to proft (and maintenance cost per
-
pur
cent per year. Profts (over a 30-year horizo
Suppose that you provide free maintenance. I
Whirlswim, the probability that the custome
increase by an unknown amount between 0 per
give free maintenance and the customer’s
-
la
ability that their next purchase is a Whirl
between 0 percent and 10 percent. Do you re
maintenance policy?
2.
Mr. D’s Supermarket is determined to please i
card. Currently, 30 percent of all shoppers a
shops at Mr. D’s 80 percent of the time. An u
percent of the time. A typical customer spe
on a 4-percent proft margin.
The customer advantage card will cost Mr. D
believe Mr. D’s share of loyal customers wil
2 percent and 10 percent. You also believe
-
th
tomer shops at Mr. D’s will increase by an u
percent. Should Mr. D’s adopt a customer ads a
card if its proft margin is 8 percent inste

607
Chapter 76
The Economic Order Qu
Inventory Model
Questions answered in this chapter:
An electronics store sells 10,000 cell phon
a supply of cell phones, the store incurs a
each cell phone, and the cost of holding a c
to be $20. When the store orders cell phone
A computer manufacturing plant produces 10,
each server is $2,000. The cost to set up a p
cost to hold a server in inventory for a ye
servers per year if it wants to. When the p
should it produce?
When a store orders an item repeatedly, a natu
order each time? If the store orders too many i
costs. If the store orders too few items, it i
must be a happy medium that minimizes the sum o
Similarly, consider a manufacturing plant that p
size minimizes the sum of annual inventory and s
chapter show how to use the economic order qua
F. Harris of Westinghouse Corporation) to answ
Answers to This Chapter’s Ques
An electronics store sells
. Each
10,000
time
cell
an order
phonesi p
supply of cell phones, an . order
The store
cost pays
of
$100
is fi
phone, and the cost of holding a cell phone
.
in i
When the store orders cell phones, how large a
The size of an order that minimizes the sum of a
determined after the following parameters are k
K
=Cost per order
h
=Cost of holding one unit in inventory for a y
D
=Annual demand for product

608
Microsoft Excel 2010: Data Analysis and Business Modeling
You can follow an example of how to work with th
worksheet in the fle Eoq.xlsx, which is shown in Fi
Fig
URE 76-1
EOQ template.
If
q
equals order size,.
q
5
annual
h
. (Throughout
inventory
this
cost
exam
eq
this equation as Equation 1.) We derive
0
.Equation
5)
1 b
will be half the maximum inventory level.
q
5, note
To see w
that you can compute the average inventory level f
of orders). At the beginning of a cycle,
. At an
theorde
end of the cycle, you are out of stock, and the i
at a constant rate, the average inventory level d
q
or
5
q
.
0
Maximum
.
inventory level will equal
q
becau
instant that the inventory level is reduced to 0
Because
D/q
orders are placed per .year,
(I refer
annual
to othi
equation as Equation 2.) Using calculus or the E
of inventory and ordering costs is minimized for a v
quantity (EOQ), which is calculated using the fo
Equation 3.)
h
2
KD
EOQ=
From this formula, you can see the following:
An increase in demand or ordering cost will i
An increase in holding cost will decrease the E
In the fle Eoq.xlsx, I use Equation 3 to determi
cost in cell C6 by using Equation 1. I determine
2. Notice that for EOQ, the annual ordering cost e
always be the case. In cell C8, I determine the t
which does not depend on my ordering
.
strategy) w
Of course, you can use one-way and two-way data t
the EOQ and various,costs
,
h
an
.dIn
to
D
this
variations
=
$1
example,
0 D=10,000
in
KK
cel

Chapter
The
76Economic Order Quantity
609
Inventory Model
phones per=
$20
year,
perand
cell
h
phones. Inserting thes
following:
Each order should be for 100 cell phones.
Annual holding and ordering costs each equa
holding costs equal to annual ordering cost
Total annual costs (exclusive of purchasing c
When you are working with EOQ, keep the follow
The presence of quantity discounts invalida
cost then depends on the order size.
The EOQ assumes that demand occurs at a rel
The EOQ should not be used for products for w
Annual holding cost is usually assumed to b
product’s unit purchasing cost.
I’ve included (in the EOQ
Protected
workshe
worksheet in which all formulas are protect
can change the formulas. See Chapter 74, “P
about how to protect a worksheet.
More Info
For more information about inventory modelin
book
Operations Research: Applications and Algorit
A computer manufacturing plant produces
. The cost10,000
to pr s
each server. The
is $2,000
cost to set up a production ru
to hold a server in inventory
. The plant
forcan year
produce
is $50
2
year if it
. When
wants
the
toplant produces servers, how l
With the EOQ model, you assume an order arrive
company manufactures a product instead of orde
cannot arrive instantaneously. In such situati
order quantity, you need to determine the- cost
duces a product internally instead of purchasi
minimizes costs depends on the following param
K
=Cost of setting up a batch for production
h
=Cost of holding each unit in inventory for a y
D
=Annual demand for the product
R
=Annual rate at which the product can be pr
capacity to produce 25,000 servers per year

610
Microsoft Excel 2010: Data Analysis and Business Modeling
If
q
equals the size of each production batch, t
0.5*(q/R)*(R–D)*h
(I refer to this equation as Equation 4
batch takes
q/R
years to produce, and during a p
rate .
ofThe
R–D
maximum inventory level, which occurs a
calculated .
asThe
(q/R)*(R–D)
average inventory level
.
will th
Because
D/q
batches are produced per year, annua
to as Equation 5). Using calculus or the Excel S
minimizes the sum of annual setup and production
(which I refer to as Equation 6). This model is c
h
(
R–D
)
2
KDR
EOB=
From this formula, you can determine the followi
An increase in
K
or
D
will increase the EOB.
An increase in
h
or
R
will decrease the EOB.
In the
Cont Rate EOQ
worksheet in the fle Contra
determine the EOB, annual setup, and holding cos
Fig
URE 76-2
Template for computing EOB.
For this =$200,
example,
=$500,
h
=10,000
KD
units=
25,000
per year,
units
andper
R
y
After entering these parameter values in the cel
The batch size that minimizes costs is 115.47 s
produce 115 or 116 servers in each batch.
The annual holding cost and setup costs equal $
set annual holding cost equal to annual setup c
Total annual cost (exclusive of variable prod
86.6 batches per year will be produced.

Chapter
The
76Economic Order Quantity
611
Inventory Model
When you are working with the EOB model, keep th
If the unit variable cost of producing a pr
model is invalid.
The EOB assumes that demand occurs at a rel
The EOB should not be used for products for w
The annual holding cost is usually assumed t
of a product’s unit purchasing cost.
I’ve included (in the
Protected
worksheet i
EOB worksheet in which all formulas are prot
about how to protect a worksheet.
Problems
1.
An appliance store sells plasma TVs. Annual d
cost to carry a TV in inventory for one yea
plasma TVs is $400.
How many TVs should be ordered each time a
How many orders per year should be placed
What are the annual inventory and orderin
2.
Suppose that the Waterford Crystalpitchers
company c
per day. Further suppose that the plant is o
demand is for 20,000 pitchers. The cost to h
be $10, and the cost to set up the facility t
What batch size would you recommend for i
How many batches per year should be produ
What are the annual setup and inventory c

613
Chapter 77
Inventory Modeling w
Demand
Questions answered in this chapter:
At what inventory level should I place an o
holding, ordering, and shortage costs?
What does the term
95-percent service level
In Chapter 76, “The Economic Order Quantity In
economic order quantity (EOQ) to determine an o
batch size. The examples assumed that demand o
demand occurred at a rate of, for example, 1,2
equal 100 units. As long as demand occurs at a r
approximation of the cost-minimizing order qua
In reality, demand during any time period is u
question is how low to let the inventory level g
at which an order should be. placed
Clearly,
is called
high rth
will decrease shortage costs and increase hold
increase shortage costs and decrease holding c
sum of shortage and holding costs is minimized
to determine a reorder point that minimizes ex
based on the following two assumptions:
Each unit you are short is back ordered by a c
cost
c
B
. This cost is primarily a measure of the c
receipt of an ordered item.
Each unit you are short results in a lost s
L
>
S
c
B
.
The lost sales cost includes the proft lost f
included in c
B.
The second example shows how to determine the o
level
approach.
95-percent
For example,
service
a
level means th
at a level ensuring that, on average, 95 perce
diffcult to determine the cost of a shortage i
case. For that reason, most companies set reor

614
Microsoft Excel 2010: Data Analysis and Business Modeling
Not
O
e
n this book’s companion Web site, for the back-o
I’ve included a worksheet named
Protected
in which a
back-ordered and lost-sales cases. You can use these w
Answers to This Chapter’s Quest
At what inventory level should I place an order if m
ordering, and shortage costs?
As I indicated in Chapter 76, the EOQ depends on th
K
=Cost per order .
h
=Cost of holding one unit in inventory for a y
D
=Annual demand for the product. Because deman
for the expected annual demand for the produc
The Back-Order Case
See the fle Reorderpoint_backorder.xlsx, shown i
example. Let’s frst suppose that each shortage r
words, a shortage does not result in any lost de
short incurs a cost
c
B
. In this case, the reorder point depen
EOQ
is the economic order quantity (the quanti
K
is the cost per order
h
is the annual holding cost per unit
D
is the mean annual demand
SOC
is the cost per unit short
annsig
is the standard deviation of annual de
meanLT
is the average
; that is,
lead
the
time
average time bet
and the time the order is received
sigmaLT
is the standard deviation of lead tim
Say that a department store wants to determine a
electric mixers. They have the following informa
It costs $50 to place an order for mixers.
It costs $10 to hold a mixer in inventory for a y

Chapter
Inventory
77
Modeling with
615
Uncertain Demand
Fig
URE 77-1
Determining reorder point when shortages are bac
On average, the store sells 1,000 mixers pe
All customers who try to purchase a mixer w
a later date and buy a mixer when the mixer i
$20 for each unit it is short.
The annual demand for mixers (based on hist
40.8.
Lead time is always two weeks (0.038 years)
After you
,
h,
enter
and
KD
in cells C2:C4, the spreads
C5. After you
,
annsig
,enter
meanLT
, and
SOC sigmaLT
in cells -C7:C10
putes in cell C14 the reorder point that minimi
shortage costs (51.63 mixers). Thus, the depar
its stock decreases to 51.62 (or 52) mixers.
The
safety stock level
associated with a given r
demand
. The department store maintains a safety s
computed in cell C15. Essentially, the safety s
holding costs. A higher level of safety stock w
The Lost-Sales Case
Now suppose that each shortage results in a lo
is usually estimated as the back-order penalty p
Suppose that the department store earns a $20 p
shortage cost for the
$20
lost-sales
proft+$20
case ).
is
back-o
then $
In the fle Reorderpoint_lostsales.xlsx, shown i
estimate the reorder point for the lost-sales c
the lost-sales cost of $40, I fnd that the opti
place an order when inventory is down to 54.23 mi
and 2.4 percent of the store’s demand for mixe

616
Microsoft Excel 2010: Data Analysis and Business Modeling
of a lost sale has increased the reorder point a
happens because the increased cost of a shortage (
eager to avoid shortages.
Fig
URE 77-2
Determining reorder point when sales will be lost.
Increased uncertainty greatly increases the reor
if the standard deviation for lead time is one we
point increases to 79.50 mixers, and the safety s
which our lead time was known with certainty.
What does the term 95-percent service level mean
As stated earlier in the chapter, a
95-percent s
95 percent of your demand to be met on time. Bec
and/or the penalty that results from a lost sale i
stock levels for products by setting a service l
(shown in Figure 77-3), you can determine the re
level you want.
Fig
URE 77-3
Determination of reorder point using the service l

Chapter
Inventory
77
Modeling with
617
Uncertain Demand
As an example, consider a pharmacy that is try
for a drug it stocks. The pharmacy would like t
time. The following parameters are relevant.
Each order for the drug costs $50.
The cost to hold a unit of the drug in inve
Average demand per year for the drug is 1,0
The standard deviation of annual demand is 6
The time required to receive a shipment of th
(0.083 years).
You enter the service level you want (0.95) in c
and C7:C9. To determine the reorder point yiel
the Data Analysis group on the Data tab.- The S
order point until the percentage of demand met o
Under Options, choose the Multistart setting. (
GRG Multistart and Evolutionary Solver Engines
reorder point (to keep the Solver from trying a n
of 10,000 (fairly arbitrary) on the reorder po
bound, you should relax the bound. As you can s
order 100 units of the drug whenever its inven
point corresponds to a safety stock level of 6
Fig
URE 77-4
Solver Parameters dialog box for determining the r

618
Microsoft Excel 2010: Data Analysis and Business Modeling
In the following table, I’ve listed the reorder p
service levels between 80 percent and 99 percent
Service-levelReorder
percentage
point/units
Safety stock/units
80
65.34
-17.99
85
71.85
-11.48
90
79.57
-3.76
95
90.23
6.90
99
108.44
25.11
Notice that moving from an 80-percent service le
the reorder point by almost 67 percent!
- Also not
vice level with a reorder point less than the me
in Figure 77-3). A 90-percent service level resu
possible because shortages occur only during the l
small portion of a year.
Problems
When working with Problems 1 and 2, assume that a r
bottles of wine per year. The standard deviation o
bottles. The annual holding cost for a bottle of w
wine, and it takes an average of three weeks (wi
wine to arrive.
1.
Assume that when the restaurant is out of win
lost goodwill. Also, the restaurant earns a p
optimal ordering policy for the wine.
2.
Determine an inventory policy for wine that y
3.
A reorder point policy is often
. How referred
can a reorder
to a p
policy be implemented in a situation in which t

619
Chapter 78
Queuing Theory: The M
of Waiting in Line
Questions answered in this chapter:
What factors affect the number of people an
What conditions should be met before analyz
present or the average time spent in a queu
Why does variability degrade the performanc
Can I easily determine the average time a p
in line at a bank?
We have all spent a lot of time waiting in lin
in service capacity can often greatly reduce th
a business, ensuring that your customers
-
do not s
tant. Therefore, business people need to under
referred to as
. In
queuing
this chapter,
theory
I’ll show you h
capacity needed to provide adequate service.
Answers to This Chapter’s Ques
What factors affect the number of people and t
In this chapter, I’ll address queuing problems i
for the frst available service person. (To kee
servers
.) This model is a fairly accurate represen
wait at a bank, at an airport security line, o
customers wait in one line started about 1970, w
that although waiting in one line does not red
it does reduce the variability of the time the
Three main factors influence the time you spend i
The number of
Clearly,
servers
the more servers, the l
spend in line, and fewer people on average w
The mean and the standard deviation
The
of
time
the t
between arrivals is
. called
If the average
interarrival tim
the number of arrivals decreases, which res

620
Microsoft Excel 2010: Data Analysis and Business Modeling
a queuing system. As you’ll soon interarrival
see, an incr
times increases the average time a customer s
average number of customers present.
The mean and the standard deviation of the ti
service
If the average service time increases, yo
time a customer spends in the system and in th
you’ll see, an increase in the standard devia
time a customer spends in a queuing system an
present.
What conditions should be met before analyzing t
or the average time spent in a queuing system?
When analyzing the time people spend waiting in l
state
characteristics of a system. Essentially, s
for a long time. More specifcally, analysts woul
quantities in the steady state:
W
=Average time a customer spends in the syste
W
q
=Average time a customer spends waiting in l
L
=Average number of customers present in the s
L
q
=Average number of customers waiting in line
By the way, it is always true that
L=(1/mean int
q
=(1/mean interarr
time)*W
q
.
To discuss the steady state of a queuing system m
The mean and standard deviation of both the i
changes little over time. The technical phras
service times is
stationary
over time.
(1/mean service time)*(number of
. I’ll
servers)>(1/(
refer to thi
equation as Equation 1.
Essentially, if Equation 1 is true, you can serv
For example, if mean service time equals 2 minut
interarrival time equals 1 minute (or 1/60 of an h
30*(number
servers)>60
of
, or that the number of servers must b
for a steady state to exist. If you cannot serve c
you fall behind and never catch up, resulting in a

Chapter
Queuing
78
Theory: The Mathematics
621
of Waiting in Line
Why does variability degrade the performance o
To see why variability degrades the performanc
system in which customers arrive every 2 minut
There will never be more than one customer in th
arrive every 2 minutes, but half of all servic
Even though arrivals are totally predictable,
-
t
tually the server falls behind and a line form
3.5 minute service times, after 12 minutes, fo
the following table.
Time
Event
Present after event
0 minutes Arrival
1 person
2 minutes Arrival
2 people
3.5 minutesService completed
1 person
4 minutes Arrival
2 people
6 minutes Arrival
3 people
7 minutes Service completed
2 people
8 minutes Arrival
3 people
10 minutes Arrival
4 people
10.5 minutes
Service completed
3 people
12 minutesArrival
4 people
Can I easily determine the average time a pers
line at a bank?
The
Model
worksheet in the fle Queuingtemplate
to determine approximate
, ,
W
q
,
L
and
values
W
for
L
q
(usually within 10 per
value). The worksheet is shown in Figure 78-1.
Fig
URE 78-1
Queuing template.

622
Microsoft Excel 2010: Data Analysis and Business Modeling
After you enter the following data, the template c
q
,
q
,
L
,
W
an
. dThe
L
parameter
in cells B6:B9 can easily be estimated by using p
Number of servers (cell B5)
Mean interarrival time (cell B6)
Mean service time (cell B7)
Standard deviation of interarrival times (cel
Standard deviation of service times (cell B9)
Here’s an example of the template in action. You wa
characteristics of an airline security line duri
number of agents working. In the
Queuing Data
wo
shown in Figure 78-2, I’ve tabulated interarriva
been hidden.)
Fig
URE 78-2
Airline interarrival and service times.
By copying from cell B1 to ,C1you
thefnd
formula
the mean
AVERAG
int
time is 12.864 seconds and the mean service
-
time i
vice time is almost six times as large as mean i
to guarantee a steady state. Copying from cell B
you that the standard deviation of the interarri
deviation of the service times is 48.051 seconds

Chapter
Queuing
78
Theory: The Mathematics
623
of Waiting in Line
Returning to the queuing template in the
Model
B6:B9 and enter six servers in cell B5, you fn
236 people will be in line (cell B19). You’ve p
I used a one-way data table (shown in Figure 7
of agents affects the system’s performance. In c
to consider (6 through 10). In (
cell
=B19
), G9,
and Iinente
H9,
I enter the formula
(
=B18
). to
Next,
compute
I select
W
the table r
click Data Table from the What-If Analysis men
number of servers) as the row input cell, I ob
that adding just one ticket agent to the origi
of customers present in line from 236 to fewer th
customer’s average time in the system from 3,0
minutes). This example shows that a small incr
performance of a queuing system.
Fig
URE 78-3
Sensitivity analysis for an airport security lin
In cells F16:K22, I used a two-way data table t
the system
W
) to (changes in the number of servers an
The row input cell is B5, and the column input c
increase in the standard deviation of service ti
29 percent increase in the mean time in the sy
Not
Readers who are interested in a more extensive d
refer to my book
Operations Research: Applications a

624
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
A bank has six tellers. Use the following inform
Mean service time equals 1 minute.
Mean interarrival time equals 25 seconds.
Standard deviation of service times equals 1 mi
Standard deviation of interarrival times equal
1.
Determine the average time a customer waits i
2.
On average, how many customers are present in th
3.
Would you recommend adding more tellers?
4.
Suppose it costs $20 per hour to have a telle
at $15 per hour. How many tellers should you h
5.
Thirty women work on the ffth floor of a busin
the restroom three times a day (the offce is o
takes 180 seconds on average, with a standard d
standard deviation of time between arrivals t
toilets would you recommend for the woman’s r

625
Chapter 79
Estimating a Demand C
Questions answered in this chapter:
What do I need to know to price a product?
What is the meaning ?of
elasticity of demand
Is there any easy way to estimate a demand c
What does a demand curve tell us about a cu
product?
Every business must determine a price for each o
diffcult. In Chapter 80, “Pricing Products by U
by Using Subjectively Determined Demand,” I’ll d
you in pricing a product to maximize proftabil
the excellent book
, by
Power
Robert
Pricing
J. Dolan and Hermann
Answers to This Chapter’s Qu
What do i need to know to price a product?
Let’s consider a product such as a candy bar. I
you need to know two things:
The variable cost of producing each
).
unit of th
The product’s
demand
curve. Simply
tells
put,
you
a th
of a product a customer will demand at
p
each p
per unit, the demand curve
, which
gives
equals
you athe
numb
of the product that will
p
. Ofbecourse,
demanded frm’s
at prid
constantly changing and often depends on fa
the state of the economy and a competitor’s p
After you know
UC
and the demand curve,
p
isthe
simpl
pr
(p–UC)*D(p)
. After you have,an
which
equation
givesfor
the
D(p)
quantit
demanded for each price, you can use the Micro
maximizing price, which I’ll show you how to d

626
Microsoft Excel 2010: Data Analysis and Business Modeling
What is the meaning of
?
elasticity of demand
Given a demand curve, the
price elasticity
for d
demand resulting from a 1 percent increase in pr
demand is price elastic. When demand is price el
elasticity is less than 1 percent, demand is pri
price cut decreases revenue. Here are some obser
Salt, 0.1 (very inelastic)
Coffee, 0.25 (inelastic)
Legal fees, 0.4 (inelastic)
TV sets, 1.2 (slightly elastic)
Restaurant meals, 2.3 (elastic)
Foreign travel, 4.0 (very elastic)
A 1-percent decrease in the cost of foreign trav
increase in demand for foreign travel.
is there any easy way to estimate a demand curve
Using
q
to represent the quantity demanded of a p
forms for estimating demand curves are as follow
Linear demand
In this
curve
case, demand follows a str
form
q=a–bp
. For example,
q=10–p
is a linear demand c
determined by using a method that I’ll descri
curve is linear, the elasticity is constantly c
Power demand
In
curve
this situation, the demand curv
curve of the form
q=ap
b
,
b<0
. (See Chapter 51, “The Power
-
Cur
tion.) Again,
a
and
b
can be determined by th
The equation
q=100p
-2
is an example of a power demand cu
a power curve, for any price the elasticity e
q=100p
-
,
2
the price elasticity of demand always e
Suppose that a product’s demand curve follows a l
the current price and demand for a product and th
determining the product’s demand curve is a simp
A product is currently selling for $100 and dema
elasticity for demand is 2. Assuming the demand c
equation of the demand curve. The solution is in th
Figure 79-1.

Chapter
Estimating
79
a Demand
627
Curve
Fig
URE 79-1
Fitting a linear demand curve.
Given two points, you know that a unique strai
you actually know two points on the demand
. Because
cur
elasticity of demand equals 2, a 1-percent inc
in demand. Thus, if
p=101
(a 1-percent increas
units) to 490. Thus
p=101
and
q=490
is a secon
use the Excel trendline to fnd the straight li
(101,490).
You begin by entering these points in the work
Figure 79-1. Then you select the range D4:E6, a
Insert tab, choose Scatter, Scatter With Strai
chart, you see the graph has a positive slope. T
demand, which cannot be correct. The problem
-
i
sumes that the data points you want to graph a
To be sure that Excel understands that the ind
the graph, and on the ribbon, click the Design t
Switch Row/Column in the Data section of the D
Data button, you can change the source data th
one of the points, click Add Trendline, and th
On Chart options. After clicking OK in the Add T
line plot, complete with the equation shown
-
in Fi
mand, the equation for the
. demand
This equation
curve is
means
q=1
th
increase in price costs you 10 units of demand
values of
p
because for large values demand.
of
p,
a l

628
Microsoft Excel 2010: Data Analysis and Business Modeling
For prices near the current price, however, the l
approximation of the product’s true demand curve
As a second example, let’s again assume that a p
demand equals 500 units. The product’s price ela
power demand curve to this information. See the fl
Fig
URE 79-2
Power demand curve.
In cell E3, I enter
. Then,
a trial
in cell
value
D5, for
I enter
a
the c
elasticity of demand equals 2, we know that the d
-
,
2
where
a
is unknown. In cell E5, I enter the demand for a p
of
a
in cell E3, with
. Nowthe
I can
formula
use the
a*D5^-2
Goal Seek c
see Chapter 18, “The Goal Seek Command”)- to dete
mand for price $100 equal to 500 units. I simply s
E3. I fnd that a value for
a
of 5 million yields a d
demand curve (graphed in Figure 79-2) is given by
-
.
2
For any price, th
elasticity of demand on this demand curve equals 2
What does a demand curve tell us about a custome
product?
Let’s suppose you are trying to sell a software p
equal the number of copies of the program the co
charged for the software. Suppose you have estim
is given .
byClearly,
q=400–p
your customer is willing to p
of the software program. Locked inside this dema
the company is willing to pay for each unit of th
maximizing proftability of sales.

Chapter
Estimating
79
a Demand
629
Curve
Let’s rewrite the demand
. Thus,
curve
,when
p=$399
,as
q=1
and
p=400–q
so on. Now l
try and fgure out the value the customer- attac
gram. Assuming that the customer is rational, t
value of the unit exceeds your price. At a pri
cannot be worth $400. At a price of $399, howe
frst unit must be worth something between $399 a
thceustomer does not purchase the second unit. A
is purchasing two units, so the customer does p
customer values the second unit somewhere betw
It can be shown that the bestthapproximation
unit purchased
of by
th th
customer is the price that
. For
makes
example,
demand by
equal
setti
0.5, the value of the .frst
Similarly,
unit is
, by
400–0.5=$39
thesetting
value o
q
second unit is.
400–1.5=$398.50
Problems
1.
Suppose you are charging $60 for a board ga
thousand copies during the last year. Elasti
Use this information to determine a linear a
2.
For each of your answers in Problem 1, dete
two thousandth unit purchased of your game.

631
Chapter 80
Pricing Products by U
Question answered in this chapter:
How does the fact that customers buy razor b
proft-maximizing price of razors?
Certain consumer product purchases frequently r
or
tie-ins
. Here are some examples:
Original purchasTie-in product
Razor
Razor blades
Men’s suit
Shirt and/or tie
Personal computerSoftware training manual
Video game console
Video game
Using the techniques I described in Chapter 79
determine a demand curve for the product that’
Microsoft Excel Solver to determine the origin
proft earned from the original and the tie-in p
this analysis is done.
Answer to This Chapter’s Que
How does the fact that customers buy razor bla
proft-maximizing price of razors?
Suppose that you’re currently charging $5.00 f
Assume that the variable cost of producing a r
elasticity of demand for razors is 2. What pri
Let’s assume (incorrectly) that no purchasers o
demand curve (assuming a linear demand curve) a
data and the chart on the
No Blades
worksheet i
on the demand curve are price=$5.00, demand=6 mi
of 1 percent), demand=5.88 million (2 percent l
inserting a linear trendline as shown in Chapt
y=18–2.4x
Because
x
equals price and
y
equals dem
razors as follows:
demand
.
(in millions)=18–2.4

632
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 80-1
Determining the proft-maximizing price for razors.
I associate the names in cell C6 and the range C
enter a trial price in D9 and determine
formula
demand f
18-2.4*price
Then I determine in cell D11 the proft fo
demand*(price–unit_cost)
.
Next, I use Solver to determine the proft-maximi
is shown in Figure 80-2.
Fig
URE 80-2
Solver Parameters dialog box set up for maximizing r
I maximize the proft cell (cell D11) by changing th
because the target cell multiplies together two q

Chapter
Pricing
80
Products by
633
Using Tie-Ins
depending on the changing cell. Solver fnds th
(Maximum proft is $18.15 million.)
Now let’s suppose that the average purchaser o
$0.15 of proft per blade purchased. How does thi
razor? Assume that the price of a blade is fxe
blade price changes.) The analysis is in the
B
Fig
URE 80-3
Price for razors with blade proft included.
I used the Create From Selection command in th
tab to associate the names in cells C6:C11 with c
Demand
.)
Not
Astute readers will recall that I also .named ce
What does Excel do when you use the range name
Dem
the cell named
Demand
in the current worksheet. In o
Demand
in the
Blades
worksheet, Excel refers to ce
the
No Blades
worksheet.
In cells D7 and D8, I entered the relevant inf
trial price for razors, and in D10 I.computed
Next,
d
in cell D11, I computed total proft from razor
demand*(price–unit_cost)+demand*blades_per_raz
. Notice that
demand*blades_per_razor*proft_per_blade
is the p
The Solver setup is exactly as was shown
maximize
earli
the proft. Of course, now the proft formula in
shows that proft is maximized by charging
razor.only $
This price results from making so much money f

634
Microsoft Excel 2010: Data Analysis and Business Modeling
ensuring that many people have razors even thoug
companies do not understand the importance of th
them to overprice their primary product and not m
Problems
Not
I
e
n all of the following problems, assume a linear d
1.
You are trying to determine the proft-maximiz
Currently, you are charging $180 and selling 2 mi
produce a console, and price elasticity of de
you charge for a console?
2.
Now assume that, on average, a purchaser of y
games and you earn $10 proft on each video ga
consoles?
3.
In the razor and blade example, suppose the c
charge $0.35 for a blade, a customer buys an a
elasticity of demand for blades is 3. What pr
blade?
4.
You are managing a movie theater that can han
week. The current demand, price, and elastici
candy are given in Figure 80-4. The theater k
cost per ticket, popcorn sales, candy sales, a
linear demand curves, how can the theater max
fraction of patrons who purchase the given fo
Fig
URE 80-4
Movie problem data.
5.
A prescription drug is produced in the United S
of the drug costs $60 to produce. In the Germ
150 euros per unit. The current exchange rate i
demand for the drug is 100 units, and the esti
demand curve, determine the appropriate sales p

635
Chapter 81
Pricing Products by U
Subjectively Determ
Questions answered in this chapter:
Sometimes I don’t know the price elasticity f
believe a linear or power demand curve is r
and use Solver to determine a proft-maximiz
How can a small drugstore determine the pro
Answer to This Chapter’s Que
Sometimes i don’t know the price
n other
elasticity
situations
fo
believe a linear or power demand curve is rele
curve and use Solver to determine a proft-maxi
In situations when you don’t know the price el
rely on a linear or power demand curve, a good wa
is to identify the lowest price and highest
-
pr
timate the product’s demand with the high pric
the high and low prices. Given these three poi
use the Microsoft Excel trendline feature to f
formula (which I’ll call Equation 1):
Demand=a(price)
2
+b(price)+c
For any three specifed points
,,
b
on
and
the
c
exist
demandtha
cu
Equation 1 exactly ft the three specifed point
demand curve, it seems reasonable to believe
-
th
sentation of demand for other prices. You can th
maximum proft, which is given by. the
The formula
followin
(
example shows how this process works.
How can a small drugstore determine the proft-
Let’s suppose that a drugstore pays $0.90 for e
considering charging from $1.50 through $2.50 f
price of $1.50, it will sell 60 units per week
a price of $2.00, the store thinks it will sel
per week. What price should the store charge f

636
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 81-1
Lipstick pricing model.
You begin by entering the three points with whic
range E3:F6. After selecting E3:F6, click the Ch
select the frst option for a Scatter chart. You c
Trendline. In the Format Trendline dialog box (s
2 in the Order box (to obtain a quadratic curve o
option Display Equation On Chart.
Fig
URE 81-2
Confguring the Format Trendline dialog box for sele

Chapter
Pricing
81
Products by Using Subjectively
637
Determined Demand
Excel creates the chart shown in Figure 81-1. T
Demand=–44*Price
2
+136*Price–45
.
Next, you insert a trial price in cell I2. You c
cell I3 with the formula
.
(I
–44*price^2+136*price
named.)cell
ThenI2
-you
Price
co
pute weekly proft from lipstick sales in
. cell I
(Cell E2 is ,
named
and cell
Unit_Cost
I3 .)
is Then
named
you
Demand
use Solve
the price that maximizes proft. The Solver Par
Note that I constrain the price to be from the l
($1.50 through $2.50). If you allow Solver to c
demand curve might slope upward, which implies th
demand. This result is unreasonable, which is w
Fig
URE 81-3
Confguring the Solver Parameters dialog box to c
The result is that the drugstore should charge $
49.4 units per week and a weekly proft of $56.
The approach to pricing outlined in this chapt
price elasticity. Inherently, the Solver
- consi
mines the proft-maximizing price. This approac
that sell thousands of different products. The o
product is its variable cost and the three giv

638
Microsoft Excel 2010: Data Analysis and Business Modeling
Problems
1.
Suppose it costs $250 to produce a video game c
$400 is under consideration. Estimated demand f
following table.
Price
Demand (in millions)
$200
2
$300
0.9
$400
0.2
What price should you charge for a game conso
2.
This problem uses the demand information give
an average of 10 video games. You earn $10 pr
you charge for the game console?
3.
You are trying to determine the correct
variable
price f
cost of printing and distributing a copy of th
of charging from $0.50 through $1.30 per copy
magazine are shown in the following table.
Price
Demand (in millions)
$0.50
2
$0.90
1.2
$1.30
0.3
In addition to sales revenue from the magazin
copies sold for each of the 20 pages of adver
should you charge for the magazine?

639
Chapter 82
Nonlinear Pricing
Questions answered in this chapter:
What is linear pricing?
What is nonlinear pricing?
What is bundling, and how can it increase p
How can I fnd a proft-maximizing nonlinear p
Answers to This Chapter’s Qu
What is linear pricing?
In Chapter 80, “Pricing Products by Using Tie-
Using Subjectively Determined Demand,” I show h
for a product. In those chapters’ examples, how
matter how many units a customer purchases, th
unit. This model is known as
linear pricing
be
function of
x;
namely,.
cost
You will
of x
see
units=(unit
in this c
p
pricing
can often greatly increase a company’s p
What is nonlinear pricing?
A
nonlinear pricing
scheme simply means that th
function
. Weofhave
x
all encountered nonlinear pric
Quantity discounts
The frst fve units might cost $20 e
$12 each. Quantity discounts are commonly u
computers. An example of the cost of purcha
Pricing Examples
worksheet in the fle Nlp.x
that the graph has a slope of 20 for fve or f
more than fve units purchased.

640
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 82-1
Cost of quantity discount plan.
Two-part
When
tariff
you join a country club,
joining
you usu
the club and then a fee for each round of gol
club charges a membership fee of $500 per yea
This type of pricing strategy
. For thiscalled
pricing
a
two
pol
of purchasing a given number of rounds of gol
the
Nonlinear Pricing Examples
worksheet in N
of 520 from zero through one unit purchased a
purchased. Because a straight line must alway
two-part tariff is highly nonlinear.
Fig
URE 82-2
Cost of two-part tariff.
What is bundling, and how can it increase profta
Price bundling involves offering a customer a se
of the products’ individual prices. To analyze w
how a rational consumer makes decisions.- For eac
nal consumer looks at the value of what you are s

Chapter
Nonlinear
82
Pricing
641
it. This yields the
consumer surplus
of the pu
consumer surplus of each available option is n
the product combination having the largest con
So how can bundling increase your proftability
printers and have two customers. The values ea
a printer are shown here:
Customer Computer value
Printer value
1
$1,000
$500
2
$500
$1,000
You only offer the computer and printer for sa
and for a computer, you will sell one printer
-
a
enue. Now suppose that you offer the printer a
customer buys both the computer and the printe
bundling the computer and printer, you can extr
Bundling works best if customer valuations
-
for th
lated. In this example, the negative correlati
results because the customer who places a high v
a computer, and the customer who places a low v
a computer.
When you go to a theme park such as Disneyland
buy a ticket to enter the theme park or you do
because the consumer does not have the option o
ucts. This approach reduces lines (imagine a l
To see why this bundling approach increases pr
and that the number of rides the customer want
that is calculated as
(Number
. From
of
the
rides)=20–2*(
discussion o
curves in Chapter 79, “Estimating a Demand Cur
gives th
to ride
the
is the price that
. Thus,
makes you
demand
knowe th
i–0.5=20–2*(value of ride
,
i)
that
or,
(value
solving
of
.for
ride
th
i
The frst ride is worth $9.75, the second ride i
which is worth $0.25.
Assume you charge a constant price per ride an
You seek the proft-maximizing linear pricing s
Nlp.xlsx, shown in Figure 82-3, I show how to d

642
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 82-3
Proft-maximizing linear pricing scheme.
I associate the range names in C8:C10 with cells D
compute the number of ride tickets purchased
. Then Iin c
compute the proft in cell D12 with
. Ithe
canformula
now use
D
th
Solver to maximize the value in D12 (proft) by c
in eight ride tickets being purchased, and I ear
Now let’s pretend that you’re like Disneyland an
customer. You set a price equal to the sum of th
($9.75+$9.25+…$0.75+$0.25=$100.00)
The customer values all 20 ri
the customer will buy a park entry ticket for $1
$2.00(20)=$60.00
, which almost doubles your proft from l
How can i fnd a proft-maximizing nonlinear prici
In this section, I’ll show how you can determine a
plan for the amusement park example. I’ll procee
Hypothesize trial values for the fxed fee and th
Determine the value the customer associates
.
w
Determine the cumulative value associated with b
Determine the price charged for
.
i
rides:
Fixe
Determine the consumer surplus for buying
.
i
r
Determine the maximum consumer surplus.
Determine the number of units purchased. If th
negative, no units are purchased. Otherwise, I
number of units yielding the maximum surplus.
Use a VLOOKUP function to look up revenue cor
purchased.
Compute proft as
.
revenue–costs
Use a two-way data table to determine a proft
The work for this approach is in the
Two-Part Ta
shown in Figure 82-4.

Chapter
Nonlinear
82
Pricing
643
To begin, I named
, and cell
. I F2
entered
F3
Fixed
LP
trial values f
price per ride in cells F2 and F3. Next, I det
ride by copying from cell E6.to
I fnd
E7:E25
that the
for
c
places a value of $9.75 on the frst ride, $9.2
Fig
URE 82-4
Determination of optimal two-part tariff.
To compute the cumulative value of the frst
i
r
SUM($E$6:E6)
. This formula adds up all values in col
row. By copying from G6 to G7:G25 ,the
I compute
formula th
cost of
i
rides. For example, the cost of fve r
Recall that the consumer surplus for.
i
By
rides e
copying from cell H6 to the, range
I compute
H7:H25
-
the
con
f
er’s
surplus for purchasing any number of rides. F
purchasing fve rides is –$24.75, which is the r
In cell H4, I compute the maximum consumer
.
sur
Remember that if the maximum consumer surplus i
Otherwise, the consumer will purchase -the numb
sumer surplus. Therefore, entering in cell
, I I1 th
determine the number of units purchased (in thi
fnds the number of rows I need to move down in th
the maximum surplus.
I now name the range
. I D5:G25
can then
as look
Lookup
total r
umn of this range based on the number of units p
I1). The total revenue is computed in cell
. I2 w
Notice that if no rides are purchased, I earn n

644
Microsoft Excel 2010: Data Analysis and Business Modeling
rides purchased in cell
. In
I3cell
withJ6,
theIformula
compute
I1*C
pro
costs with the
.
formula
I2–I3
Now I can use a two-way data table to determine th
fee and price per ride. The data table is shown i
hidden.) In setting up the data table, I vary th
values in the range K10:K60) and vary the price p
in L9:BE9). I recomputed proft
.
in cell K9 with th
I select the table range (cells K9:BE60), and th
click What-If Analysis and then select Data Tabl
and the row input cell is F3 (the price per ride
the proft for each fxed fee and price per ride c
Fig
URE 82-5
Two-way data table computing optimal two-part tari
To highlight the proft-maximizing two-part tarif
range L10:BE60. Click Conditional Formatting on th
then click Top 10 Items. Then change the 10 in th
proft is formatted. Here, a fxed fee of $56.00 a
$63.50, which almost doubles the proft from line
per ride of $2.30 also yields a proft of $63.50.
Because a quantity-discount plan involves selecti
low price), you cannot use a data table to deter
plan. You might think you could use a Solver mod

Chapter
Nonlinear
82
Pricing
645
price, and low price) to determine a proft-max
Excel 2010, the Solver often had diffculty det
cell is computed by using formulas containing I
the quantity-discount problem with ease, even w
xlsx (see Figure 82-6) I used the Evolutionary S
quantity-discount plan. I assumed that all uni
at a high price (called HP) and that the remai
The only change in the spreadsheet setup is in c
names in E1:E3, I compute the amount a person w
by copying from G6 to G7:G25 the formula
. The
IF(D6
Solver Parameters dialog box setup is shown in Fi
“Warehouse Location and the GRG Multistart and E
Evolutionary Solver here because the model use
cells. I also changed the Mutation Rate under E
Iconstrained the cutoff point to be an integer a
changing cells. Of course, if Solver had chose
upper bound on the price changing cells.
The Solver found a maximum proft of $63.97, ob
units purchased and $1.84 for the remaining uni
run Solver longer, it would have found the tru
Fig
URE 82-6
Use of Solver to fnd the proft-maximizing quanti

646
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 82-7
Solver settings for maximizing a quantity-discount p
Problems
You own a small country club and have three t
of golf they play during a month as shown in th
Round . noCustomer Customer
type 1
Customer
type 2
type 3
1
$60
$50
$40
2
$50
$45
$30
3
$40
$30
$20
4
$30
$15
$10
5
$20
$0
$0
6
$10
$0
$0
1.
Find a proft-maximizing two-part tariff.
2.
Suppose you are going to offer a pure bundle. F
fve rounds of golf for $60 per month. The mem
than the pure bundle. What pure bundle maximi

647
Chapter 83
Array Formulas and F
Questions answered in this chapter:
What is an array formula?
How do I interpret formulas such ?
as
(D2:D7)*
I have a list of names in one column. These n
transpose the listed names to one row so th
are reflected in the new row?
I have a list of monthly stock returns. Is th
from –30 percent through –20 percent, –10 p
will automatically update if I change the o
Can I write one formula that will sum up th
Is there a way to look at two lists of name
lists?
Can I write a formula that averages all num
value?
I have a sales database for a small makeup c
units sold, and dollar amount for every
-
tra
cal functions or COUNTIFS, SUMIFS, and AVER
also use array functions to summarize the d
units of makeup a salesperson sold, how man
many units were sold by a specifc salespers
What are array constants and how can I use th
How do I edit array formulas?
Given quarterly revenues for a toy store, c
store’s revenues?
Given a list of transactions in different c
a transaction in each country?
Answers to This Chapter’s Qu
What is an array formula?
Array formulas often provide a shortcut or mor
calculations with
array
Microsoft
formula
result
Excel.
can return
in
An either
a
o

648
Microsoft Excel 2010: Data Analysis and Business Modeling
range of cells. Array formulas perform
array
operation
arguments
. Each array argument used in an array form
number of rows and columns.
When you enter an array formula, you must frst s
place the array formula’s results. Then,
- after e
lected range,
you must
. If
press
you fail
Ctrl+Shift+Enter
to press Ctrl+, y
incorrect or nonsensical results. I refer to the p
pressing Ctrl+Shift+Enter as
array-entering
a fo
Excel also contains a
. variety
In Chapter
of
array
42, “Summarizin
functions
Descriptive Statistics,” I discuss the array fun
(LINEST and TREND) in Chapter 53, “Introduction t
“Incorporating Qualitative Factors into Multiple Re
use an array function you must frst select the r
placed. Then, after entering the function in the fr
press Ctrl+Shift+Enter. In this chapter, I’ll in
TRANSPOSE, FREQUENCY, and LOGEST.
As you’ll see, you cannot delete any part of a c
an array formula. Also, you cannot paste an arra
blank cells and array formulas. For example, if y
you want to copy it to the cell range C10:J15, y
range because the range contains both blank cell
around this diffculty, copy the formula from C10 t
C10:J10 to C11:J15.
The best way to learn how array formulas and fun
so let’s get started.
How do i interpret formulas such as ?
(D2:D7)*(E2:
In the
Total Wages
worksheet in the fle Arrays.x
the hourly wage rates for six employees, as you c
Fig
URE 83-1
Using array formulas to compute hourly wages.

Chapter
Array
83
Formulas and
649
Functions
If you want to compute each person’s total wag
the formula
. There
D3*E3
is certainly nothing wrong with th
formula provides a more elegant solution. Begi
want to compute each person’s total
(D2:D7*E2:E7)
earnings.
, and
T
press Ctrl+Shift+Enter. You will see that each p
Also, if you look at the Formula bar, you’ll
.
s
The curly brackets are the way Excel tells you th
enter the curly brackets that show up at the b
indicate that a formula is an array formula in thi
To see how this formula works, click in the Fo
then press F9. You
, which
will see
is the
{3;4;5;8;6;7}
way Excel crea
as an array. Now select E2:E7 in the Formula b
{6;7;8;9;10;11}
, which is the way Excel creates an arra
inclusion of the asterisk (*) tells Excel to m
Because the cell ranges being multiplied inclu
items, and because you selected a range of six c
its own cell. Had you selected a range of only f
be displayed.
Suppose you want to compute the total wages ea
is to use the formula
=SUMPRODUCT(D2:D7,E2:E7)
. Again, however, let’s tr
array formula to compute total wages. Begin by s
to place the result. Then
SUM(D2:D7*E2:E7)
enter .
inAfter
cell pressi
G2 the f
Ctrl+Shift+Enter, you obtain
(3)(6)+(4)(7)+(5)
. To see how thi
formula works, select the
D2:D7*E2:E7
portion i
see
SUM({18;28;40;83;60;77})
, which shows that Excel created a s
element ,
iswhose
3*6(18)
second ,element
and so is
on,
4*7(28)
until the l
is
7*11
. Excel
(77)
then adds up the values in the ar
i have a list of names in one column.
s thereThese
an easy
na w
to transpose the listed names to one row so th
names are reflected in the new row?
In the
Transpose
worksheet in the fle Arrays.x
names in cells A4:A8. The goal is to list thes
knew that the original list of names would nev
by copying the cell range and then using the T
box. (See Chapter 14, “The Paste Special Comma
in column A change, the names in row 3 would n
Special, Transpose. What you need in this situ

650
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 83-2
Using the TRANSPOSE function.
The TRANSPOSE function is an array function that c
columns, and vice versa. To begin using TRANSPOS
C3:G3, where you want the transposed list of nam
enter the formula .
=TRANSPOSE(A4:A8)
The list of names is now disp
importantly, if you change any of the names in A
the transposed range.
i have a list of monthly
s therestock
a wayreturns.
to determine th
returns from –30 percent through –20 percent, –1
on that will automatically update if i change th
This problem is a job for the FREQUENCY array fu
how many values in an array
) occur
(called
withinthe
given
data
value
arr
r
by a bin array). The syntax of
data
the FREQUENCY
,
bin
array
).
array
fun
To illustrate the use of the FREQUENCY function, l
Arrays.xlsx fle, shown in Figure 83-3. I’ve list
the cell range A4:A77.
I found in cells A1 and A2 (using the MIN and MA
percent through 53 percent. Based on this inform
C7:C17, starting at –0.4 and ending at 0.6. Now I s
results of the FREQUENCY function to be placed. I
of data points less than or equal to –0.4, D8 wi
than –0.4 and less than or equal to –0.3, and so o
than 0.5 and less than or equal to 0.6, and cell D
greater than 0.6.

Chapter
Array
83
Formulas and
651
Functions
Fig
URE 83-3
Using the FREQUENCY function.
I enter the formula
=FREQUENCY(A4:A77,C7:C17)
and then press Ctrl+Shi
formula tells Excel to count the number of dat
each of the bin ranges defned in C7:C17. The r
–0.4 and less than or equal to –0.3. Thirteen r
equal to 0.2. If you change any of the data po
the FREQUENCY function in cells D7:D17 will re
Can i write one formula that will sum up the s
In the cell range A4:A10 in the
Sum Up 2nd Dig
seven integers. (See Figure 83-4.) I would lik
digit of each number. I could obtain this sum by c
VALUE(MID(A4,2,1))
. This formula returns (as a numerica
A4. Then I could add up the range B4:B10 and o
Fig
URE 83-4
Summing second digits in a set of integers.

652
Microsoft Excel 2010: Data Analysis and Business Modeling
An array function makes this process much easier
formula
=SUM(VALUE(MID(A4:A10,2,1))
. Your array formula will retur
To see what this formula does, highlight
MID(A4:
F9. You will see
{“4”;”5”;”6”;”6”;”0”;”3”;”3”}
. This string of values shows th
an array consisting of the second digit (viewed a
portion of the formula changes these text string
by the SUM portion of the formula.
Notice that in cell A11, I entered a number with o
second digit, the MID portion
. How
of can
our you
formula
modify
retthi
formula to account for the possible inclusion of o
E8 the formula
{SUM(IF(LEN(A4:A11)>=2,VALUE(MID(
. This formula rep
any one-digit integer with a 0, so you still obt
is there a way to look at two lists of names and d
lists?
In the
Matching Names
worksheet in the fle Array
columns D and E), as you can see in Figure 83-5. H
on List 1 also appear on List 2. To accomplish thi
enter in cell C5 the formula
. This
={MATCH(D5:D28,E5:E
formula loops th
C5:C28. In cell C5, the formula verifes whether th
match exists, the formula returns the position o
the formula returns
#NA
(for not available). Simi
the second name on List 1 has a match. You see, f
the second list but Harrington does (frst matche
Fig
URE 83-5
Finding duplicates in two lists.

Chapter
Array
83
Formulas and
653
Functions
To enter Yes for each name in List 1 with a ma
namweithout a match, select the cell range B5:B
{IF(ISERROR(C5:C28),”No”,”Yes”)}
in cell B5. T
containing the #NA message and Yes for all cel
=ISERROR(x)
yields True if the formula
x
evalu
Can i write a formula that averages all number
to the list’s median value?
In the
Average Those > Median
worksheet in the A
range D5:D785)(named
contains
Prices
a list of prices. I’d l
at least as large as the median price. In cell F
Median(prices)
. In cell F3, I compute the average of n
median by entering the formula
=SUMIF(prices,”
.
This formula adds up all prices that are at le
divides by the number of prices that are at le
prices at least as large as the median price i
Fig
URE 83-6
Averaging prices at least as large as the median p
An easier approach is to select cell F6 and ar
DIAN(prices),prices,””))}
. This formula creates an array that c
price is greater than or equal to the median p
gives you the results you want.

654
Microsoft Excel 2010: Data Analysis and Business Modeling
i have a sales database for a small makeup compa
product, units sold, and dollar amount for every t
database statistical
FS,
functions
SUM
FS, andgE
or
AVERA
iFS COUNT
to summa
-
rize this data, but can i also use array functio
questions such as how many units of makeup a sal
lipstick were sold, and how many units were sold by a s
lipstick?
The Makeuparray.xlsx fle contains a list of 1,90
company. For each transaction, the transaction
-
n
uct sold, units sold, and dollar volume are list
Fig
URE 83-7
Makeup database.
This data can easily be summarized by using data
in Chapter 46, “Summarizing Data with Database S
COUNTIFS and SUMIFS functions. (See Chapter 20, “
COUNTA, and COUNTBLANK Functions,” and Chapter 2
and AVERAGEIFS Functions”). As you’ll see in thi
powerful alternative to these functions.
How many units of makeup
You can
did
easily
Jen
question
sell?
answer
using
bythis
the
SUMIF function. In this worksheet, I named the c
M5:M1904.
Units
I entered in cell E7 the formula
SUMIF(
units sold by Jen. The total is 9,537 units. You c
in cell E6 the formula
=SUM(IF(J5:J1904=”Jen”,M5
. This formula create
that contains the units sold for a transaction m
Therefore, summing this array also yields the nu
see in Figure 83-8.

Chapter
Array
83
Formulas and
655
Functions
Fig
URE 83-8
Summarizing data with array formulas.
How many units of lipstick
This question
did Jen
requires
sell?
a cr
two columns (Name and Product). You could answ
statistical function
DSUM(J4:N1904,4,E9:F10)
formula
, which
=
is entered in c
formula shows that Jen sold 1,299 units of lip
the array formula
=SUM((J5:J1904=”jen”)*(L5:L190
entered in cell F6,
.
To understand this formula, you need to know a b
formula that reads
(J5:J1904=”jen”)
creates a B
equals
Jen,
the array includes the value True, a
equal
Jen,
the array contains False. Similarly
creates a Boolean array with a True correspond
the word
lipstick
and a False corresponding to e
Boolean arrays are multiplied, another array i
True*True=1
True*False=0
False*True=0
False*False=0
In short, multiplying Boolean arrays mimics th
Boolean arrays by the values in the range M5:M
Jen sold lipstick, this array contains the uni
Summing this array yields Jen’s total lipstick s
How many units were sold
In
by
cell
Jen
G7,
or were
I used
lip
th
statistical function
=DSUM(J4:N1904,4,E12:F
Jen or that were lipstick total 17,061. In c

656
Microsoft Excel 2010: Data Analysis and Business Modeling
were sold by Jen or that were lipstick by arr
”jen”)+(L5:L1904=”lipstick”),1,0)*M5:M1904)}
.
Again, the portion of this formula that reads
(J
two Boolean arrays. The frst array contains True i
sensitive) is the salesperson. The second array c
lipstick. When Boolean arrays are added, the fol
False+True=1
True+True=1
True+False=1
False+False=0
In short, adding Boolean arrays mimics the OR op
array in which each row where Jen is the salespe
number of units sold multiplied by 1. In any oth
by 0. The same result is obtained as with the da
Can I summarize the number of units
salesperson?
of
Array
each prod
formulas make answering a question such as this a s
salesperson’s name in the
product
cell range
name A17:A25
in the cell
and er
B16:F16. Now you array-enter in cell B17 the for
*($L$5:$L$1904=B$16)*$M$5:$M$1904)}.
This formula counts only units of eye liner sold by A
formula to C17:F17, I compute the units of
-
each p
mulas in C17:F17 to C18:C25 and compute the numb
salesperson. Notice that I add a dollar sign to A i
pull the person’s name, and I add a dollar sign t
always pull the product.
Not
Astute readers might ask why I simply didn’t sele
in one step to fll in the table. Remember that you c
that contains both blank cells and array formulas, w
C17:F17 and then dragged it down to complete the tab
What are array constants and how can i use them?
You can create your own arrays and use them in a
values in curly brackets, { }. You need to enclo
You can also include the logical values True and F
symbols such as dollar signs or commas are not a

Chapter
Array
83
Formulas and
657
Functions
As an example of how an array constant might b
worksheet in the Arrays.xlsx fle, shown in Fig
Fig
URE 83-9
Creating second and fourth powers of sales.
In this worksheet, you’re given sales during s
month the second, third, and fourth power of s
where you want the resulting computation to be p
=C4:C9^{2,3,4}
. In the cell range D4:D9, this formula l
in C4:C9. In the cell range E4:E9, the formula l
Finally, in the cell range F4:F9, the formula l
to the fourth power. The array constant {2,3,4
power values.
How do i edit array formulas?
Suppose you have an array formula that creates r
move, or delete the results. You cannot edit a s
formula, however, you can begin by selecting a
in the array. By pressing F2 to edit a cell in th
making the changes, press Ctrl+Shift+Enter to e
array will reflect your changes.
given quarterly revenues for a toy store, can
the store’s revenues?
The Toysrustrend.xlsx fle, shown in Figure 83-
of dollars) for a toy store during the years 1
trend in revenues as well as the seasonality a
January–March; second quarter equals April–Jun
fourth Quarter equals October–December). A tre
means that sales are increasing at 1 percent p
of 0.80, for example, means that sales during Q
average quarter.
The trick to solving this problem is to use th
to predict a variable
y
1,from
2,…,
x
, independent
and
xn
you believe
varia
th
values
,1,
b
of
2,…,
b a
,
bn
the relationship
1,2,…,
x
between
xn
is
y
given
and
x
by
x1
(b2)
x2
(bn)
xn
. (I’ll call this Equation 1.)

658
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 83-10
Toy revenue trend and seasonality estimation.
The LOGEST function is used
1,2,…,
b
to
bn
determine
that best
values
ft thi
o
to the observed data. To use the LOGEST function t
following:
y
equals quarterly revenues.
x
1 equals the quarter number (listed in chrono
Quarter 1, the next quarter is Quarter 2, and s
x
2 equals 1 if the quarter is the frst quarter o
x
3 equals 1 if the quarter is the second quart
x
4 equals 1 if the quarter is the third quarte
You need to choose one quarter to leave out of th
quarter.) This approach is similar to the one us
model you choose to estimate is then
y=a(b1)
x1
(b2)
x2
(b3)
x3
(b4)
x4
. When the LOGEST fu
determines,1,
values
b
2,
b
3,
b
and
4ofthat
b
a
best ft the data, the v
follows:
a
is a constant used to scale the forecasts.
b
1 is a constant that represents the average p
store sales.
b
2 is a constant that measures the ratio of fr
(fourth quarter) sales.
b
3 is a constant that measures the ratio of se
quarter’s sales.
b
4 is a constant that measures the ratio of thi
sales.

Chapter
Array
83
Formulas and
659
Functions
To begin, I created the dummy variables for Qu
from G6 to G6:I27 the. formula
Remember
IF($D6=G$4,1,0)
that a fourth q
Excel because all three dummy variables equal 0 d
can leave out the dummy variable for this quar
I now select the cell range K6:O6, where I wan
The constant
a
will be placed in the right-mos
ing to the ordering of the independent variabl
the constant, then the Quarter 1 coeffcient, a
The syntax I use for the
(y
LOGEST
range,x
function
range,True,Tr
. After is
arra
LO
entering in cell K6 the formula
=LOGEST(E6:E27
estimates shown in Figure 83-11. The equation t
follows:
4219.57*(1.0086)
quarter
numb
*(.435)
er
Q1dummy
*(.426)
Q2dummy
*(.468)
Q3dummy
Fig
URE 83-11
LOGEST estimates trend and seasonality.
During the frst quarter, the Q1 dummy equals 1 a
that any number raised to the power 0 equals
-
1
enues are predicted to equal
4219.57*(1.0086)
quarter
*(.435)
number
.
During a second quarter, the Q1 dummy and the Q
dummy equals 1. During this quarter, quarterly r
4219.57*(1.0086)
quarter number
*(.426)
During a third quarter, the Q
dummy equal 0 and the Q3 dummy equals 1. Quart
predicted to equal
4219.57*(1.0086)
quarter
*(.468)
number
. Finally, during a fo
Q1, Q2, and Q3 dummies equal 0. During this qu
equal
4219.57*(1.0086)
quarter
.
number

660
Microsoft Excel 2010: Data Analysis and Business Modeling
In summary, I have estimated a quarterly upward tr
3.6 percent annually). After adjusting for the tr
Quarter 1 revenues average 43.5 percent of Qu
Quarter 2 revenues average 42.6 percent of Qu
Quarter 3 revenues average 46.8 percent of Qu
To create a seasonal index for each quarter, you g
of 1, and fnd that an average quarter has a weig
Figure 83-11):
= .582
.435 + .426 + .468 + 1
4
Then you can compute the relative seasonal index f
to L4:M4 the formula
. The Quarter
K6/$K$2
4 seasonality is comp
formula
. After
1/K2
adjusting for the trend, I can con
Quarter 1 sales are 80 percent of a typical q
Quarter 2 sales are 73 percent of a typical q
Quarter 3 sales are 75 percent of a typical q
Quarter 4 sales are 172 percent of a typical q
Suppose you want to generate the forecast for ea
equation (Equation 1). You can use the Excel GRO
GROWTH function is an array function
known ys,known
with the
xs,n
sy
xs,True
). This formula gives sthe
when
predictions
Equation 1for
is the
ft n
data contained in the ranges .specifed
Thus, selecting
by
known
th
y
J6:J27 and array-entering in cell J6 the formula
generates forecasts from Equation 1 for each qua
Quarter 4 of 1997 using Equation 1 is $4.366 bil
given a list of transactions in different countr
of a transaction in each country?
The fle Medians.xlsx (see Figure 83-12) contains th
transactions in France, the U.S., and Canada. He
of the transactions in each country. Suppose, fo
size of a transaction in the U.S. An easy way to d
only the U.S. revenues and replaces other revenu
Excel compute the median of this new array. Afte
andaming the data in column D
Revenue,
you can a
=MEDIAN(IF(Country=F5,Revenue,””))
in cell G5 to r
containing a non-U.S. transaction by a blank spa

Chapter
Array
83
Formulas and
661
Functions
transactions ($6,376.50). Copying this formula f
transaction size for Canada and France.
Fig
URE 83-12
Finding median transaction size in each country.
Problems
All data for Problems 1 through 5 is in the Ch
1.
The
Duplicate
worksheet contains two lists o
number of names appearing on both lists.
2.
The
Find Errors
worksheet contains some cal
the number of cells containing errors. (Hin
formula.)
3.
The
Sales
worksheet contains 48 months of s
to add (beginning with Month 3) every ffth m
to use the Excel
(number,divisor)
MOD function. MOD
yields the r
number is divided by the divisor. For examp
4.
Use an array function to compute the third, f
sales.
5.
The
Product
worksheet contains sales during A
through 7. Sales for each month are listed i
that sales for each month are listed in the s
are reflected in the new arrangement you hav

662
Microsoft Excel 2010: Data Analysis and Business Modeling
6.
Use the data in the Historicalinvest.xlsx fle t
which stock, bond, and T-Bill returns are fro
percent through –10 percent, and so on.
7.
An
m
by
n
matrix is a rectangular array of nu
For example,
1 2 3
4 5 6
7 8 9
is a 3-by-3 matrix. Consider two matrices, A a
columns in matrix A equals the number of rows i
matrix A by matrix B. (The
.) The
product
entry is
in written
row I a a
J of
AB
is computed by applying the SUMPRODUC
umn J of B.
AB
will have as many rows as A an
MMULfTunction is an array function with which y
the MMULT function to multiply the following m
1 2 3
4 5 6
7 7 0
1 2 3
1 2 0
3 3 0
A
=
and
B
=
8.
A square matrix has the same number of rows a
suppose there exists a matrix B whereby
AB
eq
entry equals 1 and all other entries equal 0. Y
A. The Excel array function MINVERSE fnds the i
MINVERSE function to fnd the inverse for matr
9.
Suppose you have invested a fraction
f
i
of your money
i
=1,2,…,
in
n
).
investment
Also, suppose the standard deviation of the a
i
is
s
i
and the correlation between the annual per
investment
j
is ñ
i
.
j
You would like to know the variance a
annual percentage return on your portfolio. T
matrix multiplication. Create the following th
Matrix 1 equals a th
1 by
entrymatrix
is
s
whose
i
i
f
i
.
Matrix 2 equals an
n
by
n
matrix whose entr
i
.
j
Matrix 3 is a
n
th
byentry
1 matrix
is
s
whose
i
i
f
i
.
The variance of the annual percentage return o
(Matrix 1)*(Matrix
. The
2)*(Matrix
data in Historicalinvest.x
3)
on stocks, bonds, and T-Bills. Use the MMULT a

Chapter
Array
83
Formulas and
663
Functions
(based on the given historical data) the va
that invests 50 percent in stocks, 25 perce
Problems 10 through 13 use the data in the
10.
How many dollars’ worth of lip gloss did Je
11.
What was the average number of lipstick uni
12.
How many dollars of sales were made by Emil
13.
How many dollars’ worth of lipstick were so
14.
Use the data in the Chapter58data.xlsx fle t
components of the quarterly revenues of For
15.
In the toy store example (using the Toysrustr
to forecast quarterly revenues for 2002.
16.
The Lillydata.xlsx fle contains information f
used to gather insights to aid in designing a n
(six from Lilly and nine from other -compani
pare fve sets of four potential Lilly produ
competitor’s drug is chosen over the four l
For example, in the frst scenario, the seco
that reduced blood pressure 18 points, resu
for $16.
The range I5:N21 contains the choices each e
For example, the frst expert (who worked fo
faced with Scenario 1 and chose the frst li
this information to answer the following:
Enter a formula that can be copied from I
each scenario and option in I2:M5.
Enter an array formula in I23 that can be c
that calculates for each question- the fre
ken down by Lilly and non-Lilly experts. T
responded 1, three responded 2, and two r
17.
The Arrayexam1data.xlsx fle contains sales by c
sales down on a quarterly basis by using ar
I want the data summarized (using only arra
shown in Figure 83-13.

664
Microsoft Excel 2010: Data Analysis and Business Modeling
Fig
URE 83-13
Format for Problem 17 answer.
For example, L7 should contain Quarter 1 (Jan
so on. Verify your answer with a PivotTable.
18.
Explain why array-entering the formula
=SUM(1
number of unique entries in the range Info. A
Unique.xlsx fle and verify that it returns th
19.
The Salaries.xlsx fle contains the salaries o
adds the four largest player salaries.
- Hint: U
tion with the LARGE function. Then generalize y
anp
yositive integer
n
and your formula will add th
contains an
, when
integer
you array-enter a ,
formula
Excel
ROW
will create an array constant {1,2,…,n}.

665
Chapter 84
PowerPivot
Questions answered in this chapter:
How do I read data into PowerPivot?
How do I use PowerPivot to create a PivotTab
How can I use slicers with PowerPivot?
What are DAX functions?
Microsoft PowerPivot for Excel 2010 is an add-i
for large data sets—up to 100,000,000 rows of d
from a variety of sources. For example, some o
Access database, some from a text fle, some fr
imported from a website. In this chapter, I pr
complete explanation of how PowerPivot works, I h
for Excel 2010: Give Your Data Meaning
(Micros
Ferrari.
You can download PowerPivot
. Afrom
separate
www.powerpivo
version o
is available for 32-bit and 64-bit versions
-
of E
able, so be sure you download the correct vers
Answers to This Chapter’s Ques
How do I read data into PowerPivot?
After you install PowerPivot, you see a PowerP
tab displays the options shown in Figure 84-1.
Fig
URE 84-1
PowerPivot options.

666
Microsoft Excel 2010: Data Analysis and Business Modeling
Clicking the PowerPivot Window button in the Lau
and displays the Home tab, part of which is show
PowerPivot window’s Home tab does not concern us
Fig
URE 84-2
The PowerPivot window Home tab.
If you installed PowerPivot after October 2010, y
external data from the Windows Azure Datamarket. T
PowerPivot analyses on a variety of interesting d
For example, you can download game-by-game stati
down how each team performed rushing and passing a
On the Home tab, you can import data from multip
PowerPivot will accept input from an Access or Mi
you select From Report, PowerPivot will accept i
Services report. Selecting From Data Feeds allow
an Atom feed.
Not
F
e
or more information on Atom feeds, see
social.te
articles/ssrs-2008-r2-atom-data-feeds-for-powerpivot
From Text allows you to import data from a text fl
read data from the previously described sources a
types of databases, such as Oracle and Teradata.
After copying data from Excel, you can select Pa
To illustrate how to download data from multiple s
fle Storesales.txt, in which I’ve listed sales tr
shown in Figure 84-3.
You can see that for each transaction, I am give
date, units sold, and revenue. I want to summari
store is listed in a different fle, States.xlsx. T

Chapter
PowerPivot
84
667
Fig
URE 84-3
Sales data to be imported into PowerPivot.
Fig
URE 84-4
Location of each store.
I want to create a PivotTable that lets me sli
did selling each product in each state. To beg
PowerPivot Window in the Launch group (as show
the Home tab in the PowerPivot window. Because I wa
Text on the Home tab. As shown in Figure 84-5, I c

668
Microsoft Excel 2010: Data Analysis and Business Modeling
Because the frst row of data contains column hea
Headers option. In the Column Separator list, I s
fle are not separated by spaces or a character, s
Finish imports the text fle’s data into PowerPiv
Fig
URE 84-5
Setting up a text fle import for PowerPivot.
Figure 84-6 shows the result after the text data i
the data is shown. At the bottom you can see a t
Storesales.txt.
Fig
URE 84-6
Subset of the data imported from Storesales.txt.
Next, I want to import the fle States.xlsx so th
store is located. To import States.xlsx, I retur

Chapter
PowerPivot
84
669
upper-left corner of the PowerPivot ribbon. Th
data I need. Now, I select Paste on the Home t
Preview dialog box shown in Figure 84-7 appear
Fig
URE 84-7
Paste Preview dialog box.
After I select Use First Row As Column Headers a
imported into PowerPivot, as shown in Figure 8
a tab appears for each data source used to imp
States.xlsx as Table, but you can easily chang
Fig
URE 84-8
Data from two sources is now imported into Power

670
Microsoft Excel 2010: Data Analysis and Business Modeling
Recall that I want to analyze sales in different s
PowerPivot does not know that the listing of sto
to the stores listed in the text fle. To remedy thi
between the two data sources. To create this rel
PowerPivot window (see Figure 84-2) to display th
Fig
URE 84-9
PowerPivot Design tab.
On the Design tab, I click Create Relationship t
Filling in the dialog box as shown ensures that P
in each data source refer to the same set of sto
that Stores 19 and 20 in the fle Storesales.txt a
Fig
URE 84-10
Creating a relationship between two data sources.
How do I use PowerPivot to create a PivotTable?
Now, I’m ready to use PowerPivot to summarize ou
I display the Home tab in the PowerPivot window a
The Create PivotTable dialog box appears and pro
location in the current worksheet. I choose a ne
displayed, shown in Figure 84-11.

Chapter
PowerPivot
84
671
Fig
URE 84-11
PowerPivot Field List.
When I click Table, the feld list shows all th
Table data. The goal is to get a breakdown by s
sold. To summarize revenue and units sold, I d
area. Next, I drag State to the Row Labels are
arrange the PivotTable felds as shown in Figur
PivotTable are selected.
Fig
URE 84-12
Assignment of felds to create a PivotTable repor

672
Microsoft Excel 2010: Data Analysis and Business Modeling
The portion of the PivotTable involving CDs, DVD
can see, 3,881 DVDs were sold in Illinois (ILL) f
Fig
URE 84-13
PivotTable breaking down product sales by state.
How can I use slicers with PowerPivot?
In Chapter 43, “Using PivotTables and slicers
Slicers to D
to reveal details and different perspectives in y
nicer in PowerPivot PivotTables. Here, I’ll
-
crea
set of products and stores. To do this, I place P
Store in the Slicers Vertical area in the PowerP
in Figure 84-14. (See the fle Pivotwithslicers.x
down the Ctrl key as you click to select any sub
the Ctrl key also enables you to resize the slic
the total revenue and units sold of DVDs and foo
through 11 are all in Illinois or Michigan, thes
PivotTable.
If I had created the Product
-
slicer w
ality, all six products would be listed in a sin
PowerPivot Product slicer looks much nicer.
Fig
URE 84-14
Product and store slicers.

Chapter
PowerPivot
84
673
What are DAX functions?
Recall from Chapter 43 that you can generate n
calculated items or calculated felds. After yo
use the DAX (short for Data Analysis Expressio
columns that make your PivotTables much more m
Not
A
e
full discussion of DAX is beyond the scope of t
Excel 2010: Give Your Data Meaning
includes an exc
language.
To illustrate a DAX formula, I’ll show how to p
for each sales transaction in a separate colum
PowerPivot window and select the frst blank co
PowerPivot ribbon brings up a list of DAX func
and DAY) are virtually identical to ordinary E
of DAX functions shown in Figure 84-15. These a
example, the DISTINCT function can return a li
criterion.
Fig
URE 84-15
Listing of DAX functions.
To place the year, month, and day of the month f
move to the frst cell of the .frst
Thenblank
you are
column
pr a
with the columns from the PowerPivot data sour
Select the date column, and enter
. The
thecolumn
formula
is n
populated with the year of each sales transacti

674
Microsoft Excel 2010: Data Analysis and Business Modeling
rename the column Year. In the next column I com
the formula
=MONTH(storesales[Date])
. In the next column I compute th
with the formula
=DAY(storesales[Date])
. After I rename these columns M
Month, the data is arranged as shown in Figure 8
Fig
URE 84-16
Year, Month, and Day Of Month columns created with D
Now I can create a variety of informative PivotT
each state by year. (See Problem 1.)
Problem
1.
Summarize total sales in each state by year.
2.
Summarize total revenue by store and create a s

675
Index
Symbols
& function, 41, 44
A
A Date Occurring option, 189
A Removed
worksheet, 452
abandonment options, 597–598.
See
also
stock options
absolute percentage error
computing, 494
minimizing, 494
absolute value function, 290
ABS(x) function, 290
accuracy of predictions, 428–429
Active Field group, 356
activity durations, modeling,
538–539
actual text argument, 41
Adagency.xlsx fle, 227
adaptive forecasting methods, 491
Add Biggersale
worksheet, 226
Add Constraint dialog box, 248–249
Bin option, 267, 269
for workforce scheduling
problem, 257
Add Scenario dialog box, 144–145
Add To Quick Access Toolbar
command, 3
Add Trendline command, 424, 426
Add Watch command, 121
add-ins, Analysis ToolPak, 328
Add-Ins dialog box, 243
ADDRESS function, 182, 183
Addresses.xlsx fle, 103
adjustable rate mortgages (ARMs),
78–79
Advanced Filter dialog box, 408
Unique Records Only option, 409
Advanced Filter feature, 408
after-tax profts, 82
AGGREGATE function, 6, 98
ignoring, 98
Agingdata.xlsx fle, 174
airport security queuing times,
621–623
Albright, S. Christian, 316
algebra story problems, solving,
139–140
All Cells Showing “Sum of Units”
Values For “Product” option,
364
All Different option, 303
All Row Fields
worksheet, 353, 357
alpha
parameter, 536
alphabetical sorting, 210
alternative hypothesis, 471
Amazonma.xlsx fle, 488
Amazon.xlsx fle, 200, 207, 487
American stock options, 588.
See
also
stock options
amount borrowed, calculating with
Goal Seek command, 138–139
ampersand (&), for concatenation,
41, 42, 152, 179
analysis, automatically updating,
218
Analysis group
Data Analysis option, 328, 443
Descriptive Statistics option, 335
Solver, 243
Trendline option, 424
analysis of variance.
See
ANOVA
Analysis ToolPak, 328
Correlation option, 443
installing, 448
Analysts Forecasts
worksheet, 313
AND operator, 91–92, 396
AutoFilter feature with, 408
evaluation of, 200
multiplying Boolean arrays and,
655
angle brackets (<>), 152
annual holding costs, 610–611.
See
also
inventory modeling
determining, 608
annual ordering costs.
See
also
inventory modeling
determining, 608
annual payments
negative value for, 72
valuing per year, 69–71
annual returns
estimating, 346
of stock dividends, 589
annual revenue, computing, 128
annual setup costs, 610
annuities
defned, 69
number of periods in, 70
value in future dollars, 71–72
valuing, 69–71
Another Summary
worksheet, 182
ANOVA, 456
accuracy of forecasts, 475
alpha value, 473, 478
alternative hypothesis, 471
forecasting with, 474–475
input range, 473, 478, 482
interactions, testing for, 4
null hypothesis, 471
null hypothesis, accepting
one-way, 471–476
output range, 473, 478, 482
prediction equations, 483
signifcance measures, 457
two-factor with interactio
two-factor with replicatio
two-way, 477–486
two-way without replicatio
Anova: Single Factor dialog b
Labels In First Row option7
Anova: Single Factor option
Anthony, Carmelo, 579
Antitrustdata.xlsx fle, 136
Apply Names command, 17
arguments
True and 1, 524
unacceptable, 99
Arrange All command, 412
array arguments
in AGGREGATE function, 98
defned, 648
array constants, 656–657
array formulas
asterisk in, 649
cell ranges containing, 64
curly brackets ({}) for, 64
defned, 647–648
dollar sign ($) in, 656
dummy variables for, 659
editing, 657
entering, 648
interpreting, 648–649
lists, matching items in, 6
median, averaging numbers
larger than, 653
median transaction size, f
660–661
pasting, 656
powers of sales, 657
summarizing data with, 654
summing second digits in se
integers, 651–652
trends, estimating with, 6
value ranges, counting valu
650–651
array functions, 462, 648
cell ranges containing, 64
FREQUENCY function, 650–65
GROWTH function, 660
LINEST function, 452, 648
LOGEST function, 657–660

676
array functions
continued
)
(
MINVERSE function, 662
MMULT function, 662
MODE.MULT function, 337–338,
648
TRANSPOSE function, 649–650
TREND function, 462, 648
array-entering a formula, 648
Arrayexam1data.xlsx fle, 663
arrays, 647–664
bin arrays, 650
Boolean arrays, 655–656
creating, 656–657
data arrays, 650–651
quotation marks (“ “) for text, 656
ranking numbers in, 344
Arrays.xlsx fle, 648
arrivals, mean and standard
deviation between, 619
ASCII characters, 42
Asiansales.xlsx fle, 166
Asselallsim.xlsx fle, 573
asset allocation, 565, 569–572
Assetallocationopt.xlsx fle, 571
Assetallsim.xlsx fle, 569
assets
balancing with liabilities, 95
total, computing, 97
Assign.xlsx fle, 26, 298
Assumption cells, hiding, 147
asterisks (*), 152
for multiplication, 649
as wildcard character, 34
At Most 4 Of P1–P10 worksheet, 271
Atom feeds, importing data from,
666
auditing tool, 121–126
precedents and dependents, 122
Audittwosheets.xlsx fle, 125
AutoComplete feature, 15, 219–220
with data validation, 324
table names options, 225
autocopy feature, 220
AutoFill feature, for time interval
creation, 109
AutoFilter feature
heading arrows, 397
querying databases with, 396
automated formulas, 182
Automatic Except For Data Tables
option, 131
Automatic Except For Tables option,
557
automatic updating
of line graphs, 222
with new data, 218–219
Automatic worksheet calculation
modes, 131
Auto.xlsx fle, 453
AVERAGE function, 152, 337
extreme values and, 345
Average Those > Median
worksheet,
653
AVERAGEIF function, 158, 160
AVERAGEIFS function, 158, 160, 390
averages
of all numbers greater than
median, 653
based on criteria, 158
Axis Titles command, 427
B
back-order case, 613–615
balance paid, calculating, 73–74
balance sheets, defned, 94
balloon mortgages, 78
balloon payments, 73, 74
Banded Columns option, 221
Banded Rows option, 221
Bar Direction list, 192
base of natural logarithms, 431
base of time series, 491
estimating, 493
Baseball96.xlsx fle, 468
Basic Model
worksheet, 267
Basketball.xlsx fle, 204
best-case scenarios, calculating,
143–147
beta parameter, 536
Beta random variable, 535, 538–539
Betadata.xlsx fle, 430
BETA.DIST function, 539
Beta.xlsx fle, 538
Bezos.xlsx fle, 133
bias, in forecasts, 542
bids
mean proft, calculating, 562
modeling as normal random
variables, 560–561
optimizing, 559–563
symmetry assumption, 560
Bidsim.xlsx fle, 561
bin arrays, 650
bin ranges, 327
creating, 328
defning, 328, 329
bin-range frequencies, 330
binary changing cells, 267, 269
binary programming problems,
solving, 271–272
BINOM.DIST function, 517–519
binomial random variables, 515–519
BINOM.DIST function, 517
BINOM.INV function, 519
negative, 520–521
simulating, 559–560
Binomialexamples.xlsx fle
Binomialsim.xlsx fle, 559
BINOM.INV function, 519, 5
562
Black, Fischer, 587
Black-Scholes option-pric
formula, 548, 587–599
implementing in Excel, 5
input values, 591
requirements of, 590
volatility, estimating, 5
593–594
Black Swan, The
(Taleb), 5
black swans, 565
Blades
worksheet, 633
blank cells, counting, 15
blank rows
adding to PivotTables, 3
inserting, totaling valu
Blank rows no totals
work
Boolean arrays, 655–656
adding, 656
multiplying, 655
bootstrapping, 565
asset allocation, 569–57
future investment return
566–567
interdependence of retur
asset classes, 570
simulated values, genera
Borders tab, 198
borrow amount, calculatin
Goal Seek command, 138–
borrow rate vs. reinvest r
break points, creating, m
deleting, 309
breakeven analysis, with G
command, 137–138
breakeven point, calculat
133–134
Bstempprotected.xlsx fle, 5
Bstemp.xlsx fle, 592, 594
bundling, 640–642.
See
also
product pricing
pure bundling, 641
business variables.
See
also
correlations; tren
trend curves
estimating relationships a
423
butterfly spreads, 102
buy-and-hold strategy vs. m
average trading rule, 9
By Changing Cell, defned, 1
By Changing Variable Cell
array functions (continued)

677
C
C22p1.xlsx fle, 173
Calc Field
worksheet, 374
calculated felds and items, 374–375,
377
creating with DAX functions,
673–674
Calculation group, 557
Calculation Options button, 131
Calculation Options command, 131
calculation results, moving, 111–112
call options.
See also
stock options
cash flows from, 588
defned, 587
dividends, exercising option and,
588
graphs of, 588
Call
worksheet, 588
Candybardata.xlsx fle, 325
Capbudget.xlsx fle, 267
capital, cost of, 59
capital budgeting.
See also
project
selection problems
option pricing and, 596–598
capital investment projects, unique
IRR of, 65
carat symbol [^], 438
Cardata.xlsx fle, 468
Carville, James, 458
Casesensitive.xlsx fle, 175
cash, computing, 95
cash balances, 70
cash flows
beginning-of-year, caluclating,
59–60
buying and selling stock shares,
93
calculating, 37–38
from call options, 588
discounting, 59, 61
free cash flows, 94
irregular, calculating, 60–61
on
irregular dates, calculating IRR
of, 66–67
IRR, fnding, 64–65
mid-year, calculating, 60
nonnegative NPV, 147
NPV of, 63
from put options, 588–589
sequence of cash flows, 65
cash outflows, annuities, 69
cell addresses, automated
generation of, 182
cell formats.
See also
conditional
formatting; formatting
Gradient Fill option, 191
cell ranges.
See also
named ranges;
range names
array formulas and functions in,
648
assigning names, 95
blank cells, counting, 150, 154
cells with numbers, counting,
150, 154
conditional formatting of,
185–207
counting cells in, 149–150
for data consolidation, 413
descriptive statistics on, 345
for DSUM function, 389
k
th largest/smallest number in,
344
listing in single row, 649–650
naming, 151
nonblank cells, counting, 150, 154
noncontiguous, selecting, 115
referencing, 163–175
selecting, 114, 210
totaling numbers in, 180
transposing, 650
validating data in, 319–320
Cell Reference box, 249
cell references
changing without changing
formulas, 178–179
equal to content of cell, 177.
See
also
INDIRECT function
Excel evaluation of, 178–179
cell values.
See also
numerical data;
percentiles; values
hiding, 192, 197
moving, 111–112
cells.
See also
input cells
binary changing cells, 267
border for, 198
changing cells, 241.
See
also
changing cells
conditional formatting of,
185–207
with conditional formatting,
selecting, 199
extracting data from, 167–168
linking, 113
linking combo and list boxes to,
238
linking option buttons to, 237
missing from worksheet, 99
reference cells, 163
shading, 193–195, 198
sorting on color, 212–213
target cells, 241.
See also
target
cells
unlocking, 594–595
user access to, 595
Cells group, 25
Format command, 133
centered moving averages
calculating, 499
trend lines, ftting to, 499
Central Limit Theorem, 532–
545
Central Limit
worksheet, 53
central location
mean, 337–338
median, 337–338
mode, 337–338
Cerealcollapse
worksheet, 3
ceteris
,
paribus
456
Ch52data.xlsx fle, 446
Ch57.xlsx fle, 485
Ch58data.xlsx fle, 489
Ch66data.xlsx fle, 539
Change Constraint dialog bo
252–253
Change Data Source command, 3
change in sign in cash flow
sequences, 65
Change Table Name command, 2
Changes group, 595
changing cells, 241–242
all different values, 303
binary changing cells, 267
binary, integer vs. fracti
bounds on, 295, 297
for fnancial planning probl
276
new parameters as, 505, 50
in project selection probl
for sports teams ratings, 2
for transportation problem
Chapter56data.xlsx fle, 475
Chapter58data.xlsx fle, 663
Chapter83data.xlsx fle, 661
CHAR function, 42
characters in text strings
counting, 41
extracting, 42–44
returning, 40
charitable contributions, c
81–82
Chart 1
worksheet, 361
Chart Output command, 329
Chart Title command, 427
Chart Tools Design tab, 426
Chart Tools Layout tab, 426
Chartdynamicrange.xlsx fle,
171–172
charts
dynamic updates, 171–173
source data for, 627
tables for data in, 222
Charts group Line option, 2
Charts group Line option

678
check boxes, 230
Christmas week worksheet, 507
chronological sorting, 210, 212,
213–214
churn rate, 601
Cici Colleen Lipstick And
Masc
worksheet, 398
Cigarettedata.xlsx fle, 380
circular references, 81–85
for cost allocation to support
departments, 85
with IF formulas, 97
iterations, 83
Maximum Change setting, 83
resolving, 15, 82–84
Ciscoexpo.xlsx fle, 431
Ciscoimpvol.xlsx fle, 593
Citydata.xlsx fle, 27
Citydistances.xlsx fle, 19, 136
Citypower.xlsx fle, 347
Classdata.xlsx fle, 273
Clear Filter command, 359
Clear Rules command, 187
Clear Rules From Selected Cells
option, 199
Closest.xlsx fle, 227
coeffcients, interpretation of, 456,
460
COGS, computing, 95
cohorts, defned, 602
Collegedata.xls fle, 380
colons in times, 105
color, sorting on, 212–213
color coding, 198–199
color scales, 186, 193–195
color combinations, 194
formula option with, 202
Color Scales option, 186–187
Colors
worksheet, 212
Colorscaleinvestment.xlsx fle, 193
Coltsdata.xlsx fle, 348
COLUMN function, 182, 207
column headings flter arrows, 218
column index
argument of
VLOOKUP function, 21
column labels, returning, 182
Column Labels zone, 353
column names in formulas, 15
column numbers, returning, 182
Column Separator list, 668
Column Sparkline
worksheet, 384
columns
breaking data into, 307–311
break points, 309
Delimited and Fixed-Width
options, 307–309
extracting text to, 46–47
flling with data, 555–556
fltering criteria for, 397
flters, clearing, 399
hiding, 25, 133
last number in, fnding, 169–170
referencing with INDEX function,
30
referring to by name, 84
separating data into, 168
transposing data to rows, 112–113
visibility of, 91
columns moved
argument of OFFSET
function, 164, 167
combo boxes, 230, 238
Combobox.xlsx fle, 238
commands,
See also specifc
command names
grouping, 2–3
from previous Excel versions, 3
commas, breaking data at, 46
comments
editing, 581
inserting, 581
printing, 582
showing and hiding, 581
compact form PivotTables, 354.
See
also
PivotTables
company values, 59
complex formulas, evaluating, 169
compound interest, 589
computed criteria, 389, 391–392,
408
CONCATENATE function, 41, 43–44
concatenation, ampersand (&) for,
152
Cond form
worksheet, 364
conditional formatting, 185–207,
300
based on formulas, 200–205
border on cells, 198
Clear Rules From Selected Cells
option, 199
color coding options, 198–199
color scales, 193–195
conditions, defning, 200–202
data bars, 191–195
deleting, 199
Format Only Cells That Contain
option, 198, 203
formatting options, 186–187
Highlight Cells feature, 188–189
highlighting dates, 189
highlighting text that contains
option, 189
icon sets, 195–197
More Rules option, 192
of new table data, 226
other worksheets, refere
205
of outliers, 341–342
for PivotTables, 364–365
rules, customizing, 189–
See also
rules for cond
formatting
selecting cells with, 19
shading cells, 198
Stop If True option, 205
toggling on and off, 234
top/bottom rules, 187–18
of weekend dates, 202–20
Conditional Formatting ar
Conditional Formatting me
Conditional Formatting Ru
Manager dialog box, 190
order of rules, 199
Use A Formula option, 20
Use A Formula To Determi
Which Cells To Format o
201
conditional tests, on val
formulas, 88.
See also
statements
confdence interval for me
557–558
Connections group Refresh A
option, 315
Consolidate command, 411
Consolidate dialog box, 4
Create Links To Source D
option, 413
Function box options, 41
Use Labels area, 413
consolidation, 411–415
grouping data for, 414
updating with new data, 4
constants
data ranges, dividing by
in forecasting equations
constraints, 241–242
adding, 249
changing, 252–253
for fnancial planning pr
276
in linear problems, comp
251
in project selection pro
in transportation proble
with Evolutionary Solver
consumer decision making,
640–641
consumer product valuatio
641–643
consumer surplus, 641
determining, 642–643
check boxes

679
Cont Rate EOQ
worksheet, 610
content, enabling, 313
continuous random variables, 511
Beta random variable, 535
discrete random variables,
modeling as, 512
modeling as normal random
variables, 560
modeling quantities with, 527
probability density functions,
511–512, 527
time between arrivals, 525–526
Weibull random variable, 535
Contoso.xlsx fle, 378
Contract Entire Field button,
356–357
Contrateeoq.xlsx fle, 610
controls.
See also
form controls
adding, 229
Controls group Insert option, 229
Controls.xlsx fle, 229
conventions for signs of
pmt
and
f
,
v
70
convergence to solution, 83–84
Convert Text To Columns Wizard,
168
Convert to Range command, 220
copying
fltered data, 399
formulas, 92
CORREL function, 445
Correlation dialog box, 443
Labels In First Row option, 444
correlation matrices, flling in,
444–445
Correlationexamples.xlsx fle, 441
correlations
defned, 441
input range, 444
interpretation of, 441–442
negative, 442
positive, 441
R2 values and, 445
regression toward the mean and,
445–446
among variables, 441–446
zero correlation, 442
cost of capital, 59
IRR in excess of, 65–66
Costestimate.xlsx fle, 425, 428
costs
allocating, 85
based on order quantity, 88–89
as function of units produced, 435
of production, 625
unit costs, 625, 639
COUNT function, 150, 154
COUNTA function, 150, 154, 168
COUNTBLANK function, 150, 154
COUNTIF function, 149–150, 551
counting cells based on criteria,
151–153
summarizing range of returns
with, 568
syntax, 150
COUNTIFS function, 150, 153, 158
Countryregion.xlsx fle, 467
Coupondata.xlsx fle, 486
craps
game status, determining,
576–577
modeling frst roll, 93
probability of winning at, 575–577
Craps
worksheet, 93
Craps.xlsx fle, 576
Create A Copy option, 190, 465
Create From Selection command,
633
range names, creating with, 11–12
Create Links To Source Data option,
413–414
Create PivotTable dialog box,
351–352, 670
Create Relationship command, 670
Creating Powers
worksheet, 657
Creditunion.xlsx fle, 501
CRITBINOM function, 519
criteria
case sensitivity, 151
dates as, 153
multiple, 150, 153
multiple,
flagging rows with, 158
for sorting, 210–212
summing based on, 157
text in quotation marks, 151
wildcard characters in, 152
criteria ranges
advanced flters and, 408
AND criteria in, 389
date references, 391
exclusion criteria, 390
multicolumn, 391
numerical values in columns, 392
text in columns, 392
tips for, 392
criterion
argument
of COUNTIF function, 150
of DSUM function, 389
of SUMIF function, 157
criterion_n
argument of COUNTIFS
function, 150
criterion1
argument of SUMIFS
function, 158
Ctrl key, 376
resizing slicers with, 672
selecting with, 115, 672
Ctrl+Shift+Enter key combina
648
Cuban, Mark, 307
CUMIPMT function, 75
CUMPRINC function, 75
cumulative value, 642
curly brackets ({}) for arr
649, 656
currency exchange rate quer
current time, displaying, 1
Current Values column, 146
Custom AutoFilter dialog bo
Custom Filter option, 403
Custom Format option, 187
custom formats.
See
conditional
also
formatting
creating, 187
Custom Lists dialog box sor
options, 214
custom sort orders, 214
customer value, 601–605, 64
churn rate, 601
loyalty incentives, calcul
603–605
retention rates, 601–603, 6
Customize Ribbon command, 2
Customize Ribbon page, 1–2
Customize the Quick Access T
page, 3
D
Dallas Mavericks, 307
data.
See also
new data
breaking into columns, 307–
consolidating, 411–415
copying, 399
deseasonalizing, 498–499
fltering, 357–361.
See
also
PivotTables
histograms from, 327–334
importing, 666
importing from Internet, 3
importing in text fles, 30
location, changes in, 166
making inferences from, 58
in multiple worksheets, 12
reading into PowerPivot, 66
realigning from column to r
and row to column, 112–113
refreshing, 315
sample standard deviation,
339–340
sample variance, 339
sorting, 357–361.
See
also
PivotTables
summarizing, 46–47
data

680
data
continued
( )
summarizing across worksheets,
117–119
summarizing in single worksheet,
182
summarizing with descriptive
statistics, 335–348
summarizing with slicers, 4
sum of squares, 474
time series data, 487–489
from Windows Azure Datamarket,
666
Data Analysis dialog box, 328–329
Anova: Single Factor option, 471,
472
Anova: Two-Factor Without
Replication option, 478
Anova: Two-Factor With
Replication option, 481
Histogram option, 328
Regression option, 455
Residuals option, 456
Rows Per Sample option, 482
Data Analysis Expressions (DAX)
functions, 673–674
Data Analysis for Managers with
Microsoft Excel
(Albright,
Winston, and Zappe), 316
data arrays, 650
changing data points in, 651
data bars, 186, 191–195
Bar Direction list, 192
Excel 2010 improvements, 7–8
formula option with, 202
orientation of, 193
for PivotTable data, 364
shading, 7
size of, 191, 192
solid shading, 193
Data Bars option, 186–187, 191,
207–208
data changes, watching, 121
Data Consolidate command, 118
data feeds, importing data from,
666
data formatting, 39–40.
See also
conditional formatting
data manipulation with Paste
Special command, 111–115
Data named ranges, 10
data points
in bin ranges, counting, 651
in data arrays, changing, 651
errors and residuals for, 428
graphing, 423–424
validation points, 459
Data Range Properties options, 315
data ranges.
See also
cell ranges
dividing by a constant, 113–115
select all data in, 114
data sets
comparing, 333, 342
kurtosis, 339
large, 665
mean, 337, 340
median, 337
mode, 337–338
range of, 340
ranking numbers in, 344–345
relative position in, 342–343
skewness measures, 339
spread of, 339–340
standard deviation, 340
summarizing, 193–195
trimmed mean, 345
data sources
multiple, 665–666
relationships among, 670
Data Table dialog box, 129
data tables, 127
automatic recalculation of, 131
bids, simulating in, 562
column input cells, 562
with database statistical functions,
391–392
EOQ sensitivity, 608
Excel functions and, 131–132
one-way, 128–130.
See also
one-
way data tables
for parameter changes in stock
options, 593
recalculating, 557
row and column input cells, 131
row input cells, 562
saving values in, 131
setting up, 129
two-way, 130–131, 131–134,
555–556.
See also
two-way data
tables
Data Tools group
Scenario Manager, 144
Text To Columns option, 45, 168
What-If Analysis option, 129
data validation, 238, 319–326
Autocomplete feature with, 324
clearing, 324
error alerts, 320
formulas for, 321–322
INDIRECT function with, 324
length of text criteria, 324
list validation criteria, 322–324
selecting all cells with, 323
time of day criteria, 324
Data Validation dialog box, 319–320
Custom setting, 321–322
Error Alert tab, 320
Input Message tab, 320
Settings tab, 320
database
argument of DSUM
function, 388
database statistical func
387–394
computed criteria, 389, 3
criteria ranges, 389.
Se
also
criteria ranges
data tables with, 391–39
date criteria, 391
DAVERAGE function, 390
DCOUNTA function, 390
DCOUNT function, 390
DGET function, 393–394
DSUM function, 387–389
exclusion criteria, 390
multicolumn criteria ran
391–392
OR operations, 390
summarizing data with, 6
databases
duplicates, removing fro
405–406
extracting records, 408
feld names, 396
felds, 396
flters, clearing, 399
importing data from, 666
querying with AutoFilter
records in, 396
selecting all, 151
date and time
in same cell, 106
serial number for, 105
Date Axis
worksheet, 383
Date Filters options, 402
DATE function, 53
date functions, 49–55
DATEDIF function, 54
DATE function, 53
DATEVALUE function, 50
DAY function, 53
MONTH function, 53
NETWORKDAYS function, 52
NETWORKDAYS.INTL functio
TODAY() function, 51
WEEKDAY function, 53
WORKDAY function, 51–52
WORKDAY.INTL function, 5
YEAR function, 53
DATEDIF function, 54
Datedv.xlsx fle, 321
Datelookup.xlsx fle, 25
dates, 49–55
as criteria, 153
extracting year, month, d
53
data (
continued
)

681
formatting conditionally, 202–203
grouping, 377
holidays, 51–52
month-day-year formats, 49–50
serial format, 50–51
today’s date, displaying, 51
validating, 321
weekend dates, 202–203
workdays, defning, 52
dates
argument, 60–61
Dates
worksheet, 213
DATEVALUE function, 50
DAVERAGE function, 390
DAX functions, 673–674
DAY function, 53
days
counting, 54
selecting without typing, 238
sorting chronologically, 214
#days
argument, 51
days
argument, 52
days off, defning, 52–53
DCOUNTA function, 390
DCOUNT function, 390
debt
computing, 95
in pro forma statements, 93–97
debugging formulas, 169
Decadeincome.xlsx fle, 347
Deciles.xlsx fle, 394
Defne Names command, 172
Defned Names group, 17
Create From Selection option, 151
Name Manager option, 171
Delete Rule command, 190, 199
Delimited option, 307, 309
delimiters for columns, 309–310
delimiting characters, 168
Delldata.xlsx fle, 429
Dellvol.xlsx fle, 590
demand
constant rate, inventory modeling
and, 607–611
economic order batch and, 611
economic order quantity and, 609
elasticity of, 626
meeting with limited resources,
253
95-percent service level and, 616
and price, nonlinear relationship,
463
production and, 245
simulating, 551–552, 554
uncertain, inventory modeling
with, 613–618
unlimited, 253
demand constraints, 251
demand curves, 625–629
customer willingness to pay and,
628–629
defned, 625
determining, 631
determining for unknown
elasticity, 635
estimating, 626–628
linear and power curves, 626–628
quadratic, 635
demand points, 261
total product received by,
calculating, 262–263
Deming, Edwards, 334
Deming.xlsx fle, 334
dependencies between cells, 81
dependent variables, 423
multiple factor effects on, 477
nonlinear effects on, 463
regression toward the mean,
445–446
dependents
defned, 122
tracing, 122–123
deposits
at beginning or end of period,
71–72
future value of, 72
depreciation
accumulated, computing, 96
computing, 96
descriptive statistics, 327, 335–348
on cell ranges, 345
central location measures,
337–338
comparing data sets with, 342
condition formatting for outliers,
341–342
geometric mean, 346
grouping settings, 336
input range, 336
kurtosis, 339
labels, 336
large and small numbers, fnding,
344
percentile rankings, 342–343
ranking numbers, 344–345
skewness measures, 339
spread of data, 339–340
summary statistics, 336
Descriptive Statistics dialog box,
335–336
deseasonalizing, 498, 499
Design tab, 218, 670
Table Style Options group, 223
Developer tab, displaying, 229
development costs, OFFSET function
for, 167
DGET function, 393–394
Dget.xlsx fle, 392
Diagonal.xls fle, 175
Dif option, 303–305
discount rate, 602
NPV to zero, 66–67
discounts, quantity discoun
discrete random variables, 5
binomial random variables,
515–517
modeling as continuous rand
variables, 512
simulating values of, 551–5
Discretesim.xlsx fle, 551
dispersion measures, 339–34
Display Equation On Chart o
426, 636
Display R-Squared Value On C
option, 426
distances, calculating, 29–
DISTINCT function, 673
distribution problems, 261–
#DIV/0! error, 99
Dividebyprice.xlsx fle, 103
dividend rate, 589
dividends
computing, 96
exercising call options and
stock price and, 593
Dolan, Robert J., 625
dollar sign ($), 247, 577
in array formulas, 656
inserting and deleting, 20
use of, 201
double-clicking to copy for
92
Dow.xlsx fle, 348, 379, 385
D prefx, 387–388
Draftlottery.xlsx fle, 347
drilling down in PivotTables
drop-down lists, 238
for data validation, 322–32
Drugabandon.xlsx fle, 597
Drugfore.xlsx fle, 542
DSUM function, 387–388, 390
multicolumn criteria range,
391–392
syntax, 388–389
Duedates.xlsx fle, 206
dummy variables, 454–458
for array formulas, 659
interpretation of, 457
duplicates
fnding with array formulas
652–653
formatting conditionally, 1
removing, 405–406
removing from tables, 220
duration of activity, model
duration of activity, modeling

682
duration of stock options, 589
increases in, 593
dynamic range names, 170–171.
See
also
range names
creating, 172
dynamic ranges, creating, 170–171,
172–173, 218
dynamic updates of charts, 171–173
dynamic web queries, 315–316
E
e
value (base of natural logarithms),
431
Eastandwestconsolidated.xlsx fle,
414
Eastwest.xlsx fle, 10
East.xlsx fle, 411
economic order batch (EOB),
610–611
annual holding costs, 611
batch size and, 611
demand and, 611
economic order quantity (EOQ), 608
demand and, 609
quantity discounts and, 609
economic order quantity formula,
607–611
economy, effect on elections, 458
Edit Comment command, 581
Edit Data command, 383
Edit Formatting Rule dialog box,
193, 203, 204
icon set options, 196
Reverse Icon Order option, 197
Show Bar Only option, 192
Show Icon Only option, 197
Edit Query command, 315
Edit Rule button, 190
Edit, Replace command, 44
effciency, outliers and, 429
elasticity of demand, 626
Electiondata.xlsx fle, 430
elections
data on, 459
predicting, 458–461
employees
length of time worked,
computing, 108
total hours worked, computing,
108
Employees.xlsx fle, 28
Enable Iterative Calculations option,
81–84, 97
end_date argument, 52
enddate argument, 54
ending balances, calculating, 74
Enter Parameter Value dialog box,
316
EOB, 610–611
EOQ, 608–609
EOQ
worksheet, 608
Eoq.xlsx fle, 608
Equation 1, 275
for loan payment calculations, 276
for sports teams ratings, 282–283
Equation 2, 275
for retirement planning, 278
equation editor, 7
equation editor templates, 7
equation solver, 137–141.
See
also
Goal Seek command
equations
creating in Excel, 7
importing, 7
iteration procedure for linear
equations, 83–84
equity, computing, 95
error alerts, 320
error values, 97
examples of, 99
ignoring, 98
errors
data validation feature and, 319
ignoring rows with, 98
replacing with spaces, 97–99
Errortrap.xlsx fle, 97
Errortypes.xlsx fle, 99
Esc button, 169
Esc key, 289
estimation.
See also
forecasts and
forecasting
standard error of regression,
428–429
of straight-line relationships,
423–430
European stock options, 588.
See
also
stock options
call options, 102
put options, 89–90
valuing, 592
Evaluate button, 169
Evaluate Formula command, 169
Evolutionary Solver engine, 244, 291
constraints, 297
cutoff points, 645
for job assignment problems,
297–300
keys to using, 297
penalties with, 297–300
for proft-maximizing quantity-
discount plan, 645
for sequencing problems,
303–306
EXACT function, 175
Excel 2010, new features, 1
Excel 2010 Icons
workshee
Excel fles, importing dat
666, 668–669
Excel icon, 668
Excel NPV function, 59
Excel Options dialog box, 8
Excel Solver.
See
Solver
excess production, 245
exclamation point (!), 16
exercise date, defned, 58
exercise price
defned, 587
increases in, 593
option value and, 589
Existing Connections opti
Expand Entire Field butto
expected values, 510
expenditures, sorting by g
366
experience curves, 436
modeling, 437–439
experiments.
See also
pro
succes
defned, 509
expiration date, defned, 5
EXPON.DIST function, 525
EXPONDIST function, 525
exponential functions, eq
for, 431
exponential growth, model
431–434
exponential probabilities
exponential trendlines, 4
431–434
ft of, 433
Exponentialdata.xlsx fle, 4
extracting data, 42–44, 4
from cells, 167–168
Text To Columns Wizard, 4
extracting records, 408
F
F. Harris of Westinghouse
Corporation, 607
F3 key, 153
F4 key, 202
F5 key, 199, 323, 399, 59
F9 key, 131, 178–179, 233
for data tables, 557
multiple presses of, 555
factors
effect on data, 471
mulitple, 477
Fair, Roy, 458
Fairmodel.xlsx fle, 458
duration of stock options

683
favorite rating–underdog rating of
sports teams, 580
Fax.xlsx fle, 437
Feasible Solution
worksheet, 245
feasible solutions, 244
to product mix model, 251
features, toggling on and off,
234–236
feeds, importing data from, 666
Ferrari, Alberto, 665
feld
argument of DSUM function,
388–389
feld names, 396
felds, database, 396
felds in PivotTables, 352
calculated felds, 374–375
collapsing and expanding,
356–357
sorting and fltering, 357–361
File Conversion dialog box
(Microsoft Word), 308
File menu, 6
File tab, 5–6
Fill command, 555
Fill tab, 198
Filter By Color option, 404
Filter By Color
worksheet, 404
Filter By Months
worksheet, 403
Filter command, 399
fltering, 395–409.
See also
sorting
Advanced Filter feature, 408
clearing flters, 399
by color, 404
copying data to new worksheets,
399
Date Filters options, 402–403
Date options, 401–402
duplicates, removing, 405–406
Greater Than option, 400–401
by months, 403
by name, 404
numerical data, 399–400
reapplying flters, 407
text flters, 397
top 10 values, 359
top records, 405
for unique combinations,
406–407
Final Four basketball tournament,
simulating, 579–582
Final Percent Breakdown
worksheet,
371
Final Table
worksheet, 368
Final4sim.xlsx fle, 580
FinalRegression
worksheet, 465
fnance.yahoo.com, 546
fnancial decision making, option
pricing and, 596–598
fnancial functions, author’s
conventions, 70
fnancial future, predictions of, 94
fnancial planning problems,
275–280
changing cells, 276
constraints, 276
retirement funds, 275
target cells, 276
FIND function, 41, 44, 45, 168
case sensitivity, 41
Find & Select command, 45
Finearts.xlsx fle, 379
Finmathsolver.xlsx fle, 276
First Column option, 221
1st Percent Breakdown
worksheet,
370
First 6 months
worksheet, 362
1st Table
worksheet, 370, 372
1st Three Days
worksheet, 505
fxed assets
gross, computing, 96
net, computing, 96
Fixed Width option, 307, 309
Fizzy.xlsx fle, 467
font color, sorting on, 212–213
Font dialog box launcher, 595
forecast errors, 506–507
random variables and, 543
forecasts and forecasting
accuracy of, 451, 460, 475, 480,
484, 504–507, 542
bias in, 542
evaluating, 542–543
forecast errors, examining,
506–507
forecast errors, random, 507
formulas, 492
future values, 491
GROWTH function for, 660
historical data about, 541
lagged values and, 455
mean of, 542
from multiple regression, 461–462
with one-way ANOVA, 474–475
optimizing, 492
outliers in, 504–505
parameters settings, 503–504
point forecasts, 541
presidential elections, 458–461
ratio-to-moving-average method,
497–500
sales, 483
scale constant, 658
special events, accounting for,
501–504, 504–506
standard deviation of, 542
Winters’s method, 491–495
form controls
check boxes, 234–236
combo boxes, 238
displaying, 229
list boxes, 238
option buttons, 237
resizing, 232
scroll bars, 234
shapes, changing, 232
spin buttons, 231–234
Format Cells, General comma
Format Cells dialog box, 18, 5
opening, 50
Format command, 133, 198
Format Control command, 232
Format Control dialog box, 23
minimum values, 239
Page Change option, 234
Format Only Cells That Cont
option, 198, 203
Format Trendline dialog box4
Display Equation On Chart o
426, 636
Display R-Squared Value On C
option, 426
Exponential option, 432
Linear option, 426
Polynomial option, 636
Power option, 437–438
Format Visibility options, 1
Formatted $s
worksheet, 355
formatting, 39–40
automatically updating, 218
conditional formatting, 18
deleting, 199
in PivotTables, changing, 3
of query results, 315
tables, 218
Formula Auditing group, 121
Evaluate Formula option, 169
Trace Dependents button, 1
Trace Precedents button, 12
Formula AutoComplete featur
219–220
formulas
array-entering a formula, 6
array formulas, 647–648.
S
also
array formulas
autocompleting, 219
autocopying, 220
automating, 182
column names in, 15
for columns of numbers, 283
for conditional formatting,
200–205
conditional tests on, 88.
also
IF statements
copying, 92, 99–100
formulas

684
formulas
continued
)(
for data validation, 321–322
DAX functions, 673–674
deleting, 112
dollar sign in, 577
evaluating parts of, 169
protecting from changes, 594–
596, 609
range names, applying to, 17
range names in, 14–15, 153
selecting all, 595
table specifers in, 225
three-dimensional, 117–119
and values, toggling between, 121
four-period moving averages,
488–489
Fractiondefective.xlsx fle, 206
fractions, time displayed as, 107
free cash flows (FCFs), 94
Freeze First Column option, 91
Freeze Panes command, 91,
233–234
Freeze Top Row option, 91
FREQUENCY function, 650–651
frequency graphs, 46–47
frequency of values in value ranges,
650–651
Frequency
worksheet, 650
From Web option, 313–314
Fruitlist.xlsx fle, 324
function number, 98
Function Wizard, 153
Help On This Function, 98
functions
DAX functions, 673–674
maximizing and minimizing,
288–289
new in Excel 2010, 6
nonsmooth functions, 291
future dollars, annuity values in,
71–72
future payments, value in today’s
dollars, 69–71
future values, 70
forecasting, 491
in PV function, 70
sign conventions, 70
fv
argument of PMT function, 73
FV function, 71–72
syntax, 71
fx button, 673
g
gambling
craps, probability of winning at,
575–577
poker, probability of getting a
particular hand, 577–579
Gasprices507.xlsx fle, 221
Gauss-Seidel Iteration, 83
Gaussian histograms, 340
geometric mean, 346
GEOMMEAN function, 346
Geommean.xlsx fle, 346
Gesimless5.xlsx fle, 568
Gesim.xlsx fle, 566, 573
Get External Data group
Existing Connections option, 316
From Web option, 313–314
GETPIVOTDATA function, 377–378
turning off, 378
GetPivotData Function For
PivotTable References option,
378
Getpivotdata.xlsx fle, 377
Globalwarmingtemp.xlsx fle, 207
Globalwarming.xlsx fle, 187
GNP.xlsx fle, 207
Goal Seek command, 137–141
amount borrowed, calculating,
138–139
implied volatility, calculating, 593
loyalty incentives, calculating,
603–605
story problems, solving with,
139–140
Goal Seek dialog box, 138, 594
Goals.xlsx fle, 385
Golfdata.xlsx fle, 174
Go To dialog box, 125, 595
Conditional Formats option, 199
Special option, 323
Grades.xlsx fle, 28
Gradient Fill option, 191
Grand Total, displaying, 419
Graph No Interaction
worksheet,
482
graphics, sparklines, 381–385
graphs.
See also
histograms
creating, 46–47
of data points, 423–424
moving average graphs, 488–489
of time series, 487
greater than or equal to (>=)
operator, 152
GRG Nonlinear engine, 243
maximizing and minimizing
functions with, 288–289
Multistart option, 289, 295
for nonlinear optimization
models, 288–291
for warehouse location problems,
292, 294–295
GRG2 method, 251
Groceriespt.xlsx fle, 351
Grocery.xlsx fle, 467
gross fxed assets, comput
group boxes, 230
drawing, 237
grouping
dates, 377
nonadjacent selections, 3
numerical values, 377
Grouping dialog box, 367
groups
disbanding, 376
in PivotTables, creating
Groups Collapsed
workshee
groups within tabs, 2
growth, modeling, 431–434
GROWTH function, 660
guess
argument, 66
for IRR, 64
in RATE function, 75
varying, 64
H
Harrison, Benjamin, 461
Header Row option, 221
header rows, displaying, 2
heading arrows, in AutoFi
headings, for PivotTable d
Hedging
worksheet, 89–90
height
argument of OFFSET
function, 164, 167
Help On This Function opt
hidden rows, ignoring, 98
Hide Columns command, 25, 1
Hide Rows command, 133
hiding
cell values, 197
columns, 133
icons, 197
rows, 133, 193
High Low
worksheet, 382
highest value
fnding, 35–36
formatting conditionally
Highlight Cells condition
formatting feature, 186
Highlight Cells Rules opt
188
A Date Occurring option, 1
Text That Contains optio
Highlightcells.xlsx fle, 1
Histogram dialog box, 328
histograms, 327–334
bin-range frequencies, 3
bin ranges, 327–328, 329
comparing data sets with
gaps between bars, 329–3
formulas ()
continued

685
histograms
continued
) (
Gaussian, 340
input range, 329
labels, 329–330
shapes of, 330–332
title of, 330
Histograms
worksheet, 333
Historicalinvest2009.xlsx fle, 333
Historicalinvest.xls fle, 197
Historicalinvest.xlsx fle, 14, 206,
348, 662
HLOOKUP function, 21
example, 25
syntax, 22
holding costs.
See also
inventory
modeling
assumptions about, 613
minimizing, 614–616
holidays, 51–52
holidays
argument, 51, 52
Holland, John, 291
horizontal lookups, 21
Hospital.xlsx fle, 379
hour, extracting from times, 108
HOUR funtion, 108
Housedata.xlsx fle, 430
Housepricedata.xlsx fle, 394
House2.xlsx fle, 492
housing starts, forecasting, 491–495
Hr.xlsx fle, 26
HYPERGEOM.DIST function, 520
Hypergeom.dist.xlsx fle, 520
hypergeometric random variables,
519–520
i
icon sets, 186–187, 195–197
formula option with, 202
icons, customizing, 197
Icon Styles list, 196
Icon Sets option, 186–187
Icon Styles list, 196
icons
cell values, associating with,
195–197
hiding, 197
sorting on, 213
If 3 then 4
worksheet, 270
IF statements, 87–104
for breakeven analysis, 133–134
circular references with, 97
conditions on, 88, 92
craps, modeling frst roll, 93
errors, ignoring, 97
Evolutionary Solver for, 645
with MOD function, 99–100
nesting, 89, 100
order of evaluation, 89
OR formulas in, 93
for percentage return on
portfolio, 89–90
for quantity discounts, 88–89, 645
with ROW function, 99–100
sports winners, advancing with,
580–581
text in, 92
IFERROR function, 97–99, 99, 136
Impalas.xlxs fle, 434
implied volatility approach, 593
Import Data dialog box, 314
importing
data, 666
data from Internet, 313–317
queries, refreshing, 315
text fles, 307–311
Word documents, 307
income before taxes, computing, 96
income statements, defned, 94
Incomedata.xlsx fle, 348
independent random variables,
512–513
mean, variance, and standard
deviations of, 532–533
independent variables, 423
allowed number, 501
coeffcients, estimating, 502
coeffcients, intrepreting, 456, 460
defning, 458
dropping from analysis, 450, 460,
465
dummy variables, 454–458
interactions between, 464–467
multiple, 447–452
nonlinear effect on dependent
variables, 463
predictive power, 450–451, 457
p-values, 450
qualitative, 453–462
quantitative, 453
INDEX function, 29–31, 237
distances, calculating with, 29–30
referencing columns and rows
with, 30
syntax, 29
for total distance traveled, 304
Index.xlsx fle, 29
indicator variables, 502
INDIRECT function, 177–183
blank rows and, 180
changing cell references in
formulas, 178–179
with data validation, 324
for summarizing data in sin
worksheet, 182
listing entries in one work
179
range names, referencing,
181–182
totaling values in original r
180
Indirectconsolidate.xlsx fl
Indirectinsertrow.xlsx fle, 1
Indirectmultisheet.xlsx fle
Indirectrange.xlsx fle, 181
Indirectsimpleex.xlsx fle, 1
inexact matches, 34
infeasible solutions to pro
model, 252
inferences from data, 583–5
input assumptions, 121
changes, analyzing effects o
127–136
dependents on, 122–123
listed inputs, 129
outputs of interest, 127
input cells
spin buttons, linking to, 23
varying, 143–147
input values
changes in two values, 131–
changing, 131
Insert Blank Line After Eac
option, 363
Insert Calculated Field dia
374
Insert Field button, 374
Insert Worksheet command, 1
Insig
worksheet, 473
Integer Optimality setting, 2
integer programming problem
271–272
integers, 152
summing second digits in se
651–652
interactions
in ANOVA analysis, 482, 484
defned, 464
prediction equations and, 4
testing for, 464, 477, 480–
Interactions.xlsx fle, 463, 4
interarrival times, 619
mean and standard deviatio
619, 622
stationary, 620
INTERCEPT function, 429
intercept of least-squares l
interdependence between ret
570
interest expense, computing
interest expense, computing

686
interest income, computing, 96
interest paid
calculating, 73–74
cumulative, 75
interest rate, 63
annual, 59
calculating, 75–76, 113–114
computing, 276
IRR and, 63
NPV of zero and, 64
risk-free rate, 589, 593
internal rate of return.
See
IRR
Internet, importing data from,
313–317
invalid data.
See also
data validation
error alerts, 320
flagging, 319
inventory costs
annual, 609
minimizing, 607–609
inventory levels
average, 608
average, production, 610
inventory modeling
economic order batch, 609–611
economic order quantity,
607–609
reorder point, 613
safety stock levels, 615
with uncertain demand, 613–618
investment evaluation
net present value criteria, 57–63
with payback period, 37
Investment Science
(Luenberger),
587
investments
future scenarios, generating, 565
future value of, 71–72
IPMT function, 73–74
syntax, 73
IQ Density
worksheet, 528
IRR
borrow and reinvest rates and,
66–67
calculating, 60–61
cash flows on irregular dates,
calculating, 66–67
cost of capital, in excess of, 65–66
defned, 63
fnding, 64–65
multiple, 64
no IRR, 65
scale of project and, 66
unique, 63–65
unique, guarantee of, 65
using, 65–66
IRR function, 63
cash flow left blank, 67
IRR, fnding, 64
syntax of, 64
ISNUMBER function, 321–322
iteration procedure, 83–84
Ivolatility.com, 546
J
Jen + Emilee
worksheet, 408
job assignment problems, 297–300
job shop scheduling problems, 303
Jobshop.xlsx fle, 109
Jordan.xlsx fle, 348
justifcation of text, 42
K
Keep Solver Solution command, 252
Kingslineups.docx fle, 311
k
th-largest/smallest number, 344
fnding, 36
kurtosis, 339
L
labor
length of time worked, 108
for production, 246
scheduling problems, 255–259
usage calculations, 246–247
lagged values, 455
Lagged.xlsx fle, 174
LARGE function, 207, 344
functionality of, 36
syntax of, 36
largest values, associating data bars
with, 191–192
Last Column option, 221
last number in column, returning,
169–170
Last year.xlsx fle, 17
Latitude.xlsx fle, 325
Launch group, 666
Lawdata.xlsx fle, 586
Layout Group Report Layout option,
354
layout method, 3
leap year bug, 50
learning curves, 436
estimates for various industries,
439
modeling, 437–439
learning rates, 436
least-squares lines, 427
intercept of, 429
slope of, 429
standard error of, 428–4
LEFT function, 40, 43, 45
left-hand lookups, 165
Lefthandlookup.xlsx fle, 1
Lemonadegs.xlsx fle, 137
Lemonade.xlsx fle, 128
LEN function, 41, 43
length of time worked, co
108
level of time series, 491
updating, 493
Lewent, Judy, 596
liabilities
balancing with assets, 9
computing, 95
total, computing, 97
Lillydata.xlsx fle, 663
linear demand curves, 626
linear equations, iterati
procedure, 83–84
linear model requirement, 2
linear models
Solver solutions for, 28
very large and small num
and, 277
linear optimization probl
250
project selection proble
270
transportation problems, 2
workforce scheduling pro
257
linear pricing.
See also
pricing
defned, 639
proft-maximizing price, 6
linear relationships
dummy variables for, 454
exact, 454–455
strength of, 441.
See
also
correlations
linear trendlines, 424
estimating, 423–430
Linearft.xlsx fle, 626
line graphs
automatically updating, 2
creating, 221
Line Sparkline
worksheet, 3
LINEST function, 447, 452
Lineupsch38.docx fle, 307
Lineupsch38.txt fle, 308
linking range names, 89
Lipstick Jen East
workshe
Lipstickprice.xlsx fle, 6
interest income, computing

687
list boxes, 230, 238
List validation criteria, 322–324
listed inputs, 129
lists
items in, selecting, 238
matching items in, 652–653
lists that change, TRANSPOSE
function for, 649–650
loan balances, fnal, 73
loan payments, calculating, 72–74
loans
amount of, 73
interest paid, 276
monthly payments, calculating
with Solver, 275–277
unpaid balances, 275
Locked option, 595
LOGEST function, 657–660
syntax, 659
logical functions
copying, 201–202
evaluation of, 200–201
Logicalexamples.xlsx fle, 200
lognormal random variables
for Black-Scholes pricing formula,
590
stock price modeling with, 545–
548, 565
LOGNORM.DIST function, 545, 547
LOGNORM.INV function, 545, 548
LOGNORMDIST returns, 547
lookup functions, 21–28
fnding values based on date, 25
fnding values based on ID
numbers, 24–25
frst column in ascending order,
22–24
frst column not in ascending
order, 24–25
left-hand lookups, 165
table ranges, naming, 23
VLOOKUP function, 21–22
wildcard characters and, 34
lookup ranges, 33
single-row, 34
unsorted values, 34
lookup value
argument of VLOOKUP
function, 21
lookup values, 33
exact matches to, 33
values greater than or equal to, 33
values less than or equal to, 33
Lookupdata.xlsx fle, 227
Lookupmultiplecolumns.xlsx fle, 27
Lookup.xlsx fle, 22
loops between cells, 81
lost-sales case, 613–616
LOWER function, 42
lowest values, formatting
conditionally, 188
Loyalty Effect, The
(Reichheld), 601
Loyalty.xlsx fle, 601
Luenberger, David G., 587
M
m
by
n
matrixes, 662
Macdonalds.xlsx fle, 379
machine lifetimes, modeling,
535–537
Make Unconstrained Variables Non-
Negative option, 250, 253, 257,
572
Makeup
worksheet, 209, 212–213
Makeuparray.xlsx fle, 654
Makeupdb.xlsx fle, 379, 388, 393,
663
Makeupflter.xlsx fle, 396
Makeupsortfont.xlsx fle, 215
Makeupsorttemp.xlsx fle, 209, 212,
213
Makeupsort.xlsx fle, 212
Makeupsubtotals.xlsx fle, 417
Makeup2007.xlsx fle, 158, 161
Manage Rules command, 187,
189–191
Manage Rules dialog box Stop If
True option, 205
managerial flexibility, valuing, 596
MAPE, 494
Marathon.xlsx fle, 109
Maria.xlsx fle, 139
marketable securities, computing,
95
Marketbasketdata.xlsx fle, 183
master workbooks, creating,
411–415
MATCH function, 33–38
functionality of, 33
inexact matches, 34
k
th value, determining, 35–36
OFFSET function with, 165–166
with other functions, 35
payback period, calculating,
37–38
in PivotTables, 378
syntax of, 33
for units purchased, 642–643
wildcard characters and, 34
match type=0
argument, 33–34, 36
match type=–1
argument, 33
match type=1
argument, 33, 37, 38
Matching Names
worksheet, 652
Matchlist.xlsx fle, 104
Matchthesecond.xlsx fle, 15
mathematical operations, so
optimization problems wit
243
Matradingrule.xlsx fle, 91–
matrices
multiplying, 662
square matrices, 662
MAX function, 35
Maximum Change setting, 83
Maximum Time Without
Improvement option, 297
mean, 337–338
analysis of variance, 471–4
of forecasts, 542
geometric means, 346
of random variables, 510
of resampled data, 584
signifcant differences amo
trimmed means, 344–345
mean absolute percentage er
(MAPE), 494
Meanvariance.xlsx fle, 510
median, 337–338
averaging numbers larger t
653
calculating using array for
660–661
in skewed data sets, 345
MEDIAN function, 337
Medians.xlsx fle, 660
Merton, Robert, 587
Microsoft PowerPivot for Ex
Give Your Data Meaning
(Ru
and Ferrari), 665, 673
Microsoft SQL Server Report
Services, 666
Microsoft Word equation edi
MID function, 40, 43, 45
military time, 105–106
minute, extracting from tim
MINUTE funtion, 108
MINVERSE function, 662
MIRR function, 66–67
syntax of, 67
MIRR
worksheet, 67
MMULT function, 662
MOD function, 99–100
mode, 337–338
MODE function, 337–338
MODE.MULT function, 337–338
MODE.SNGL function, 337–338
Modefunctions.xlsx fle, 337
Model
worksheet, 621
modeling.
See
Solver
activity durations, 538–53
modeling

688
modeling
continued
(
)
growth of revenue, 431–434
machine lifetimes, 535–537
stock prices, 545–548
uncertain events with Monte
Carlo simulation, 549–558
modifed internal rate of return
(MIRR), 66–67
money deposited
at beginning or end of period,
71–72
future value of, 72
money owed, value of, 71
Monte Carlo simulations, 147,
549–558
annual return, calculating, 571
assumptions, incorporating, 568
of binomial random variables,
559–560
confdence interval for mean
proft, 557–558
continuous random variable,
modeling as normal random
variables, 560
of craps game, 575–577
for decision making, 554–556
of demand, 551–552
fnal asset position for each
scenario, 571
for gambling and sporting event
simulations, 575
optimal bids, calculating with,
559–563
probability of getting a particular
poker hand, 577–579
RAND funciton, 550–551
random variables, simulating
values of, 551–553
risk and, 557
sports teams, rating, 579–582
users of, 549–550
month-day-year formats, 49
MONTH function, 53
monthly fxed costs, 428
monthly payments
amount borrowed based on,
138–139
calculating, 73–74
months
counting, 54
sorting chronologically, 213
More Rules option, 192
mortgage payments
changes based on input changes,
131–132
determining with Solver, 275–277
Mortgagedt.xlst fle, 132
mortgages
adjustable rate mortgages, 78–79
amount borrowed, calculating,
138–139
balloon mortgages, 78
most-likely scenarios, calculating,
143–147
Move Or Copy command, 190, 465
Move PivotTable command, 365
Movies.xlsx fle, 167–168
moving average graphs, 488–489
Moving Average option, 488
moving-average trading rules,
90–93, 174
moving averages
calculating, 499
centered, calculating, 499
four-period moving averages,
488–489
four-quarter, 499
moving cell values, 111–112
Mrcostest.xlsx fle, 447
MSFT and IBM
worksheet, 316
MSN MoneyCentral Investor Stock
Quotes query, 316
multiple criteria
flagging rows with, 158
functions allowing for, 150
Multiple IRR
worksheet, 64
multiple peaks histograms, 332
multiple regression, 428, 447–452
accuracy of predictions, 451–452
coeffcients, interpreting, 456
dummy variables, interpreting,
457
forecasts from, 461–462
independent variables, deleting
from analysis, 450
independent variables, predictive
power, 450
input ranges, 449
interactions, checking for,
464–466
lagged values, 455
LINEST function, calculating with,
452
nonlinear effects, checking for,
464–466
outliers, 451, 461
output location, 449
prediction equation 1, 456, 466
prediction equation 2, 460
presidential elections, predicting
with, 458–461
qualitative factors in, 453–462
residuals, 449, 451, 457
results, inserting in workbook, 452
for sales forecasts, 453–457
standard error, 451
validation points, 459
Multistart option, 243, 289, 295
mutation rate, 291, 297
increasing, 304
My Data Has Headers optio
My Table Has Headers opti
N
#NA (not available), 34, 9
Name arrow, 10
Name box
defned, 10
range names, creating in
workbook scope names, 16
#NAME? errors, 99
Name Duplicates Removed
worksheet, 405–406
Name Manager, 171, 218
range names, creating wi
named ranges.
See also
ce
range names
column names as, 15
creating, 9–12
Namedrows.xlsx fle, 18
Names.xlsx fle, 206
Nancybonds.xlsx fle, 103
Nash, Steve, 559
navigating workbooks, 353
NBA players, rating, 307
Nbadistances.xlsx fle, 31
Nbadvl.xlsx fle, 319
Nbamiles.xlsx fle, 306
Nbasalaries.xlsx fle, 206
NBA.xlsx fle, 161
Nba01_02.xlsx fle, 285
Nba02_03.xlsx fle, 285
Ncaa2003.xlsx fle, 581
negative binomial random v
520–521
negative numbers in data b
negative production, 253
negative values, data bar
negatively skewed histogr
NEGBINOM.DIST function, 5
Negbinom.dist.xlsx fle, 5
nested IF formulas, 89, 1
Nestedsubtotals.xlsx fle, 4
net fxed assets, computin
net income, computing, 96
net present value (NPV).
NETWORKDAYS function, 52–
NETWORKDAYS.INTL function
New Comment command, 581
new data
automatic updating on, 2
222
conditional formatting o
formatting style for, 21
updating with, 171–173
New Data
worksheet, 222
modeling ()
continued

689
New Formatting Rule dialog box,
192
for PivotTables, 364
Use A Formula To Determine
Which Cells To Format option,
341
New Group button, 2
New Name dialog box, 12, 12–13,
18, 172
New Rule button, 190
New Rule command, 187
New Tab button, 2
new text
argument, 41
New Web Query dialog box,
313–314
NFL point spreads, setting, 281–285
NFLpoints.xlsx fle, 334
Nfl2009april2010.xlsx fle, 281, 282
Nflwinslosses.xlsx fle, 384
Nfl0x.xlsx fle, 285
Nikedata.xlsx fle, 227
95-percent service level, 616–618
defned, 613
Nlp.xlsx fle, 639
No Blades
worksheet, 631
No Feasible Solution
worksheet, 252
No IRR
worksheet, 65
NoA
worksheet, 450–451
nonadjacent selections, grouping,
376
nonblank cells, counting, 150, 154
Noncontig.xlsx fle, 11
nonlinear effects, 463
checking for, 464
nonlinear optimization models, GRG
Nonlinear engine for, 288–291
nonlinear pricing, 639–646.
See
also
product pricing
defned, 639
quantity discounts, 639
two-part tariffs, 640
Nonlinear Pricing Examples
worksheet, 639
Nonlinearity
worksheet, 463
nonsmooth functions, 291.
See
also
Evolutionary Solver engine
defned, 244
solving, 244
nonsmooth optimization problems,
291.
See also
Evolutionary
Solver engine
NORM.DIST function, 529–530, 543
NORM.INV function, 531–532,
552–553, 560
for sports simulations, 580–581
NORM.S.DIST function, for
cumulative normal probability,
591
normal cumulative functions, 529
normal random variables, 527–534
continuous random variables,
modeling as, 560
larger σ, 529
percentiles for, 531–532
properties of, 528–529
simulating values of, 552–553
standard normals, 591
Normalexamples.xlsx fle, 528, 530
not equal to angle brackets (<>),
152
NOT function, evaluation of, 200
NOW() function, 107
NPER function, 76
NPV
beginning-of-year cash flows,
59–60
calculating, 58–59
of customers, 602
defnition of, 57–59
end-of-year cash flow, converting
to beginning-of-year, 602
interest rate and, 63
irregular cash flows, 60–61
maximizing, 267, 269
mid-year cash flows, 60
nonnegative
cash flows, 147
NPV function, 59
of payments, 71
in today’s dollars, 61
XNPV function, 60–61
zero value, 63, 64
NPVauditscenario.xlsx fle, 143
NPVaudit.xlsx fle, 122
NPVspinnerstemp.xlsx fle, 231
NPV.xlsx fle, 141
null hypothesis, 471
accepting, 473
#NUM! error messages, 61, 67, 99,
393
for no IRR, 64, 65
number
argument, 42
Number Filters option, 400
Number format for time formulas,
106–107
number of periods, 70
number of times
argument, 41
Numberdv.xlsx fle, 321
numbers
extracting into separate cells,
44–45
position in range, 33
ranking, 578
text strings, converting from,
42, 43
Numbers.xlsx fle, 155, 162
numerical data
counting cells with, 154
fltering, 399–400
grouping, 377
icons, associating with, 19
ranking, 344–345
sorting, 215
treating as numbers, 310
validating, 321–322
visually distinguishing, 19
O
Obama, Barack, 461
odds, translating probabili
581
Offce button, 5
OFFSET function, 163–175
cells, extracting data fro
167–168
changes in data location, 1
dynamic updates with, 172,
171–173
evaluating parts of, 169
last number in column, fndi
170
for left-hand lookups, 165
MATCH function with, 165–16
in PivotTables, 378
syntax, 163–164
Offsetcost.xlsx fle, 166, 1
Offsetexample.xlsx fle, 164
Oilwell.xlsx fle, 596
old text
argument, 41
One warehouse
worksheet, 29
one-way analysis of varianc
471–476
one-way data tables.
See al
tables; two-way data tabl
for customer valuation, 603
for option pricing, 596–597
for resampling data, 585
setting up, 568
simulating craps in, 577
OnePrice
worksheet, 641
Onewayanova.xlsx fle, 472
operating costs
forecasting, 448–451
monthly variation in, 428
vs. production, 425–428
operating income, computing
Operations Research: Applic
and Algorithms
(Winston), 6
optimal bids, calculating, 5
optimal solutions, 244
multiple, 257
to product mix model, 251
optimal solutions

690
optimization.
See also
Solver
defned, 241
linear optimization problem, 243
solution engines, 243–244
solution types, 244
optimization models, parts of, 241
optimization problems
nonlinear optimization problems,
288–290
nonsmooth optimization
problems, 291
option
argument of AGGREGATE
function, 98
option buttons, 230, 237
linking to cells, 237
option pricing
Black-Scholes formula, 548,
587–599
for capital budgeting and
fnancial decision making,
596–598
Optionbuttons.xlsx fle, 237
Optionfgures.xlsx fle, 588
options.
See
stock options
Options dialog box Use Automatic
Scaling option, 277
OR operator
adding Boolean arrays and, 656
with DSUM function, 390
evaluation of, 200
in IF formulas, 93
order quantity, discounts on, 88–89
ordering costs
assumptions about, 613
minimizing, 607–609, 614–616
Original Model
worksheet, 122, 143,
231
Original
worksheet, 221
outliers, 340
common factors of, 507
effciency and, 429
in forecasts, 504–505
formatting conditionally, 341–342
in multiple regression analysis,
451, 461
outline form PivotTables, 354
Outline Form
worksheet, 354
Outline group Subtotal command,
417
outputs of interest, sensitivity
analysis on, 127–136
P
p-values
alternative hypothesis and, 471
independent variables, dropping,
460
interactions and, 464
low values, 484
in multiple regression analysis,
450
null hypothesis and, 471
signifcance of, 456, 465–466, 479
Page Setup dialog box, 582
parameter values, 122
Parameters dialog box, 494
Paste Link option, 113
Paste List button, 17
Paste Name dialog box, 15, 17
Paste Preview dialog box, 669
Paste Special command, 111–115
live preview, 8
pasting only values, 111–112
Paste Special dialog box, 111–112
Divide option, 114
Operations area, 113–114
Paste Link option, 113
Skip Blanks option, 444
Transpose option, 112–113, 444,
649
Values option, 112
Paste Special Divide Before
worksheet, 113
Paste Special Transpose
worksheet,
112
Paste Special Value
worksheet, 111
Pastespecial.xlsx fle, 111
payback period, 135
calculating, 37–38
Paymentgs.xlsx fle, 138
payments
balloon payments, 73
at beginning or end of period, 71,
73, 74
future value of, 69–71
loan payments, calculating, 72–74
number of, 72
number of periods of, 76
present value of, 71, 73
on principal, calculating, 73–74
sign conventions, 70
type of, 70
payoffs
for call options, 588
for put options, 589
peakedness of data, 339
penalties with Evolutionary Solver,
297–300
#per
argument, 70
in FV function, 71
in IPMT function, 73
in PMT function, 72
percentage errors, standard
deviation of, 542
percentage return on port
89–90
PERCENTILE function, 342–
percentile rankings, 342–
PERCENTILE.EXC function, 6
342–343
PERCENTILE.INC function, 3
percentiles
icons, associating with, 1
for normal random variab
531–532
Percentile.xlsx fle, 342
PERCENTRANK function, 342
PERCENTRANK.EXC function,
342–343
performance, automatic
recalculation and, 131
periodic payments, calcul
72–74
periods
number of, calculating, 7
payback periods, 135
payments made at end or
beginning of, 70–71, 73
in PV function, 70
Phoneloyalty.xlsx fle, 60
Pinevalley.xlsx fle, 27
PivotCharts, 361–362
chart types, changing, 3
Column Graphs option, 36
editing, 368
Line Graph option, 361
PivotTable Field List, 35
PivotTable Options dialog b
PivotTable Tools Design o
PivotTable Tools Options c
356
PivotTables, 4, 327, 349–
blank rows, adding, 363
calculated felds, 374–37
calculated items, 377
Clear Filter command, 35
Column Labels zone, 353
conditional formatting f
364–365
creating with PowerPivot
670–672
vs. database statistical f
387
data source, changing, 3
description of, 350–351
drilling down in, 377
dynamic range names in, 1
empty cells, replacing, 3
external data source for
extracting entries, 378
felds, 352
felds, arranging, 671
optimization

691
PivotTables
continued
) (
felds, collapsing and expanding,
356–357
felds, pivoting, 355
felds, sorting and fltering, 357–
361, 372
formatting, changing, 355–356
GETPIVOTDATA function, 377–378
grouping items in, 376
grouping results, 367
headings, 351
layouts, 354
locating and returning data,
377–378
percentages, displaying data as,
370
PivotCharts, summarizing with,
361–362.
See also
PivotCharts
PowerPivot add-on, 5
removing row labels from, 367
report flters, 362, 375–376
Report Filter zone, 353
Row Labels zone, 352
scenario results as, 146
Show Field List command, 353
slicers.
See
slicers
sorting data by two variables, 368
standard deviations in, 380
styles, 356
totals, hiding, 363
updating, 365
Values zone, 353
variables, influence on each other,
369–371
zones, 352–353
Pivotwithslicers.xlsx fle, 672
plus sign (+), 232
pmt
argument
in FV function, 71
in PV function, 70
PMT By Solver
worksheet, 276
PMT function, 72–74
accuracy of, 275–277
syntax, 72
PMT
worksheet, 75
point forecasts, 541.
See
also
forecasts and forecasting
probability statements about, 541
point spreads, setting, 281–285
POISSON function, 524
Poisson random variable, 523–526
time between arrivals, 525–526
POISSON.DIST function, 524
Poisson.xlsx fle, 524
poker, probability of getting a
particular hand, 577–579
population standard deviation, 340
population variance, 340
populations, 291
portfolio insurance, 90
portfolios, percentage return on,
89–90
positive values, data bars for, 193
positively skewed histograms, 331
power curves, 424, 435–440
ft of, 438
production costs as function of
units produced, 435
properties of, 437
sales as function of advertising
expenditures, 436
slope of, 435
steepness of, 438
time for production as funtion of
cumulative production, 436
power demand curves, 626
Power Pricing
(Dolan and Simon),
625
Powerexamples.xlsx fle, 435
Powerft.xlsx fle, 628
PowerPivot, 5, 665–674
DAX functions, 673–674
downloading, 665
importing data into, 666
inserting data in, 666
options for, 665
PivotTables, creating, 670–672
reading data into, 665–670
slicers with, 672
PowerPivot Design tab, 670
PowerPivot Field List, 670–671
Slicers Horizontal and Vertical
felds, 672
PowerPivot Home tab, 666, 667
Paste Preview dialog box, 669
PivotTable option, 670
PowerPivot tab, 665
Excel icon, 669
fx button, 673
PowerPivot window Design option,
670
PowerPivot Window button, 666
powers of sales, 657
PPMT function, 73–74
syntax, 74
precedence of conditional
formatting rules, 190–191, 199
precedents
with data on multiple worksheets,
125
defned, 121–122
tracing, 124–125
Predicting Presidential Elections and
Other Things
(Fair), 458
prediction equations, 502
equation 1, 466
equation 2, 483, 485
ft of, 456, 460
interactions and, 485
predictions.
See also
forec
forecasting
accuracy of, 428–429
presidential elections, 45
sales, 453–457
of time series future value
two-factors with replicati
480–485
presidential elections, pre
458–461
Pressdata.xlsx fle, 273
price
and demand, nonlinear
relationship, 463
of products.
See
product p
proft-maximizing price.
See
proft-maximizing pric
price bundling, 640–642
price cuts, price elasticit
price elasticity
defned, 626
unknown, 635
Priceads.xlsx fle, 468
pricing products.
See
produ
pricing
principal payments, 73–74
cumulative, 75
Print menu, 6
printing comments, 582
pro forma statements
debt as plug, 93–97
defned, 94
probabilities
with Beta random variable,
538–539
of lognormal random variab
with parameters Mean and
Sigma is less than or equa
x
, 547
resampling data for, 583–5
that
X
equals
a
and always e
0, 528
translating to odds, 581
probability density functio
511–512
of continuous random variab
527–528
exponential, 525
height of, 512
normal, 560
probability mass functions, 5
probability of occurrences
exponential probabilities,
in short interval, 523–526
probability of occurrences

692
probability of success
calculating, 516–518
of failuers
th success,
before
s
520
of greater than
, 518
or less than
x
of less than
, 519
or equal to
x
with small sample size, 518–519
probability statements from point
forecasts, 541–544
Prodmix.xlsx fle, 245
production
batch sizes, optimizing, 609–611
economic order batch size model,
610
monthly variation in, 428
negative, 253
vs. operating costs, 425–428
setup costs, 610
simulating levels of, 554–556
production costs
computing, 643–644
as function of units produced, 435
variable, 625
product mix optimization problems,
245–254
changing cells, 247
constraints, 245, 247
feasible solutions, 251
infeasible solutions, 252
SUMPRODUCT evaluations,
246–247
target cells, 247
product pricing
bundling, 640–642
demand curve and, 625
factors affecting, 625
nonlinear pricing, 639–646
proft-maximizing price, 631–633,
635–638, 641–642
quantity discounts, 639
for subjective demand, 635–638
with tie-ins, 631–634
two-part tariffs, 640
with variable cost and three
points on demand curve,
635–638
product sales. fnding, 35
Productlookup.xlsx fle, 227
Productpaste.xlsx fle, 115
products
cumulative value associated with,
642
demand curve, 625
fxed fee for, 643–644
price charged for, 642–644.
See
also
product pricing
unit value, 629
Productsalespaste.xlsx fle, 115
Product.xlsx fle, 31
proft
computing, 128, 642, 644
confdence interval for, 557–558
formula for, 247
maximizing, 245–252
transaction cost impact on, 93
Proft
worksheet, 125
proft-maximizing price
fnding, 631–633, 635–638,
641–642
two-part tariff price, 642–646
proftability
of customers, 601–605
customer value and, 603
loyalty incentives and, 603–605
price bundling and, 640–642
product pricing and, 625
tie-ins and, 631–634
Proforma.xlsx fle, 94
project durations, modeling,
538–539
project selection problems, 267–273
additional constraints, 270–271
changing cells, 268
constraints in, 268
linear model, 268, 270
target cells, 268
projects
scale of, 66
value, adding, 66
Protect Sheet command, 595
Protect Sheet dialog box, 595
Ptable
worksheet, 358
Ptableexample.xlsx fle, 371, 374
Ptablepartsdata.xlsx fle, 380
Ptcustomers.xlsx fle, 358
P23_2.xlsx workbook, 183
purchases, consumer surplus, 641
pure bundling, 641
put options, 89–90.
See also
stock
options
cash flows from, 588–589
defned, 587
graphing, 589
pv
argument
in FV function, 71
in PMT function, 73
PV function, 69–71
syntax, 69
Q
Qd.xlsx fle, 645
quadratic demand curves, 635
qualitative factors
modeling, 454
in multiple regression, 453–462
quantitative independent v
453
Quantity Discount
workshe
quantity discounts, 639
computing with Solver, 6
modeling, 88–89
Quarterly.xlsx fle, 239, 4
queries
editing, 315
refreshing and updating, 3
query results, formatting
question mark (?) wildcar
character, 153
Queuing Data
worksheet, 6
queuing systems
conditions of, 620
infnite lines, 620
interarrival time, mean a
standard deviation, 619
queuing template, 621–62
servers, number of, 619
service capacity, 623
service time, mean and s
deviation, 620
steady state, 620
time in, factors affecti
variability and, 621
queuing theory, 619–624
Queuingtemplate.xlsx fle, 6
Quick Access Toolbar, 2–3
position of, 3
quotation marks (“ “)
for array text, 656
for text in criteria, 15
for PivotTable headings, 3
for text, 34, 92
R
R-squared values, computi
RAND function, 550–551
recalculation of numbers
=RAND() formula, 550–551
RANDBETWEEN function, 566
576
resampling with, 583–585
Randdemo.xlsx fle, 550
random numbers
generating, 550–551
ranking, 578–579
recalculating, 551
random variables, 509–513
Beta random variable, 53
538–539
binomial, 515–517, 559–5
continuous, 511
discrete, 509–510
expected values, 510
probability of success

693
random variables
continued
)
(
forecast errors and, 543
hypergeometric, 519–520
independent, 512–513
lognormal random variables,
545–548
mean and standard deviation of,
552–553
mean of, 510
negative binomial, 520–521
NEGBINOM.DIST function, 520
normal, 527–534
Poisson random variable, 523–526
probability density functions,
511–512
simulating values of, 551–553
standard deviation of, 510–511
uniform random variables, 563
values of, 509
variance of, 510–511
Weibull random variable, 535–537
random variation, smoothing, 488
randomization in ANOVA analyses,
478
randomized block models, 477,
478–479
Randomized Blocks
worksheet, 478
randomness of forecast errors, 507
range
argument
of COUNTIF function, 150
of SUMIF function, 157
range lookup
argument of
VLOOKUP function, 21–22, 24
range names, 9–19, 159.
See
also
named ranges
for cell above active cell, 18–19
comments for, 13
disallowed letters, 19
displaying, 10
dynamic, 170–171
editing and deleting, 13–14
in formulas, 14–15, 153
formulas, applying to, 17
for rectangular cell ranges, 10
linking, 89
Name box, creating with, 10–11
new data in, 218
for noncontinguous cells, 11
pasting into worksheets, 17
permitted name types, 19
referencing, 181–182
scope of, 15–16
spaces and underscores in, 19
symbols in, 19
undefned, 99
references in worksheets, 633
range of cells.
See
cell ranges
range of data set, 340
range_n
argument of COUNTIFS
function, 150
range1
argument of SUMIFS
function, 158
ranges, position of number in, 33
RANK function, 344
RANK.AVG function, 344
RANK.EQ function, 227, 344,
578–579
syntax, 578
ranking numbers, 344–345,
578–579
ranking projects on IRR, 66
rate
argument, 60–61
in FV function, 71
in PMT function, 72
in PV function, 70
RATE function, 75–76
rate indexes, 78
rate of loan, 75–76.
See also
interest
rate
ratio-to-moving-average
forecasting method, 497–500
Ratioma.xlsx fle, 497, 498
raw materials
for production, 246
usage calculations, 246–247
Razorsandblades.xlsx fle, 631
real options, 596.
See also
stock
options
realigning data, 112–113
Reapply command, 407
reciprocal cost allocation method,
85
records, database, 396
#REF! errors, 99
reference
argument of OFFSET
function, 164
reference cells, 163
references to cell ranges, 163–175.
See also
cell ranges
Refresh command, 365
Refresh Control settings, 315
refunds, counting, 160
regression analysis.
See
multiple
regression
Regression dialog box, 448
regression equations.
See
also
prediction equations
validating, 459
regression toward the mean,
445–446
Regression
worksheet, 449, 456
Regressionfnal
worksheet, 460
Reichheld, Frederick, 601
reinvest rate vs. borrow rate, 66–67
remainders, yielding, 99–100
Remove Arrows button, 122
Remove Duplicates command, 2
Remove Duplicates dialog bo
405–406
Remove From Quick Access Too
command, 3
Rename button, 2
reorder point
back-order case, 614–615
defned, 613
lost-sales case, 615–616
95 percent service level, 6
616–618
safety stock level, 615
two-bin policy, 618
uncertainty and, 616
variables affecting, 614
Reorderpoint_backorder.xlsx f
614
Reorderpoint_lostsales.xlsx f
Replace All command, 45
Replace Current Subtotals o
418
REPLACE function, 41
Report Filter zone, 353
report flters, 362, 372, 37
Report Layout option, 354
reports, importing data fro
REPT function, 41, 46–47
Required Bounds On Variable
check box, 291
Resampleyield.xlsx fle, 583
resampling, 583–586
mean of resampled data, 58
replaying, 585
residuals
calculating, 457
examining, 506–507
random, 507
Resize Table command, 220
resource usage
calculating, 246–247
for production, 246
result cells, 143
choosing, 145
results
editing, moving, deleting, 6
moving, 111–112
returning in one or multipl
647–648
selecting display range, 6
retained earnings, beginnin
ending, 96
retention rates, customer, 6
Retire
worksheet, 278
retirement funds, relations
among contributions,
withdrawals, and return, 2
retirement funds, relationship among contributions

694
retirement planning, using Solver
for, 277–279
revenue
calculating, 99–100, 643–644
computing, 128
determining by month, 373
modeling growth of, 431–434
summarizing by two variables,
372
revenue trends, estimating with
array formulas, 657–660
Reverse Icon Order option, 197
Reversed.xlsx fle, 175
ribbon
customizing, 1–2
PowerPivot tab, 665
RIGHT function, 40, 45
Right Way
worksheet, 189
risk, decision making and, 557
risk-free rate, 589
increases in, 593
Rock.xlsx fle, 150–151, 154
Roosevelt, Theodore, 461
rounding errors in IPMT function, 74
ROW function, 99–100, 182, 207
Row Inserted
worksheet, 180
Row Labels zone, 352
row location, returning, 33
row numbers, returning, 182
row of reference, 99
rows
adding together, 387–388
errors in, ignoring, 98
height, increasing, 231
hiding, 133, 193
inserting, totaling values and, 180
listing cell ranges in, 649–650
with multiple criteria, flagging,
158
new, in tables, 219
referencing with INDEX function,
30
referring to by name, 84
subsets of, 224
transposing data to columns,
112–113
visibility of, 91
rows moved
argument of OFFSET
function, 164, 167
RSQ function, 504
R2 values, 428
correlations and, 445
interpreting, 451
rules for conditional formatting,
186–187.
See also
conditional
formatting
creating, 187, 190
criteria for, 192
deleting, 187, 190, 199
editing, 190, 199
managing, 187, 189–191
order of, 199
precedence of, 190, 199
Stop If True option, 205
top/bottom rules, 187–188
viewing, 189
Russo, Marco, 665
S
S curves, 488
safety stock levels, 615
service levels and, 616
Sagarin, Jeff, 307
Sagarin ratings, 579
Salaries.xlsx fle, 664
sales
computing, 95
deseasonalizing, 498
effects on, checking for, 472–473
as function of advertising
expenditures, 436
predicting, 453–457, 480
seasonality of, 497–498
sales forecasts, 497–500.
See also
forecasts and forecasting
with ratio-to-moving-average
method, 499–500
Sales > 90 units dollars > $280
worksheet, 401
Sales In 2005 And 2006
worksheet,
402
Sales.xlsx fle, 394
sample standard deviation, 339–340
sample variance, 339–340
sampling with replacement, 583
Sandp.xlsx fle, 198, 205
Satissuper.xlsx fle, 206
scale of projects, IRR and, 66
Scalesiconsdatabars.xlsx fle, 191,
194, 195
Scatter Chart option, 423
scatter plots
creating, 425
for linear demand curves, 627
modifying, 426
for power curves, 437–438
for time series, 487
for trend curves, 432
Scatter With Only Markers option,
425
Scatter with Smooth Lines and
Markers option, 487
Scatter With Straight Lines option,
627
Scenario Manager, 230–231
for sensitivity analysis
starting, 144
Scenario Manager dialog b
145–146
Merge button, 147
Show button, 146
Summary option, 145
Scenario PivotTable Repor
146
Scenario Summary dialog b
145–146
Scenario Summary option, 1
Scenario Summary reports
Assumption cells, hiding a
showing, 147
Current Values column, 1
Scenario Summary
workshee
Scenario Values dialog bo
scenarios, 145–149
creating, 230–231
input data, 144
listing, 145–146
merging into one workboo
Monte Carlo simulation, 1
showing, 146
summary report, 144, 145
Scenario PivotTable Repo
option, 146
scheduling, Solver optimi
255–259
Scholes, Myron, 587
Scope arrow, 13
scroll bar controls, 230, 23
SEARCH function, 41
seasonal indexes, 491, 65
creating, 660
defning, 497–498
estimating with ratio-to
average method, 498–500
estimating with Winters’
493
updating, 494
seasonality.
See also
sea
indexes
defned, 491
estimating with array fo
657–660
modeling, 454–455
predicting effect of, 45
removing from estimates, 4
smoothing, 488–489
SECOND funtion, 108
2nd Table
worksheet, 373
seconds (time)
displaying, 107
extracting from times, 1
retirement planning

695
Select A Solving Method list,
243–244
Simplex LP, 250
Select All button, 133
select all data in a range, 114
Select Unlocked Cells option, 595
selecting
cell ranges, 210
lists items, 238
with option buttons, 237
sort criteria, 211
table specifers, 225
semicolons, breaking data at, 46
sensitivity analysis, 127–136
of queuing system components,
623
Scenario Manager for, 143–147
sequence of cash flows, one change
in sign in, 65
sequence of times, entering, 109
sequencing problems, solving, 303
serial format dates, 50–51
serial numbers
for date and time, 105
for times, 105
Series dialog box, 555–556
servers (in queuing system), number
of, 619, 622, 623.
See also
queuing systems
service times.
See also
queuing
systems
mean and standard deviation of,
620, 622
stationary, 620
Servicelevelreorder.xlsx fle, 616
Set Cell, defned, 137
Set Objective box, 248
Set Values Do Not Converge
message, 253
Set Values Do Not Converge
worksheet, 253
Sharedata.xlsx fle, 19
Sheetnames.xlsx fle, 15
shipping costs, calculating, 262
shortage costs
assumptions about, 613
minimizing, 614–616
Show Bar Only option, 192
Show Field List command, 353
Show Formulas command, 121
Show/Hide Comments command,
581
Show Icon Only option, 197
sign changes, 507
Signif
worksheet, 472, 475
Simon, Hermann, 625
Simplex LP engine, 243, 287
for product mix problems,
250–251
simplex method, 251
simulation.
See also
Monte Carlo
simulations
of values for stocks, 570
Singers.xlsx fle, 227
single-row lookup ranges, 34
single warehouse problem, 291–293
SKEW function, 339
skewed left histograms, 332
skewed right histograms, 331
skewness, 339
mean of data and, 345
slashes (/), 220
slicers, 4, 351, 353, 363
creating, 375–376
with PowerPivot, 672
resizing, 672
Slicers
worksheet, 375
SLOPE function, 429
slope of least-squares lines, 429
SMALL function, 36, 344
smallest values, associating with
data bars, 191–192
smoothing constants, 492
estimating, 493–494
smoothing methods, Winters’s
method, 491–495
solution engines, 243–244
solutions
feasible, 244, 251
no feasible solutions, 252–253
optimal, 244, 251, 257
Solver
for asset allocation problems,
571–572
binary changing cells, 267
for distribution problems,
261–265
errors in model, 253
Esc key, 289
feasible solutions, 244
for fnancial planning, 275–280
forecast parameters settings,
503–504
functionality of, 241
installing, 243
linear problems, 251
mortgage payments, determining
with, 275–277
new capabilities, 5
no feasible solutions, 252–253
optimal solutions, 244
Parameters dialog box, 494
price, constraining, 637
product mix problems, 245–254
proft-maximizing price, fnd
632–633, 637
project selection problems
267–273
for quantity-discount prob
644–645
resolving incorrect proble
previous versions, 243
for retirement planning, 27
running, 243
scheduling problems, 255–25
Select A Solving Method li
243–244
for sequencing problems, 3
service level reorder poin
calculation, 617–618
for single warehouse probl
291–293
solution engines, 243–244
for sports teams ratings, 2
tolerance settings, 271–272
for transportation problem
261–265
for two warehouses problem
293–295
very large and small numbe
and, 277
Weibull random variable par
settings, 536
Solver Options dialog box I
Optimality setting, 271
Solver Parameters dialog bo
247–248
for asset allocation model
571–572
By Changing Variable Cells b
248
changing and target cells,
defning, 248
for Evolutionary Solver pr
297
for proft-maximizing quanti
discounts, 646
Make Unconstrained Variable
Non-Negative check box, 2
253, 257, 572
for maximizing proft, 632, 6
for mortgage payment probl
276–277
for one warehouse problem,
292–293
for product mix problem, 25
for project selection prob
268–269
for reorder point calculat
for retirement planning pr
278
Set Objective box, 248
Set Objective box

696
Solver Parameters dialog box
(
continued
)
for sports teams ratings, 283
for traveling salesperson problem,
304–305
for two warehouses problem, 294
for workforce scheduling
problem, 256
Sort A To Z button, 215
Sort & Filter group
Advanced option, 408
Filter option, 397
Sort button, 211
sort criteria, 210–212
managing, 212
selecting, 211
Sort dialog box, 211
Add Level option, 212
Cell Color option, 212
Cell Icon option, 213
criteria management, 212
Font Color option, 212
not using, 215
Sortday.xlsx fle, 215
Sorted q1
worksheet, 360
Sorticons.xlsx fle, 215
sorting, 209–215.
See also
fltering
by age, 367
alphabetically, 210
A-to-Z order, 210
on cell or font color, 212–213
chronologically, 210, 212, 213–214
criteria, 210
custom sort orders, 214
by gender, 366
on icons, 213
largest to smallest, 360
My Data Has Headers option, 211
numerical values, 215
reverse alphabetical order, 357
smallest to largest, 357
subtotals for, 417–420
on two values, 368
without Sort dialog box, 215
spaces
breaking data at, 46
as column delimiters, 309–310
errors, replacing with, 97–99
inserting, 44
removing from text strings, 40
trimming excess, 42
Sparkline Tools Design tab, 382–383
sparklines, 4, 381–385
automatically updating with new
data, 385
axes for, 383
converting type of, 384
data for, 381–383
irregularly spaced data, 383
modifying, 382–384
win/loss sparklines, 384–385
Sparklines group Line option,
381–382
Sparklines.xlsx fle, 381
special events, forecasting, 501–504
spin buttons, 229, 231–234
anchoring, 232
copying and pasting, 232
creating, 231–232
linking to input cells, 232–233
minimum increment, 233
row height for, 231
shape, changing, 232
sports teams ratings, 281–285,
579–582
changing cells, 281
favorite rating–underdog rating,
580
home-feld edge, 281–282, 284
squared errors, 282, 284
target cells, 281
spread of data, 339–340
square matrices, 662
squared errors, 282–283
standard deviation, 340
estimating, 560
of forecast errors, 480
of forecasts, 542
PivotTables and, 380
of random variables, 510–511
standard error of regression,
428–429
calculating, 457
standard normals, 591
start_date
argument, 51, 52
startdate
argument, 54
Statedv.xlsx fle, 322
States.xlsx fle, 11, 668
Station.xlsx fle, 369
statistical inferences, 583
status bar, 345
STDEV function, 340
STDEV.S function, 340
steady state, quantities in, 620
STEYX function, 428–429
stock indexes, queries about, 316
stock market
moving-average trading rules,
90–93
trends, following, 90–93
stock options.
See also
call options;
put options
abandonment options, 597–598
American vs. European, 588
duration of, 589
exercise (expiration) date, 588
exercise price, 587
implied volatility appro
input values, changes in
option-pricing formula, 5
real options, 596
risk-free rate, 589
value parameters, 589–59
valuing, 592
volatility of, 590
stock prices
bootstrapping, 565–568
downloading, 315–317
downward moves in, 89–90
implied volatility, 546
increases in, 592
median price, predicting
modeling, 545–548
one-year returns, calcul
stock option value and, 5
stock volatility, 590
estimating, 590
Stockcorrel.xlsx fle, 443
Stockprices
worksheet, 32
stocks
average return on, 346
butterfly spreads, 102
European put options, 89
Stock.xlsx fle, 19, 327, 3
Stop If True option, 205
Storesales.txt fle, 666
story problems, solving w
Seek, 139–140
straight-line relationshi
estimating, 423–430
INTERCEPT function, 429
SLOPE function, 429
structure of worksheets, 1
structured references, 22
Styles group Conditional F
arrow, 186
subjective demand, produc
for, 635–638
subsets of data, identify
also
fltering
SUBSTITUTE function, 48
Subtotal command, 417
Subtotal dialog box, 417–
Add Subtotal To area, 41
At Each Change In list, 4
Page Break Between Group
option, 418
Replace Current Subtotal
418, 420
Summary Below Data check b
418
Use Function box, 417
SUBTOTAL function, ignori
Solver Parameters dialog
)
box (
continued

697
subtotals, 417–421
below data, 418
buttons to display, 419
hiding, 363
nesting, 420–421
page break after, 418
removing, 418
SUM function.
See also
summing
with INDIRECT function, 180
sum of squared errors
computing, 438, 503
minimizing, 503–504
sum of squares, 474
sum range
argument
ommitting, 159
of SUMIF function, 157
Sum Up 2nd Digit
worksheet, 651
SUMIF function, 157–158, 654
criteria for, 158–160
criteria rules, 158
Sumifrows.xlsx fle, 161
SUMIFS function, 158, 160–161,
389, 392
Sumindirect.xlsx fle, 178
summarizing data
with array formulas, 654–656
column and row data, 381–385
with database statistical functions,
387–394, 654
with descriptive statistics,
335–348
with histograms, 327–334
with PivotTables.
See
PivotTables
with PowerPivot slisers, 672
with slicers, 4
subtotals, 417–421
summary worksheets, pooling data
in, 182
summing
based on criteria, 157
blank rows and, 180
second digits in set of integers,
651–652
SUMPRODUCT function, 246–247,
256, 262
sumrange
argument of SUMIFS
function, 158
Suppliers.xlsx fle, 240
supply points, 261
total product shipped from,
calculating, 262
support department costs,
allocating, 85
Suzuki, Ichiro, 563
symbols
in range names, 19
ranges of values, identifying with,
186, 195–197
symmetric distributions, 331
symmetry assumption, 560
T
tab order, 2
table range
argument of VLOOKUP
function, 21
table ranges, 129
Table Style Options group Total Row
option, 223
Table Styles option, 221
Table Tools tab, 220–221
Banded Columns option, 221
Banded Rows option, 221
Change Table Name command,
220
Convert to Range command, 220
First Column option, 221
Header Row option, 221
Last Column option, 221
Remove Duplicates command,
220
Resize Table command, 220
Table Styles option, 221
Total Row option, 221
Tableexampletemp.xlsx fle, 217
Tableexample.xlsx fle, 227
Tablemakeupfnal.xlsx fle, 224
Tablemakeuptemp.xlsx fle, 222
Tablepie.xlsx fle, 227
tables, 217–227.
See also
PivotTables
autocomplete options, 219
autocopying formulas in, 220
banded columns and rows, 221
for chart data, 222
conditional formatting of new
data, 226
creating, 218
design options, 218
duplicates, removing, 220
dynamic data and, 173
flter arrows, 223–224
frst column formatting, 221
header rows, 221, 222
last column formatting, 221
My Table Has Headers option, 218
naming, 218
parts of, referring to, 225–226
renaming, 220
resizing, 220
structured references, 225–226
table formats, 221
table range, converting to normal
cells, 220
table specifers, 225
totals, fltering, 223–224
totals rows, 222–224
Tables group PivotTable opti
Tablestructure.xlsx fle, 22
Tablexnpvdata.xlsx fle, 227
tabs
breaking data at, 46
customizing, 1–2
groups within, 2
renaming, 2
tabular form PivotTables, 35
Tabular Form
worksheet, 354
Taleb, Nicholas, 548
Tapesales.xlsx fle, 174
target cells, 241
in capital budgeting probl
268
in fnancial planning proble
276
in linear problems, comput
250
multiple, 241–242
penalizing, 297, 298–299
in sports teams ratings, 21
theoretical optimal value o
in transportation problems
tax rates, computing, 22–24
Teams.xlsx fle, 334, 468
technology companies, reven
growth of, 433
Test.xlsx fle, 205
text
combining, 43–44
fnding, 41
in IF statements, 92
justifcation of, 42
lowercase, 42
numbers, converting to, 43
quotation marks around, 34
151–152
replacing, 41
spaces, trimming from, 42
uppercase, 42
uppercase and lowercase
conversions, 42
text
argument, 40, 42
text fles
importing, 307–311
importing data from, 666–6
Text Filters command, 397
text functions
CHAR function, 42
CONCATENATE funtion, 41
FIND function, 41
formatting data with, 39–4
& function, 41
LEFT function, 40
LEN function, 41
LOWER function, 42
MID function, 40
text functions

698
text functions
continued
)
(
REPLACE function, 41
REPT function, 41
RIGHT function, 40
SEARCH function, 41
syntax, 40
TRIM function, 40
UPPER function, 42
VALUE function, 42
Text Import Wizard, 307–309
Treat Consecutive Delimiters As
One option, 310
text strings
characters, extracting from, 42–44
characters in, calculating, 41
converting to times, 107
k
characters, returning, 40
numbers, converting to, 42
repeating, 41
spaces, removing from, 40
Text That Contains option, 189
Text To Columns command, 168
Text To Columns Wizard, 45–47
text to fnd
argument, 41
3 Arrows (Colored) icon set option,
196
three-color scales, 193–194
three-dimensional formulas,
117–119
Threetimes.xlsx fle, 207
tie-ins, 631–634
Tiled view, 412–413
time and time functions, 105–109
computations with, 106–107
current time, displaying, 107
and dates in same cell, 106
effect of, 478
entering in cells, 105–106
extracting time units from, 108
formats for, 105–106
as function of cumulative
production, 436
length of time worked,
computing, 108
seconds,
displaying, 107
serial numbers for, 105
text strings, converting to, 107
time intervals, creating, 109
time of day, 107
total hours worked, computing,
108
time between arrivals, 525–526
time differences, calculating,
106–107
time format
displaying seconds, 107
h:mm, 108
TIME function, 107
time intervals, creating, 109
time series, 487–489
characteristics of, 491
forecasting future values with
ratio-to-moving-average
method, 498–500
forecasting future values with
Winters’s method, 491–495
graphing, 487
parameter defnitions, 491–492
seasonality of.
See
seasonal
indexes
trend of, 497
time unit
argument, 54
timetext
argument of TIMEVALUE
function, 107
TIMEVALUE function, 107
Time.xlsx fle, 105
To Value, defned, 137
TODAY function, 51, 107, 189
today’s date, displaying, 51
today’s time, displaying, 107
toggle switches, check box controls
for, 234–236
Tolerance setting, 271
Tool tabs, 2
Top/Bottom conditional formatting
rules, 187–188
Top/Bottom Rules option, 186, 187
Top5.xlsx fle, 207
Top half
worksheet, 360
top row, freezing in place, 91
Top 10 cus
worksheet, 359
Top 30 $s With Hallagan Or Jen
worksheet, 405
total assets, computing, 97
total hours worked, computing, 108
total liabilities, computing, 97
Total Row option, 221
Total Wages
worksheet, 648
totals
fltering, 223–224
hiding, 363
totals rows, 222–224
Toysrusformat.xlsx fle, 205
Toysrustrend.xlsx fle, 657, 663
Toysrus.xlsx fle, 161
Trace Dependents command,
121–123
Trace Precedents command, 121–
122, 124–125
transaction costs, impact on profts,
93
Transactiondata.xlsx fle, 175
transactions, median size of,
660–661
transportation problems, 261–265
changing cells, 261
constraints, 261
demand constraints, 263
demand points, 261
linear models, 261, 263
shipping costs, calculat
supply constraints, 262–
supply points, 261
target cells, 261
total product received,
calculating, 262–263
total product shipped, c
262
Transport.xlsx fle, 261
TRANSPOSE function, 649–
Transpose
worksheet, 649
transposing data from col
to row and row to colum
112–113
Traveldata.xlsx fle, 366
traveling salesperson pro
(TSPs), 303–305
total distance traveled, 3
Treat Consecutive Delimit
option, 310
TREND function, 461–462, 6
Trendline option, 424
trendlines and trend curv
calculation of, 427
centered moving averages
to, 499
decimal places to displa
errors and residuals, 42
exponential, linear, and p
424
exponential trendlines, 4
formatting options, 426
four-quarter moving aver
488–489
intercept of, 428
least-squares lines, 427
linear, estimating, 423–
power curves, 435–440
production vs. operating c
425–428
for revenue growth, 431
S curves, 488
trends, estimating with a
formulas, 657–660
trends of time series, 49
defned, 497
estimating with ratio-to
average method, 498–500
estimating with Winters’
493
updating, 494
trial-and-error searches, 2
TRIM function, 40, 42
TRIMMEAN function, 345
text functions (
continued
)

699
Trimmean.xlsx fle, 344
trimmed means, 344–345
trimming excess spaces, 42
Tsp.xlsx fle, 303
Tufte, Edward, 381
two-bin policy, 618
two-color scales, 194–195
two-factor ANOVA
with interaction, 484
with replication, 480–481
Two-Part Tariff
worksheet, 642
two-part tariffs, 640
determining, 642–646
two warehouses problem, 293–295
Two warehouses
worksheet, 293
two-way analysis of variance,
477–486
Two Way ANOVA No Interaction
worksheet, 481
Two Way ANOVA with Interaction
worksheet, 484
two-way ANOVA without
replication, 478
two-way data tables, 555–556.
See
also
data tables
bids, simulating in, 562
for proft-maximizing two-part
tariffs, 644
Twowayanova.xlsx fle, 478, 481
type
argument
in FV function, 71
in PMT function, 73
in PV function, 70
U
uncertain events, modeling,
549–558
uncertainty
in future investment returns,
estimating, 565
reorder point and, 616
underscore (_) in range names, 19
Unemployment.xlsx fle, 334
Unfreeze Panes command, 91, 234
Unhide Columns command, 133
Unhide command, 193
Unhide Rows command, 133
uniform random variables, 563
Unique Name Product Location
worksheet, 407
Unique Records Only option, 409
Unique.xlsx fle, 664
unit cost (UC), 625
nonlinear, 639–640
unit value, approximation of, 629
units sold
averaging, 390
summing, 654–655
unsorted values in lookup range, 34
updates, dynamic, 171–173
UPPER function, 42
USC.xlsx fle, 544
Use A Formula To Determine Which
Cells To Format option, 200–
202, 341
Use An External Data Source option,
351
Use Automatic Scaling option, 277
Use First Row As Column Headers
option, 668–669
user forms, accessing, 229
User Forms menu, 232
V
Valentine.xlsx fle, 554
validation points, 459
valuation analyses, modeling
growth, 431–434
#VALUE error messages, 99, 393,
652
Value Field Settings dialog box, 370
Number Format option, 355
Show Values As setting, 373
summary functions in, 366
VALUE function, 42, 43
value ranges, counting values in,
650–651
values.
See also
cell values; numbers;
numerical data; percentiles
changing with spin buttons, 231
color coding, 198–199
conditional tests on, 88.
See
also
IF statements
deseasonalizing, 498
expected values, 510
and formulas, toggling between,
121
moving, 111–112
probability mass function of, 517
values
argument, 60–61
Values zone, 353
Van Exel, Nick, 308
VAR function, 340
variable costs, 428
computing, 128
of production, 625
variables
correlations among, 441–446
dependent and independent, 423
dummy variables, 454–458
estimating exponential
relationships among, 431–434
estimating straight-line
relationships among, 423–430
estimating trend relations
among, 435–440
indicator variables, 502
influence on each other, 369
random variables.
See
rand
variables
relationship among multipl
independent variables and
dependent variable, 447–4
variance of random variable
510–511
Varianceanalysis.xlsx fle, 2
VAR.S function, 340
Verizondata.xlsx fle, 174
Verizonindirectdata.xlsx fl
Verizon.xlsx fle, 175
vertical lookups, 21
Visible Cells Copied
worksh
Visible Cells Only option, 3
VLOOKUP function, 21, 36, 1
fnding team ratings with, 5
#N/A errors and, 97–99
for simulated card draw, 57
syntax, 21–22
volatility, 590
estimating, 590, 593–594
implied volatility, 593
increases in, 593
option pricing and, 597
Volatility.xlsx fle, 598
W
Wade, Dwayne, 579
wages, computing with array
formulas, 648–649
Waggoner, Rick, 549
waiting in line.
See also
qu
systems
calculating, 621–623
factors affecting time wai
619–620
Walmartdata.xlsx fle, 500
Walmartrev.xlsx fle, 99–100
Warehouseloc.xlsx fle, 291
Watch Window, use of, 121
web queries, built-in, 315–
Webqueries.xlsx fle, 313, 3
WEEKDAY function, 53, 202–20
weekend
argument, 52
weekend dates, formatting
conditionally, 202–203
Weekendformatting.xlsx fle, 2
205
Weibull random variable, 53
alpha parameter, 536
beta parameter, 536
density, 537
Weibull random variable

700
WEIBULL.DIST function, 535, 537
WEIBULLDIST function, 537
Weibullest.xlsx fle, 535
West.xlsx fle, 411
What If Analysis, 129, 556
What-If Analysis group Goal Seek
button, 138
Which Project
worksheet, 66
whole numbers, validating, 319–320
width
argument of OFFSET function,
164, 167
wildcard characters
asterisk (*), 34, 152
in criteria, 152–153
question mark (?), 153
win/loss sparklines, 384–385
Win Loss
worksheet, 384
Window group Arrange All option,
412
Windows Azure Datamarket, 666
Winston, Wayne, 316, 609
Winters’s method, 491–495
initializing, 492–493
smoothing parameters, 492
Within Groups MS, 475
Word documents
importing, 307
saving as text fles, 308–309
workbook scope names, 15–16
workbooks
navigating, 353
range names, displaying, 10
scenarios, merging in, 147
viewing in tiled format, 412
worksheets, inserting, 118
WORKDAY.INTL function, 6, 52
workdays
counting, 51–53
defning, 52
WORKDAY(start_date,#days,
[holidays]) function, 51–52
worker assignment problems,
297–300
workforce scheduling problems,
255–259
changing cells, 255
constraints, 256
target cells, 255
worksheet calculation modes,
Automatic, 131
worksheet FV, 72
worksheet Nper, 76
worksheet PMT, 73
worksheet PV, 70
worksheet scope names, 15–16
worksheet Sheet1, 81
worksheets
consolidating data in, 411–415
controls, adding to, 229
copying, 190
copying data into, 465
creating, 399
default number of, 118
duplicating formulas among, 118
inserting, 118
listing entries from other
worksheets, 179
looking up values in, 21–28
protecting from changes,
594–596
range name references
in, 633
range names, applying to, 17
selecting, 133
setup, similar, 117–118
structure of, 121
summarizing data across, 1
Worldball.xlsx fle, 285
worst-case scenarios, cal
143–147
Wright-Patterson Air Forc
439
X
XIRR function, 66–67
syntax, 66
XIRR
worksheet, 66
XNPV function, 60–61
XY charts
creating, 425
labels and titles for, 4
modifying, 426
Y
YEAR function, 53
years, counting, 54
Years Column
worksheet, 3
Yeartodate.xlsx fle, 175
Z
Zappe, Christopher, 316
zones in PivotTables, 352
WEiBULL.DiST function

703
About the Author
Wayne Winston, professor of operations and dec
and an Eli Lilly & Co. faculty fellow, develop
Excel with a comprehensive understanding of sp
years, Wayne has taught Excel modeling to thou
as Microsoft, Eli Lilly, Cisco, eBay, the U.S. A
He has won more than 25 teaching awards. Wayne a
NBA team. His book on math and sports,
Mathlet
University Press. Wayne is a two time
Jeopardy

How To
Download
Your eBoo
Please
:
note
This access code is non-transferable and is void if altered or r
sold or redeemed for cash, credit, or refund.
RVBJZXW
Your access code:
Microsoft® Excel® 2010: Data Analysis and
Business Modeling
To download your eBook, go to
http://go.microsoft.com/FWLink/?Linkid=224345
and follow the instructions.
Thank you for purchasing this Microsoft Press
®
title. Your companion PDF eBook is r
download from O’Reilly Media, offcial distributor o
Your PDF eBook allows you to:
•Search
the full text
Print
Copy and paste
Best yet, you will be notifed about
free updates to your eBook.
If you ever lose your eBook fle, you
can download it again just by logging
in to your account.
Need help? Please contact:
mspbooksupport@oreilly.com
or call 800-889-8969.
Please note: You will be asked to create a
free online account and enter the access
code below.

Back to top