References, Naming, and Advanced Graphicsleeds-faculty.colorado.edu › Donchez ›...
Transcript of References, Naming, and Advanced Graphicsleeds-faculty.colorado.edu › Donchez ›...
Naming, References, and Advanced Graphics 4-1
Chapter 4
References, Naming, and Advanced Graphics
Chapter Outline
4.1 Relative and absolute references
4.1.1 What are References?
4.1.2 The F4 (ABS) key
4.2 Name That Range!
4.2.1 Single range name (the name box method)
4.2.2 Multiple-naming method
4.2.3 Using the naming method to complete the table
4.2.4 Rules and New Name dialog box
4.3 Advanced topics in Naming
4.3.1 Some rules and New Name dialog box
4.3.2 On the scope of name range
4.3.3 Changing or deleting a range name
4.3.4 Changing to range names retrospectively
4.4 Advanced Graphic Methods
4.4.1 Problems for improvement
4.4.2 Editing the Chart Area borders
4.4.3 Other three methods of editing chart elements
4.4.4 Editing the chart titles and axes
4.4.5 Editing the curves and lines
4.4.6 The secondary vertical axis and data labels
4.5 Charts and Tables - advanced topics
4.5.1 Reconnecting table with the chart
4.5.2 Separating the chart without pain
4.5.3 Comparison of the charts
4.5.3 Comparison of the charts
4.5.4 Mathematical Conditions of Profit Maximization
Objectives of this chapter
In the previous chapter, we have encountered some cases we have to use the dollar sign ($) in
the cell address. The first part of this chapter discusses how the dollar sign works. When cell addresses
are used in formulas, it is hard to find what the cell addresses represent. For example, B2 in a formula
may represent output, if B2 is called Output directly, it is much easier to understand. Excel has a
naming method to name B2 Output. The second part of this chart is devoted to Excel naming method.
In the third part of this chapter, we continue discussing how to refine and improve the charts that we
have introduced in the Chapter 3.
Naming, References, and Advanced Graphics 4-2
4.1 Relative and Absolute References
The dollar sign $ is used to lock the cell address. Since a cell address has two components, row
and column, the dollar sign can be applied to either row or column or both or none. Thus, we have four
cases.
4.1.1 What are References?
There are three kinds of cell references: relative, absolute, and mixed references. All refer to
the location of the cells. When you ask a direction to a nearby supermarket, you may be told that you go
two blocks to the West and then turn right and walk one block. Obviously, the direction depends on
where you are standing. If you change your position, the direction changes. However, Excel
remembers the direction and applies it regardless of your position. This is relative reference. If you are
told that the supermarket is located at 1000 Arapahoe Street, then no matter where you are, the address
will not change. The person is referring to you with absolute reference.
Table 4.1a shows the demand schedule of gasoline price and its quantity demanded for the first
quarter of the year. The formulas behind the cells are shown in Table 4.1b either fully or partially below
the table or on the left of the table.
The monthly percentage change of price is
(4.1.2)
(4.1.2) is implemented in column E6:E7. The demand share of gasoline for each month is
∑ (4.1.3)
∑ is a Greek letter for sum. ∑ Dt means the sum of all three months in the first quarter of the year. The
monthly share is calculated in column F5:F7. The formulas for calculation are shown in details in Table
We first enter the basic data in A2:C7 as shown.
Demand of gasoline each month is price times
quantity for that month,
Dt = Pt*Qt, (4.1.1)
where t is month, Pt is the average price of gasoline in
Denver, say, Qt is quantity of gasoline demanded in
that city,
A B C D E F
1 Demand for gasoline
2 US$ m ga US$ % %
3 Price Gas D Chg Share
4 Month P Q P*Q
5 Jan 3.52 24.4 85.9 33.53
6 Feb 3.65 23.5 85.8 3.69 33.48
7 March 3.69 22.9 84.5 1.10 32.99
8 Sum 10.86 70.8 256.2 100.00
9 Avg 3.62 23.6 85.4 2.39
Table 4.1a Relative, absolute, and mixed references
Naming, References, and Advanced Graphics 4-3
4.1b. We assume you know how to enter the formulas in the first row of the table, B5:F5, using the
suggested formula on the right of the table, and enter the sum and the average in rows 8 and 9 using the
formulas suggested in rows 10 to 19. Note that in column E, you start from E6 instead of E5, since B4
is not defined. You then use the copy command to complete the table. We explain why the copying
mechanism works. In this section, all the calculation will be referred to Table 4.1b.
We start from the sums in row 8.
Table 4.1b Relative, absolute, and mixed references
A B C D E F G H I
1 Demand for gasoline
2 US$ m ga US$ % % Absolute
3 Price Gas P*Q Chg Share Formula Reference
4 Month P Q D P D for E6:E7 for F5:F7
5 Jan 3.52 24.4 85.9 33.53 =D5*100/$D$8
6 Feb 3.65 23.5 85.8 3.69 33.48 =(B6-B5)*100/B5 =D6*100/$D$8
7 March 3.69 22.9 84.5 1.10 32.99 =(B7-B6)*100/B6 =D7*100/$D$8
8 Sum 10.9 70.8 256.2 4.79 100.00 =D5*100/D$8
9 Avg 3.62 23.6 85.4 2.39 33.3 =D6*100/D$8
10 B8: =B7+B6+B5 =D7*100/D$8
11 C8: =C7+C6+C5 33.53 =D5*100/$D8
12 D8: =D7+D6+D5 100.45 =D6*100/$D8
13 E8 =E7+E6+E5 #DIV/0! =D7*100/$D8
14 F8: =F7+F6+F5
15 D5: =B5*C5
16 D6: =B6*C6
(1) The formula for the sum of the first quarter price
is given at B10. It indicates that starting from the cell
B8, we add the values in one cell above (B7), two
cells above (B6), and three cells above (B5).
(2)This relative relation is maintained when the sum
in B8 is copied from C8 to F8.
Indeed, this feature of relative reference makes Excel
especially powerful for data analysis.
Steps 4.1a Relative and absolute references
2
1
1
1
2
3
4
5
6
7
9
10
11
12
Naming, References, and Advanced Graphics 4-4
(3) The demand for gasoline in January is given in D5. As
shown in D15, it is the product of January gasoline price (B5,
two cells to the left) and the gasoline quantity demanded (C5,
one cell to the left).
(4) This relation does not change for other months, see row 16.
Thus, you can copy C5 down to D6 and D7.
3
4
(5) The percentage change of price from January
to February is given in E6, and its formula of
calculation is shown in H6.
(6) H6 shows that the percentage change is
obtained by the difference of B6 (third cell to the
left of E6) and B5 (one cell above B6)
multiplied by 100 and divided by B5 (third cell
to the left and one cell above the third cell to the
left). This relation is preserved when E6 is
copied to E7, as shown in the cell formula in H7
5
6
(7) Range F5:F7 shows the share of gasoline demand in the
first quarter. The formula for calculation for January is
shown in I5.
(8) In I5, the share for the January demand in F5 is
calculated by the January demand in D5, two cells to the
left, multiplied by 100, and then divided by the sum in D8,
which is located at two cell to the left and then move, jump
tack, tack, tack, three cells below.
7 8
(9)* The problem is that we have to “fasten” or “lock” the
sum in D8 in the formula so that the sum does not move
when the original formula in F5 is copied down. In Excel, it
is fastened by using the dollar ($) sign, as shown in I5:I7.
This fastening is called the absolute reference.
This is the reason that we have to use the dollar sign.
9
Naming, References, and Advanced Graphics 4-5
Comments on Steps 4.1a Relative and absolute references
(a)In Step (9), note that in I5:I7, the numerator uses the relative reference while the denominator uses
the absolute reference. Hence, when F5 is copied to F6 and F7, the numerator changes but not the
denominator, and the formula gives a correct calculation, as shown in I6 and I7. #
4.1.2 The F4 (ABS) key
Instead of adding $ each time by hand, Excel has a convenient <F4(abs)> key, which is called
the “ABS” key. It toggles between the four references as in Table 4.1c. As an example, enter
any number, say, 20 in A1, and in A2 enter a formula, say =A1 to copy 20 into A2. Click A2, and
press <F2(Edit)> to show the formula. The vertical line in cell A2 flashes. When the vertical line is
near the letters =A2 or on =A2, press <abs (F4)> key once, and the formula will change to $A$1 (both
row 1 and column A are locked). Press <F4> a second time, and the formula will change to A$1 (row 1
is locked). Press <F4> a third time, and we will have $A1 (column A is locked). Press it a fourth time,
and we will go back to the original formula, A1 (none is locked). It is something like the four-step
waltz: both, row, column, and return. The process is shown in Table 4.1c.
(10) On Mix reference Since the cell address consists of a
row letter and a column number, we may fasten either the
column letter, or the row number, or both. In I5:I7, we fasten
both column D and row 8 of cell D8, that is, $D$8.
(11) From Step (4), we know that the problem is that when
F5 is copied down, the cell D8 also moves down from its
relative position to F5. Therefore, all we need to do is just
fasten the row. Thus, in I8:I10, we only fasten row 8 as D$8.
The result should be the same as those in F5:F7.
10
11
(12) On the other hand, if we fasten column but
not row, like $D8 in I11:I13, this is wrong
fastening since D8 still moves down in column
D, as we noted in Step (10). We have wrong
results as shown in H11:H13.
12
Naming, References, and Advanced Graphics 4-6
Table 4.1c The nature of F4(ABS) key
0 F4 Original =A1 None Both row A and column 1 are not locked
1 F4 Press once =$A$1 Both Both row A and column 1 are locked
2 F4 Press twice =A$1 Row Column A is not locked but row 1 is locked
3 F4 Press thrice =$A1 Column Column A is locked but row 1 is not locked
4 F4 Press 4th time Return to the start
4.2 Name That Range!
We can name a single range individually or multiple range simultaneously, and names can be
applied only to the current worksheet (locally) or to the whole workbook (globally). We explain them
in the following sections.
4.2.1 Single range name (the name box method)
The simplest method is to use the name box when only one range (a cell, a vector, or a matrix) is
defined at any one time. For Example, we may name cell D8 as sum, or sumD (since there are four sum
in row 8). Then, $D$8 in column I will be replaced by “sumD.” There are two cases. You replace the
old cell formulas by giving a range (including a cell) a name, or you enter the data and then name the
data when you start using the formula. We explain the second case first.
Using the format of Table 4.1a, we construct the table.
(1)* Enter the data on price P and quantity Q in
B5:C7, as shown. Select B5:B7
(2)Click the name box, B5 moves to the left
corner and is shaded.
(3) Name the shaded range B5:B7 by entering
P directly in the place of B5. Click anywhere
on the worksheet. B5:B7 is now named P.
When B5:B7 is selected, the name box will
show P instead of B5.
Steps 4.2a Single naming method and its use Objective: Name a cell, a vector, or a matrix
1
2 3
Naming, References, and Advanced Graphics 4-7
Remarks on Table 4.2a Single naming method and its use
(a) In Step (1), the range can be only one cell, or a horizontal range.
(b) In Step (9), the same entries in E5:E7 mean that P and Q in E5 recognize that the value of P and
Q in this particular cell are taken from the same row of P and Q where P and Q are named.
Hence, if =P*Q are entered in other rows outside the defined row range, the formula will return
error #VALUE, as Excel cannot find proper entries. #
4.2.2 Multiple-naming method
In the above single name case, we can use the name box and name the range of cells one by one.
Instead, for the connected cells, we may name several ranges at once. We use the following steps.
/“Formulas”/Defined Names, Create from Selection/ (4.2.1)
(4) Select range C5:C7, and click the name
box. C5 moves to the left corner.
(5)Click the name box, B5 moves to the left
and is shaded.
(6) Enter Q in the place of C5, and click
anywhere on the worksheet. C5:C7 is now
named D.
1 4
5
6
(7) Now that P and Q are defined, move the
pointer to D5, and enter =P*Q, which is also
shown in the formula box.
(8) Copy D5 down to D7.
(9)* All the entries in the cell of D5:D7 will be
shown as E5:E7. #
7 8
9
Naming, References, and Advanced Graphics 4-8
Remarks on Steps 4.2b Multiple naming method
(a) In Step (1), the named cells B5:B7 may be non-adjacent to their names A5:A7.
(b) In Step 4.2a, instead of naming P, Q one by one, we may just select range B4:C7 (including the
column titles), and use Steps 4.2b. In this case, select @Top row in Step (2).
(c) After finishing Step (3), click the downward arrow on the right-hand side of the name box, and
make sure the names are included in the box. Click each name in the drop down box, the
corresponding named cells will be shaded. Check whether the cells or ranges are correctly named. #
4.2.3 Using the naming method to complete the table
In Section 4.2.1, we have completed entering B5:D7 of the Table 4.2a below. Enter the titles in rows 1
to 3 for clarity, and follow the 11 steps using the naming method to compute percentage change of
gasoline price (4.1.2) and monthly share of gasoline demand (4.1.3). The calculation is summarized in
Table 4.2a and the detail explanation is given in Steps 4.2c
(1)* We want to name B5 as Jan, B6, Feb, B7,
March. Select A5:B7.
Steps 4.2b Multiple naming method
Objective: name several ranges at once
1
(2)* Enter (4.2.1). The “Create Names from
Selection” dialog box comes out.
Excel automatically check marks “Create names
from values in the” “Left column” box.
(3)* /OK/ The three cells are named
simultaneously.
2
3
Naming, References, and Advanced Graphics 4-9
Table 4.2a Using the naming method to complete the table
A B C D E F G H I
1 Demand for gasoline
2 US$ m ga US$ % %
3 Price Gas PQ= Chg Share Formula Formula for
4 Month P Q D P D for E6:E7 for F5:F7
5 Jan 3.52 24.4 85.9 33.53 =D*100/SumD
6 Feb 3.65 23.5 85.8 3.69 33.48 =(Feb-Jan)*100/Jan =D*100/SumD
7 March 3.69 22.9 84.5 1.10 32.99 =(March-Feb)*100/Feb =D*100/SumD
8 Sum 10.86 70.8 256.2 100.00 =D5*100/D$8
9 Avg 3.62 23.6 85.39 2.39 =D6*100/D$8
10 B8: =SUM(P) =D7*100/D$8
11 C8: =SUM(Q) Name box
12 D8: =SUM(D) D =Sheet7!$D$4:$D$7
13 F8: =F7+F6+F5 Feb =Sheet7!$B$6
14 B9: =B8/3 Jan =Sheet7!$B$5
15 C9: =C8/3 March =Sheet7!$B$7
16 D9 =SUM(D)/3 P =Sheet7!$B$5:$B$7
17 E9: =AVERAGE(E6:E7) Q =Sheet7!$C$5:$C$7
18 B9: =AVERAGE(P) SumD =Sheet7!$D$8
19 C9: =AVERAGE(Q)
20 D9 =AVERAGE(D)
12
4 5
6
78
3
9
11
10
(1) Since, the cells in range B5:B7 was
already named in Steps 4.2b as Jan, Feb,
and March, respectively, we may enter the
percentage change of price (% chg P)
(4.1.2) from Jan to Feb, from Feb to March
as shown by the formulas in G6 and G7.
Steps 4.2c Using names to enter formulas
1
(2) Name P*Q in D5:D7 D (for Demand), using Steps4.2a:
the single naming method.
(3) For practice, find the sum of the three-month prices in
row 8, using the formula shown in B10.
(4)* Copy B8 to C8 and D8. Both C8 and D8 will be filled
with =SUM(P). Change P in C8 to Q and P in D8 to D, as
shown in rows 11 and 12.
(5) To find the demand share, name the total demand in D8
“sumD,” using Steps 4.2a,the single naming method.
3 4
2
5
Naming, References, and Advanced Graphics 4-10
Remarks on Steps 4.2c Using names to enter formulas
(a) In Step (4), since name P consists of three numbers, it can be regarded as a vertical array (a column
vector). Hence, we use formula, =Sum(P), to sum the first quarter prices in B8. Note that, the name
refers to absolute reference. Hence, unlike the non-named case, if B8 is copied to other cells, other cells
will show the same number. To save time, however, we still copy B8 to C8 and D8, and use /F2/ to
change P to Q in C8 and P to D in D8.
(b) In Step (8), note that the average in E9 will ignore the blank cell E5 and the formula does not
include E5 in the calculation.
(c) In Step (11), as can be seen from the Name List, all names are in absolute reference. Thus, the mixed
(6) The formula of the percentage share of
demand (% share D, see (4.1.3)) in F5 is
given in I5, enter the formula in I5 into F5
and copy F5 done to F6 and F7. The
formulas in F5:F7 are shown in I5:I7. All
formulas in the column look alike.
(7) The F column should sum to 100%.
Since the column is not named, you can
sum one by one or use =SUM(F5:F7).
7
6
=F5+F6+F7
(8)* For practice of using names in formulas, we calculate
the first quarter average of price, quantity, demand, and
percentage change in row 9.
(9) First enter the average in B9. Since we already
calculated the sum in row 8, we can use formula B8/3 as in
B9 of Table 4.1b, or enter =SUM(P)/3, or use the Excel
average formula as shown in row 14. qu
(10) If =SUM(P) or =AVERAGE(P) is enter in B9, and B9
is copied to C9:E9, the range in other columns should be
corrected as in Step (4).
8
10
9
(11)* Finally, for practical purpose, it is always a good idea to
show the names defined in the calculation table.
Enter /F3(Name list)/ to obtain the list of the ranges which are
named. Move the pointer to a blank space and enter
/F3/Paste name, Paste List/ (4.2.2)
The List will be pasted on the spreadsheet.
D =Sheet7!$D$4:$D$7
Feb =Sheet7!$B$6
Jan =Sheet7!$B$5
March =Sheet7!$B$7
P =Sheet7!$B$5:$B$7
PQ =Sheet7!$D$4:$D$7
Q =Sheet7!$C$5:$C$7
SumD =Sheet7!$D$8
11
Naming, References, and Advanced Graphics 4-11
reference formula like those in I8:I10 cannot convert directly to the naming
(d) In Step (11), we use /F3/ key to show the defined range of the names. In comparative static analysis
of economics and business, we frequently need to change the parameters to see the effect of change of
a parameter on equilibrium values. In this case, we suggest to use a parameter table1 and enclose it
with “All Borders” box under /“Home”/Font, Border!/. #
4.3 Advanced topics in Naming
4.3.1 Rules and New Name dialog box
Rules on naming
(a) Excel does not allow spaces in names. For example, the name “balance sheet” is not allowed,
but “balance_sheet” or “balance.sheet” is ok.
(b) Names are not case sensitive. “Sales” is the same as “SALES.”
(c) In Excel, c is used for column and r is used for row. Hence, c and r are not allowed. Instead, use
c_ and r_, or use cc and rr, or c1c, r2r, etc.
On New Name dialog box
In addition to using the name box and the Create from Selection dialog box (4.2.1), Excel has another
method to name a range. Click
/“Formula”/Defined Names, Define Name!/ (4.3.1)
We follow Steps 4.3a below.
1 See Hsiao (2011), Chapter 4.
Naming, References, and Advanced Graphics 4-12
Remarks on Steps 4.3a Use of New Name dialog box
(a) The advantage of using this naming method is that you can decide the scope of the name in Step (8),
while other two method will define the name in global setting. See Section 4.3.2. #
4.3.2 On the scope of name range
It is important that there is difference in terms of local and global scope between copying a
sheet to another sheet and copying a table to another sheet. The former copy operation
changes the global names into local names, and the latter makes the global names stay global.
(1) Enter equation (4.3.1). New Name dialog box
appears. The name may be blank or filled with the
text of the surrounding cells.
(2) Comment box can contain up to 255 characters.
(3) If a range is preselected, say, B5:B7, in Table
4.2a,then the “refers to” box will be filled as shown.
Otherwise, it will be either blank or show a cell
address.
(4) If the “Refers to” box is blank or has wrong
range, click the collapse button to reduce the dialog
box.
(5) Click the range to be named, in this case, B5:B7,
the range will be shown in the box.
Click the expand button to return to the New Name
dialog box.
Steps 4.3a Use of New Name dialog box
1
3
4
Objective: Name range B5:B7 of Table 4.2a or Step (1) of Steps 4.2a
2
5 6
(7) Enter the name, in this case, P, in the
Name box.
(8)* Decide whether the name should be
global (workbook) or sheet specific (local).
Click Sheet1 (local) in this case.
(9) /OK/
7
8
9
Naming, References, and Advanced Graphics 4-13
This is explained in Table 4.3b. We use range A4:D7 of Table 4.2a as an example. For
convenience, A4:D4 is moved to A1:D4 in Table 4.3b below.
Remarks on Table 4.3b
(a) We know P, Q, etc. in step (3) are local since the Name List indicates Sheet1(2), not Sheet1, and
when P or Q is clicked, the pointer moves to B2:B4 in Step (3), rather than move back to B2:B4 in Step
(1).
(b) In Step (3), local names override the global names.
(c) In general, the distinction and the uses of global and local scope are very confusing. It is hard to
discern which is which from the spreadsheet, and its designation is time consuming. We prefer to use
the name box method (Steps 4.2a) and the create name method (Steps 4.2b) for multiple naming. These
two methods give global naming. For local naming, we suggest the following, as we did elsewhere2. If
capital in sheet1 is named K using the name box, K is defined globally. Thus, in Sheet2, K is always
2 See Hsiao (2011).
(1) Original table in Sheet1 with 6 names
in global scope.
(2) When Sheet1 is copied to Sheet1(2),
the global names become local names, as
shown by the name list.
1
3
(1) Original table in Sheet1 with 6 names in
global scope.
(2) Sheet to sheet copy. When Sheet1 is
copied to Sheet1(2), the global names become
local names, as shown by the Name List.
(3)* When B2 is changed from 1 to 3, D2
changes to 12, but no change in D2 in Step (1).
In addition, changes in Step (1) will not affect
Step (2), since all the names become local in
Sheet1(2), and override the original global
names.
2
Table 4.3b The global and local scopes
(4) Copy the original table (not sheet), A1:E5,
to Sheet2.
(5) Operations of the copied table are linked
to the original table (4).
(6) The operation =P*Q depends on that of
Sheet1, and changes in P and Q in Sheet2 do
not affect =P*D in Sheet2.
If B3 in (4) changes to 1, then D3 in (4) will
change to 5, it will not change B3 to 1 in (5)
but will change D3 in (5) to 5.
4 5
6
Naming, References, and Advanced Graphics 4-14
referring to K in sheet1. To use different range of K in Sheet2, use KK, KKK, KxK, K.x (period), K_
(underscore), or K\x (backslash), etc., to name K, where x can be a chapter number or a homework
number. Note that you cannot use KK1 and KKK1since these are one of the cell addresses in Excel
2010. To verify, press /F5(go to)/ and enter them in the Reference box). #
Although you may also use the name manager to change the scope (defined below) of K to
local (instead of global) sheet specific (see below), it is almost impossible to do so for many names in
many different sheets.
4.3.3 Changing or deleting a range name using Name Manager
You cannot change or delete the range name using the name box or the delete key. Changing and
deleting can be done only through Name Manager. Click
<”Formulas”> <Defined Names, Name Manager> (4.3.2)
In Table 4.3b, we have three sheets, Sheet1 contains the original demand of gasoline table with 6
names, Sheet1(2) is copies from sheet1 and contains 6 names which are local to Sheet1(2), and Sheet2
is a new sheet in which the demand of gasoline table is copied. Sheet2 also has 6 names, but all the
names in Sheet2 refer to those in Sheet1.
Steps 4.3c Editing and deleting names
1 (1) In any worksheet of the
workbook which contains three
sheets of Table 4.2b, click (4.2.2),
the Name Manager (1) appears. It
contains all range names in the
current workbook.
(1)* In any worksheet of the
workbook that contains three sheets
of Table 4.3b, click (4.3.2), the
Name Manager (1) dialog box
appears. It contains all range names
in the current workbook.
The dialog box can expand or
shrink like a worksheet, so are the
columns. 12 names are listed here.
six are for workbook (global) and
six are for Sheet1(2) (local).
Holding the control key to select the
names with “workbook” scope to
verify that all the names are
contained in the Name Manager.
Naming, References, and Advanced Graphics 4-15
2
(1) In any worksheet of the
workbook which contains three
sheets of Table 4.2b, click (4.2.2),
the Name Manager (1) appears. It
contains all range names in the
current workbook.
(2) Add new name Select D2:D4 in Sheet1
(Step (1)) of Table 4.3b, or Step (8) below.),
and press “New…” button. The New Name
dialog box Step (1) of Steps 4.3a appears.
Enter PQ and /OK/. PQ is entered in the Name
Manager.
(3) Edit old name Click P of the Workbook
scope and press Edit button.
(4) The Edit Name dialog box similar to the
New Name dialog box appears. Change P to
“Price.”
(5) P is changed to Price in the Name Manager
dialog box.
(6) Click Q of the Workbook scope and do the
same as Step (3) to change Q to “Quantity” in
the Name Manager dialog box.
5
6
2 3
4
9
7
(7) Go back to Sheet1, click the down arrow in the
name box, make sure that names Price, Quantity,
and PQ are listed, and have the correct range for
each (Note that the range of name PQ overlap with
that of name D). Enter /F3/ to download the name
list as shown.
(8) The formulas in range D2:D4 change to the
=price*Quantity formula in E2:E4 automatically.
8
Naming, References, and Advanced Graphics 4-16
Remarks on Steps 4.3c Editing and deleting names
(a) In Step (1), if Sheet1 is copied to another sheet, the copied sheet will be Sheet1(3), and another set
of six names with pretext ‘=Sheet1(3)’! (local to Sheet1(3)) will be added to the Name Manager.
(b) Name Manager is the most comprehensive dialog box for naming. #
4.3.4 Changing to range names retrospectively
If a table is already constructed without using range names, we can change the cell addresses into range
names. If the changes do not come automatically, we can ask Excel to change. Select the cell range,
which we want to convert, and enter
/“Formulas”/Defined Names, Define Name!/Apply Names… (4.3.3)
The Apply Names dialog box appears. We take Table 3.3a The financial statement of the GiGo
Company as an example. Table 3.3a is reproduced in Steps 4.3d below.
(9) Editing the name range Click a name, say,
PQ (select one at a time).
(10) Its name range shows up at the bottom of the
Name Manager.
(11) Close the Name Manager Use the collapse
box to edit the range, and click the Expand box to
go back to the Name Manager.
(12) Delete a name Click PQ in Step (2) and Press
“Delete” in Name Manager, and /OK/. Name PQ
is deleted.
(13)* /Close/ to close the Name Manager.
9
10
11
13
Naming, References, and Advanced Graphics 4-17
Remarks on Steps 4.3d Changing to the range names retrospectively
(a) In Step (6), mProfit in F6 is the difference between the cells in the same column. Unless we define
each element in the same column separately, like we did in Step (1) of Steps 4.2b, we cannot convert
the cell addresses to range names completely.
(b) In Step (6), note that the appearance of formulas entered in C5, D5, and E5 are the same as the
original equations shown in Row 2.
(c) There are some more details at the lower part of the Apply Names dialog box. We leave them to
some professional books for explanation. #
4.4 4.3 Advanced Graphic Methods
For business and economics, charts are very important part of understanding the property of
the data, to guide setting up a model, and to interpret the model. In Chapter 3, we have introduced the
method of drawing a simple chart from a table, and illustrated the trend of TR, TC, Profit, and Marginal
Profit in Fig. 3.4a, the financial table of the GiGo Company. This section shows how to edit or improve
the chart presentation.
4.4.1 Problems for improvement
Fig. 3.4a is reproduced as Fig. 4.4a below. Here are some problems with the chart.
Problem (1) The chart is, by default, enclosed by two layers of borders, making the chart two
Steps 4.3d Changing to the range names retrospectively
1
(1) Select B5:B25, and name it as Q (Single naming, Steps 4.2a)
(2) Select C4:E25 and name TR, TC, and Profit (Multiple
naming, Steps 4.2b)
(3) Select B5:E25 to change the cell address to names.
(4) Click (4.3.3). The Apply Names dialog box appears.
2
3
5
4 (5) Holding the control key
and select the appropriate
names (in this case all
names). The names are
shaded. Click /OK/.
(6)* To check, click C5, D5, E5, and F6. All the previous cell
addresses are changed to the corresponding range names. See
rows 26 to 29.
(7) /F3/ to “Paste List.”
6
7
Naming, References, and Advanced Graphics 4-18
“crowded.” Erase the outer borders.
Problem (2) The chart title is, by default, unproportionally large.
Problem (3) The vertical axis needs major and minor tic markers, and the 0 after the decimal point can
be eliminated in this chart.
Problem (4) The horizontal axis also needs major and minor tick marks, and the axis label should show
below the plot area.
Problem (5) The curves can be edited to have different width or dashes, with the data labels for the
Profit curve.
Problem (6) The vertical line is not straight and too prominent. It can use dashes.
Problem (7) The horizontal major gridlines should be in background, can make them in lighter color
and can use dashed line, instead of solid lines.
Problem (8) Reproduce the chart for other possible formatting experiments on the chart.
Problem (9) The Profit and mProfit curves are too crowded at bottom part of the diagram. Using the
copied chart, enlarge them and show data labels of profit above the profit curve.
Problem (10) We may draw Profit and mProfit curves in a separate chart.
Problem (11) Now we have five charts. Which one is more informative and look better?
Problem (12) Color the chart?
These problems are explained and solved in the following sections. For each problem solved, always
refer to Fig. 4.4b to see the effect of changes.
4.4.2 Editing the Chart Area borders
Problem (1) The chart is, by default, enclosed by two layers of borders, making the chart two
-200.0
-100.0
0.0
100.0
200.0
300.0
400.0
500.0
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
7.5
8.0
8.5
9.0
9.5
10
.0
TR,
TC,
Pro
fit
Output
Profit Maximization
TR
TC
ProfitmProfit
TR
TC
ProfitmProfit
Fig. 4.4a Some problems with the original chart of Fig. 3.4a
1 2
3
4
5 6
8
7
9 10
Naming, References, and Advanced Graphics 4-19
“crowded.” Erase the outer borders.
Both borders are default when the chart is drawn. If we have many charts, the outer layer
makes the chart too crowded. We want to remove the outer borders. This may not be a problem for
some people. However, we start from this to introduce the difference between the chart area and the
plot area.
(1) The inner borders below the chart title and
enclosed by the axes are called the plot area.
The area between the plot area and the outer
borders are called the chart area.
(2)* When the pointer fat cross moves to each
area, pointer changes to a fat arrow and its tip
has four arrowed plus sign with name of the
element, indicating that you can move the
chart anywhere inside the worksheet or
workbook, or you can move the plot area
anywhere inside the chart area.
Steps 4.4a Removing the Chart Area borders
1
Plot Area
2
(3)* Click the Chart Area (which is one
of the chart elements) twice (Method
1), the Format Chart Area mini window
appears.
We call this the clicking method of
editing charts. See Section 4.4.2 for other
three methods.
(4)* Select the Border Color
(5)* The Border Color dialog box
appears.
(6) Select the bull’s eye @No line.
(7)* /OK/. The Chart Area borders are
3
5
4
6
Naming, References, and Advanced Graphics 4-20
Comments on Steps 4.4a Removing the Chart Area borders
(a) In Step (2), you may click the chart once and /RM/, a small dialog box appears, with “Move Here”,
“Copy Here,” and “Cancel.” If you press /RM/ several times, eventually a mini window appears, with
“Cut” and “Copy” commands. We prefer to use either click and drag method or ^C ^V or ^X^V
sequence to move the chart.
(b) In Step (3), the entries in chart are called chart elements, including the chart area, axis, line, etc.
We can click any element twice to invoke the mini window like Step (3). This is the Clicking
Method. There are other three methods of editing the chart elements, as explained in Section 4.4.3.
In principle, we will use the clicking method to edit chart elements.
(c) In Step (4), you may experiment with other entries in this and other “Format” windows, especially
on “Properties”, where you may make the chart “Don’t move or size with cells.”
(d) In Step (5), to save space, in this and the next section, we will cut left corner of the Format mini
window. #
4.4.3 Other three methods of editing chart elements
Referring to Steps 4.4b below, the second method of editing chart elements is the RM method. First
you select the element, say, the chart area, and /RM/. A mini menu appears. Click the Format Chart
Area (Step (7)). Format command is always located at the end of the mini menu. When the Format
Chart Area is clicked, the mini window in Step (3) of Steps 4.4a appears.
The third method is the Ribbon method. Click the chart area, and enter (the steps refer to
those in Steps 4.4b below)
/“Chart Tools, Format” (Step (8) /Shape Styles, Shape Outlines! (Step 9)
/No Outline (Step 10)/ (4.4.1)
The fourth method is the Current Selection Method. Click the chart area, the contextual tab
“Chart Tools” will appear (Step (11), thus,
/“Chart Tools, Format” (Step (8) /Current Selection, Format Selection/ (4.4.2)
/Format Selection/ will lead to Format Chart Area in Step (3) of Steps 4.4a.
It is quite a chore to remember or follow these steps. The clicking method probably more
intuitive and simple.
Naming, References, and Advanced Graphics 4-21
4.4.4 Editing the chart titles and axes
Problem (2) The chart title is, by default, unproportionally large.
The title boxes are like text boxes (see Steps 2.4d). Clicking the chart title twice, the chart title
is enclosed with dashed borders and a vertical line will show that the chart title is in the editing mode.
Move the pointer to the end, and enter and write The GiGo Company on the next line. Clicking the
border once, the borders changed to solid lines, indicating that you have selected the whole box. Enter
/“Home”/Font, Font!/$Times New Roman/Font, Font Size!/11/ (4.4.3)
You may select “The GiGo Company” and change the name to plain font (no bold) and select size 10
point.
In general, like a text box, inside the chart, the font and the font size can be changed only
through /“Home”/Font, Font!/ and /“Home”/Font, Font Size!/.
Problem (3) The vertical and horizontal axis need major and minor markers for clarity, and the 0 after
Method 2: the RM Method
7
8
Method 3: the Ribbon Method
Method 4: the Current Selection
Method 10
9
11
10
11
12
Steps 4.4b Other three methods of editing a chart element
Naming, References, and Advanced Graphics 4-22
the decimal point is redundant and can be eliminated.
Problem (4) The horizontal axis needs major and minor tick marks, and the axis labels show move
below the plot area.
Remarks on Steps 4.4c Editing the vertical axis
(a) In step (2), we recommend Cross, Inside, and Low.
(1) Double click any one of the vertical axis
labels, Format Axis dialog appears.
(2)* Click /Format Axis, Axis Options/Major
tick mark type:!/[Cross]/,
/~/Minor tick mark type:!/[Inside]/,
/~/Axis labels/[Low]/
(“Low” means below the Plot Area)
(3) Click /Format Axis, Number/Category:
Number/Decimal Places: [0]/
Steps 4.4c Editing the vertical axis
1
3
2
3
Naming, References, and Advanced Graphics 4-23
4.4.5 Editing the curves and lines
Problem (5) The curves can be edited to have different width or dashes, with the labels.
Since the relation between TR and TC contains more information than those between Profit
and mProfit, we may make the width of the latter curves lighter.
(1) Without closing the Format Axis dialog
box, double click any one of the horizontal axis
labels, the Format Axis dialog box for the
horizontal axis appears. It is slightly different
from that of the vertical axis.
(2) Click /Format Axis, Axis Options/Major
tick mark type:!/[Cross]/,
/~/Minor tick mark type:!/[Inside]/,
/~/Axis labels/[Low]/
(3) /Click /Format Axis, Number/Category:,
Number/Decimal Places: [1]/
Steps 4.4d Editing the horizontal axis
1
3
2
(1)* Double click TC curve rapidly, the
Format Data Series dialog box appears.
(2) Click /Format Data Series, Line Style/Dash
type:!/[Dash]/
(3)* Click the Profit curve once, and /~/Line
Color/@Solid Line/Color! Black Text 1/Line
Style/ Width:!/[1.25]/
(4) Click the mProfit curve once, and /~/Line
Color/@Solid Line/Color!, Black Text 1//Line
Style/ Width:!/[1.25]/Dash types:!, long Dash/
Steps 4.4e Editing the curves
1
2
3 2
Naming, References, and Advanced Graphics 4-24
Remarks on Steps 4.4e Editing the curves
(a) In Step (1), when clicking a curve to invoke Format Data Series dialog box, you should click twice
rapidly. Otherwise, Excel may interpret that you are selecting the curve and then selecting a particular
data point at the tip of the pointer. If the clicking method does not work, use the RM method.
(b) In Step (1), if the Format dialog is already open, you only need to click the element once to invoke
the Format dialog box of that element. Also see Step (3). #
Problem (6) The vertical line is not straight and can use dash.
The vertical line is not a chart element. However, you still can click the line twice and edit the line.
When the line is moved at one end or is extended, the line may be slanted, and there is no way, if not
very difficult, to make it straight using mouse alone (in fact, the more you try the more the line will be
crooked!).
(4) To change the solid line to a dotted line, click the line twice,
/“Drawing Tools, Format”/Shape Styles, Shape Outline!
/Dashes/Round Dot/ (4.4.4)
Remarks on Steps 4.4f Making a solid straight line straight, and a dash
(a)In Step (1), you may click the line once to invoke /“Drawing Tools, Format”/, as in (4.4.4).
(b)Note that the command sequence in (4.4.4) is the same as Steps (9) to (11) of Steps 4.4b. This is very
useful procedure. You may change the “Weight” and the “Arrows” of the lines or any shapes through
this procedure.
(1)* Double click the line twice. The
/“Drawing Tools, Format/ ribbon appears. A
circle appears at both ends of the line, indicating
that the line is in the editing mode. The Format
ribbon is the same as the ribbon shown at Step
(9) of Steps 4.4b.
(2) At the end of the Format ribbon, find /Size,
Shape Width/0.02’/. Change 0,02’ to 0. The line
is straightened.
(3) Use Shape Height to extend or shrink the
line. If the line is changed manually, you may
need to go back to Step (2) to straighten the line.
Steps 4.4f Making a solid straight line straight, and a dash line
1
2
3
5
4
Naming, References, and Advanced Graphics 4-25
(c) Editing the horizontal axis labels To make the horizontal axis “label tight” as shown, expand the
chart horizontally and then shrink the chart slowly until the axis labels look like Step (5). Since the
appearance of the labels changes automatically, there seems no manual method to control whether the
label labels appear horizontally or vertically. #
4.4.6 The secondary vertical axis and data labels
Problem (8) Reproduce the chart for other possible formatting experiments on the chart.
Problem (9) The Profit and mProfit curves are two crowded at bottom part of the diagram. Using the
copied chart, enlarged them by using the secondary vertical axis, and show data labels of profit
above the profit curve.
It is always a good idea to reproduce the chart and use the reproduced charts for graphic experiment.
Reproducing a chart in the same worksheet
The best way to reproduce the chart is, like any spreadsheet range, either use the click and drag
method or ^C^V, ^X^V sequence.
Reproducing a chart in a separate worksheet
If the current worksheet, say, Sheet1, is clattered, you may copy the chart to Sheet2 by the control key
method. In fact, you may use the control key method to copy both chart and table to Sheet2.
Moving the curves to the secondary vertical axis
Remarks on Steps 4.3g Change a curve to the secondary vertical axis
(a)In Step (5), after the secondary vertical axis is created, the secondary vertical axis title can be added
only through the ribbon. Click the chart, and
(1) Click the Profit curve twice. Format Data Series Dialog
box appears.
(2) Click /Series Options, @Secondary Axis/
(3) Click the mProfit curve once (since the Format dialog
box is already open).
(4) Repeat Step (2) for the mProfit curve.
(5)* /OK/. The two curves move above the TR and TC
curves as shown in Part (ii) of Fig. 4.4a.
Steps 4.3g Change a curve to the secondary vertical axis
1
2
Naming, References, and Advanced Graphics 4-26
/“Chart Tools, Layout”/Labels, Axis Titles!/Secondary vertical axis title!/
Rotated Title/ (4.4.5)
Like any other axis labels, you may choose other format too. #
Comments on Steps 4.4h Adding data labels to curves
(a)In Step (1), another method of adding the data label is clicking the curve, and
/“Chart Tools, Layout”/Labels, Data Labels!/Above/ (4.4.6)
If /~/~/More Options is clicked, “Format Data Label” dialog box (Step (3)) appears.
(b)In Step (4), we think placing the data labels above or below the curve is the best option.
(c) In Step (5), the data labels can be edited like Text Boxes. Clicking any data label will select all the
data label boxes, clicking the data labels twice in quick action will invoke Format Data Labels dialog
box. Clicking any data label and click again, the second time click will select that label alone, and you
can do moving, sizing, and editing that label like a text box. #
(1) Click the profit curve
once, and /RM/ the drop
down window appears.
(2) Click /Add Data Labels/
(3) The Format Data Label
dialog box appears.
(4)* Click /Label Options,
Label Position, @Above/
(5)* /Close/. We have added
the data labels for the profit
curve. See Fig. 4.4a (ii)’
Steps 4.3h Adding data labels to a curve
2 4
1
3
Naming, References, and Advanced Graphics 4-27
4.5 Charts and Tables - advanced topics
4.5.1 Reconnecting table with the chart
When a table and a chart are copied to another worksheet, the connection between the chart and the
table may no longer valid, this can be seen from the fact that when the chart is clicked, the chart range
does not show up in the table. To reconnect the chart and table, we do the following procedure.
Reconnecting the chart with the table
Click the chart, and enter
/“Chart Tools, Design”/Data, Select Data/ or /RM/$Select Data/ (4.5.1)
as shown in Steps4.5a below.
Fig. 4.4a Two version of the same chart
(i) (ii)
Naming, References, and Advanced Graphics 4-28
4.5.2 Separating the chart without pain
Problem (10) We may draw Profit and mProfit curves in a separate chart.
If we have to start from the beginning to draw two separate charts, that is a painful task after we
have gone through so much editing. Fortunately, there is a better way to separate the existing chart.
In the following steps, we make two copies of chart (ii) (the right-hand side) of Fig. 4.4b, and call them
Copy1 and Copy2. We want to separate this original chart into copy1 and copy2, each with different
group. Note that we are not changing the original chart. It is always a good idea to keep the original
chart of table if you want to experiment with new idea or method.
(1)Enter (4.5.1). “Select Data
Source” dialog box appears. The
current “Chart data range “ list the
data range of original sheet or
none.
(2) Click the collapse button and
select by pointing the range of the
new data table, in this case,
I10:M31.
(3)After selecting the data, click
the Shrink button to go back to
“Select Data Source” dialog box.
The range is corrected..
Steps 4.5a Reconnecting table with the chart and separating the chart
1
2 3
(4) /OK/. The data are enclosed with three boxes.
(5) I11:I31, the range of independent variable (the horizontal
axis), is enclosed with purple borders;
(6) J10:M10, the range of the dependent variables (the
vertical axis) is enclosed with green borders.
(7) J11:M31, the data part is enclosed with blue borders.
5 7
6
Naming, References, and Advanced Graphics 4-29
Remarks on Steps 4.5b Separating a chart into two
(a)In this way, you can reproduce as may “clone” as the table permits. For example, you may draw the
chart for each of the four variables in the table. #
(1) Click the chart Copy1, the table will be enclosed with three
boxes, as shown in Steps (5) to (7) of Steps 4.5a.
(2) When the pointer moves near a border, the borders of boxes
change to heavier lines.
(3) Click a border or the corner of the borders, like point a.
(4) Move a to b. The data box shrinks to contain TR and TC
only.
Steps 4.5b Separating a chart into two
1
a b
c
b
d
2
4
3
(5) The Copy1 chart also contains only
TR and TC curves, other entries being
the same.
(6) Now, Click Copy2 chart. Same as
Step (1) above.
(7) Click the side c and drag the whole
box to the right to d. The blue box now
contains only Profit and mProfit.
(8)* The chart now contains the two
curves. The secondary vertical axis
changes to the main axis.
.
7
5 8
Fig. 4.5a Separated charts
6
(ii) (i)
Naming, References, and Advanced Graphics 4-30
4.5.3 Comparison of the charts
Problem (11) Now we have five charts. Which one is more informative and look better?
Problem (12) Color the chart?
Now we have five charts, the original chart, Fig. 4.4a, and the four charts, Figs. 4.4b (i) and (ii),
and 4.5a, (i) and (ii). The original one, Fig. 4.4a, looks very primitive and we may dismiss it quickly.
Fig. 4.4b (i) seems much simpler than Fig. 4.4b (ii), and probably good for a nonprofessional. Note
also, the origin of the secondary vertical axis does not fall along the major gridline, and have to use a
line to indicate the origin. This makes the second chart (ii) harder to read.
Fig. 4.5a are good for beginners and very easy to understand, especial Part (i). However, both
failed to convey the dynamic or dual nature of profit maximization and so they are one-sided.
Coloring the charts? That is another big topic. For our purpose, it is rather cosmetic, although
interesting, and do not enhance the understanding of business and economics. We probably have more
important things to learn.
4.5.4 Mathematical Conditions of Profit Maximization
Lastly, for those who have a background of quantitative methods, Fig. 4.4a conveys one of the
basic results in Business and Economics, the mathematical conditions of (unconstrained)
maximization. We use Part (ii) to explain.
A necessary condition of profit maximization
We recall that marginal profit, mProfit in (3.3.3), is extra profit earned by producing extra unit of
output. Mathematically, it is the slope of the profit curve at given level of output. The chart shows that
profit is maximized at output a, at which the mProfit, namely, the slope at b, on the profit curve, is zero.
This is also shown by the fact that the mProfit curve passing through 0 at c. The fact that, if the profit is
maximized, the mProfit must be zero is called the necessary condition of profit maximization. At the
maximum point a, the maximum profit is measured by the length of ab from the secondary vertical
axis.
Since Profit = TR – TC, when the profit is maximized, the difference between TR and TC is
also maximized. This means that the distance between d and e is the largest in the neighborhood of a.
By definition, the slope of the TR is called the marginal revenue and that of TC is called marginal
cost. The chart shows that when profit is maximized, the slope of TR equals the slope of TC, that is,
MR = MC. This is also called the necessary condition of profit maximization.
Intuitively, at the maximum profit, the mProfit must be zero since if it is not zero, then mProfit
must be either positive (on the left hand side of a) or negative (on the right-hand side of a). If it is
positive, the firm, the GiGo Company, can increase output to increase its profit, thus, the firm will
increase its profit until mProfit is zero. If it is negative, there is no reason for the firm to increase output
any more. It will rather decrease the output until the mProfit is zero. Thus, mProfit is zero at a. In fact,
a is also called the equilibrium level of output and b is the equilibrium level of profit, since the firm
has no incentive to increase or decrease the output level from a.
Naming, References, and Advanced Graphics 4-31
Incidentally, the zero mProfit condition is called the necessary condition since zero slope of
the profit curve, or the equality between MR and MC does not guarantee that profit is maximized. This
is shown at output level = e. Clearly, at e, marginal profit is zero and MR = MC. However, the chart
shows that, profit is the smallest in the neighborhood of e. Therefore, satisfaction of the necessary
condition does not imply that the profit is maximized.
A sufficient condition of profit maximization
In the above discussion, we have not mentioned anything about the shape of the curve.
Comparing the shape of the curve between the maximum point of profit at b and the minimum point at
g, the shape of the profit curve in the neighborhood of a and g must play an important role in
determining maximum or minimum. This is indeed the case.
We have talked about the slope or the mProfit, of the profit curve at b and g. Thus, the change
of the slope is shown by the mProfit curve. Fig. 4.5b (ii) shows the Profit and mProfit curves in the
neighborhood of maximum point a. It is drawn easily by using Steps 4.5b.
From the chart, we can see that on the left-hand side neighborhood of output a, profit is
positive and mProfit (slope) is also positive, but mProfit is decreasing as Q increases. The slope
decreases to 0 at a and continues decreasing after 0, as shown by the dotted (mProfit) curve. Thus, one
of the characteristics of profit maximization is that the slope of mProfit is negative.3 Therefore, we may
conclude that if the mProfit is zero and the slope of the mProfit is negative at a, then we have a
maximum profit at a. These two conditions together are called a sufficient condition of profit
maximization.
The economic and business reasoning of decreasing mProfit is that if the mProfit is increasing,
then people will just expand the output indefinitely, and there will be no maximum output at all. This
contradict with the reality. Thus, at the maximum point, mProfit must be decreasing.4
In contrast, in Fig. 4.5b (ii), both the profit and the mProfit are negative at output e. However,
the mProfit is increasing in the neighborhood of e. Thus, a sufficient condition of minimization is that
mProfit is zero and it is increasing (the second derivative of the profit function at g is positive).
In general, this section shows the importance of using graphic to understand the properties of a
function. The topic discussed here is in the field of calculus, mathematical economics, and
management science.
3 that is, slope of the slope of the profit curve is negative. In calculus, this means that the second derivative is
negative. 4 Note that the sufficient condition is not a necessary condition since the mProfit function may be zero at the
maximum profit. For example, if the profit function is given by Profit = -Q4. See a textbook on mathematical
economics.
Naming, References, and Advanced Graphics 4-32
(i) (ii) Fig. 4.5a A Necessary conditions of profit maximization
(ii)
Fig. 4.5b A Sufficient conditions of profit maximization
(i)
(ii)
Naming, References, and Advanced Graphics 4-33