All Rights Reserved: Free Preview - Week #8 Learn Excel From MR Excel
All Rights Reserved: Free Preview - Week #8 Learn Excel From MR Excel
Fig. 167
97
98 of 654 LEARN MICROSOFT EXCEL
Strategy: All of the cell references in the formula are known as rela-
tive references. The amazing thing about Excel is that when you copy a
formula, all of the relative cell references are automatically adjusted. If
you copy a formula from row 2 down to row 3, as shown in Fig. 168, then
every reference pointing at row 2 will change to point at row 3.
Fig. 168
So, the solution to the problem is simply to copy the formula down to
all the other rows. A shortcut for doing this is to select the cell and then
double-click the Fill handle to copy the formula down to all rows with
values in the adjacent column.
Additional Details: Relative references will move in all four directions.
In Fig. 169, if you copy the formula in cell F7 to E6, the referenced cell
will change from D3 to C2.
Fig. 169
In Fig. 170, you can see how the formula copied from F7 to E6:G8 will
change.
Part 2: CALCULATING with excel 99 of 354
Fig. 170
Part
II
Hint Fig. 170 was shot in Show Formula mode. To enter Show
Formula mode, hit Ctrl+~. To toggle back to regular mode,
hit Ctrl+~ again.
Fig. 171
The reference to A1 would have to point to the cell one row above and
one column to the left of A1. This cell does not exist, so Excel will return
a #REF error, as shown in Fig. 172.
Fig. 172
100 of 654 LEARN MICROSOFT EXCEL
Summary: The ‘miracle’ of Excel is that you can enter a formula in one
place and copy it to many other places and it will still work. This is be-
cause a regular cell reference, such as B1, is a relative reference.
Fig. 173
If you copy the formula in F4 to F5, you get an invalid result, as shown
in Fig. 174.
Fig. 174
Part 2: CALCULATING with excel 101 of 354
Look at the formula in the formula bar in Fig. 174. As you copied the
formula, the references to D4 and E4 changed as expected. However, the
reference to C1 moved to C2. You need to find a way to copy this formula
and always have the formula reference C1.
Frankly, this is the most important technique in the entire book. I once
had a manager who would enter every formula by hand in the entire
dataset. I didn’t have the heart to tell him there was an easier way.
Strategy: You need to indicate to Excel that the reference to C1 in
the formula is Absolute. Do this by inserting a dollar sign before the
C and before the 1 in the formula. The formula in F4 would change to
=ROUND((D4*E4)*$C$1,2).
As you copy this formula down to other rows in your dataset, the por- Part
tion that refers to $C$1 will continue to point at $C$1, as shown in II
Fig. 175.
Fig. 175
Fig. 176
Strategy: In the last chapter, you learned how to use an absolute refer-
ence, such as $C$1, so that Excel would not change from column C or
row 1 as it copied the formula. To create a multiplication table, you need
to use a mixed reference. A mixed reference, such as $B1, will lock the
formula to column B, while allowing the row to change. A mixed refer-
ence, such as B$1, will lock the row to row 1, while allowing the column
to change.
The formula that you need for the multiplication table is a formula that
will multiply whatever is in row 1 above the cell by whatever is in col-
umn A to the left of the cell.
To have a reference that always points to row 1, use something in the
format of B$1. To have a reference that points to column A, use a refer-
ence in the format of $A2.
1) As shown in Fig. 177, the formula you want to enter in B2 is
=$A2*B$1.
Part 2: CALCULATING with excel 103 of 354
Fig. 177
2) Copy the formula in B2 to the entire range, and it will always prop-
erly multiply row 1 by column A as shown in Fig. 178.
Part
II
Fig. 178
Fig. 179
Strategy: This formula will contain all four reference types. While en-
tering the first formula in H6, you will want to base the commission cal-
culation on the January sales in E6. As you copy the formula from Janu-
ary to February, you will want the E6 reference to be able to change to
F6. As you copy the formula down to other rows, you will want the E6 to
change to E7, E8, etc. Thus, the E6 portion of the formula needs to be a
relative reference and will have no dollar signs.
You will multiply the sales times the base rate in B1. As you copy the
formula to other months and rows, it always needs to point to B1. Thus,
you need to use dollar signs to before the B and before the 1: $B$1.
To incorporate the product bonus, you will need to multiply sales by the
Product Rate in column C. All of the months in row 6 will have to refer
to C6. All of the months in row 7 will have to refer to C7. Thus, you need
a mixed reference where column C is locked. Use the address of $C6.
Finally, the VP of Sales added the monthly profit sharing bonus. The
entire commission calculation is multiplied by the bonus factor shown
in row 1. The January commission calculation uses the factor in E1. The
February factor is in F1. The March factor is in G1. In this case, you
Part 2: CALCULATING with excel 105 of 354
need to allow the formula to point to different columns but always to row
1. This requires a mixed reference of E$1.
Now that you have the four components of the formula, you can enter
this formula in E6, as shown in Fig. 180: =E6*($B$1+$C6)*E#1.
Fig. 180
Part
Result: As shown in Fig. 181, you have created one single formula that II
can be copied to all columns and rows of your dataset.
Fig. 181
SIMPLIFY ENTRY OF
DOLLAR SIGNS IN FORMULAS
Problem: It is a pain to type the dollar signs in complex formulas such
as the formula shown in Fig. 182.
Fig. 182
Strategy: Use the F4 key as you are entering the formula. The F4 key
will toggle a reference through the four possible reference types.
As shown in Fig. 183, start to type the formula =E7*(B1.
Fig. 183
Immediately after you type B1, hit the F4 key. Excel will insert both dol-
lar signs in the B1 reference, as shown in Fig. 184.
Fig. 184
Fig. 185
Part 2: CALCULATING with excel 107 of 354
Hit the F4 key again. Excel changes to a mixed reference, with the col-
umn portion of the reference locked, as shown in Fig. 186.
Fig. 186
Hit the F4 key once more. Excel changes back to a relative reference, as
shown in Fig. 187.
Part
II
Fig. 187
Here are the steps for entering the complex formula shown in Fig. 182.
1) Type =E7*(B1.
2) Hit the F4 key once.
3) Type +C7.
4) Hit the F4 key 3 times. Your formula will now appear as shown in
Fig. 188.
Fig. 188
Fig. 189
108 of 654 LEARN MICROSOFT EXCEL
6) Hit the F4 key twice to change E1 to a reference with the row locked,
as shown in Fig. 190.
Fig. 190
7) Hit Ctrl+Enter to accept the formula without moving the cell point-
er to the next cell, as shown in Fig. 191.
Fig. 191
8) With the mouse, grab the Fill handle (the square dot in the lower
right corner of the cell) and drag it to the right for two cells, as
shown in Fig. 192.
Fig. 192
This will copy the formula from January to the other two months, as
shown in Fig. 193.
Fig. 193
9) Double-click the Fill handle. This will copy the three cells down to
all of the rows with data, as shown in Fig. 194.
Fig. 194
Fig. 194
Part 2: CALCULATING with excel 109 of 354
Fig. 195
After the reference is highlighted, you can hit the F4 key to toggle that
particular reference through the four states, as shown in Fig. 196.
Fig. 196
Fig. 197
Strategy: Relax. There are two ways of naming cells. Someone has
turned on the R1C1 style of addressing. To return to the normal A1 style
of cell addressing, go to Tools – Options. On the General tab, uncheck
the box for R1C1 Reference Style, as shown in Fig. 198.
Fig. 198
But wait – while you are here, you can learn something fascinating about
spreadsheets. In the topic “Copy a Formula That Contains Relative Ref-
erences”, I suggested it was miraculous that Excel could automatically
change a formula as you copied it. If you take two minutes to learn about
this other method of cell addressing, you will understand that it may not
be so amazing after all.
Part 2: CALCULATING with excel 111 of 354
When Dan Bricklin and Bob Frankston invented VisiCalc, they used the
A1 style of cell naming. When Mitch Kapor started selling Lotus 1-2-3,
he used the same style. When Microsoft came out with their first spread-
sheet product – Microsoft Multiplan – they used a very different method
of cell addressing. This method is known as R1C1. In the Microsoft sys-
tem, the rows are numbered just as in the A1 system. However, the
columns are also numbered. Each cell is given a name, such as “R4C8”.
This name stands for the cell at Row 4, Column 8. This is the cell that
you and I know as H4.
In the R1C1 style, the formulas are interesting. Look at this formula in
cell D6, as shown in Fig. 199.
Part
II
Fig. 199
The formula in the formula bar says =D5+C6–B6. But when you think
about this formula in plain language, what it is really means is “Take
the cell just above me, add the interest in the cell just to the left of me,
and subtract the payment in the cell two cells to the left of me”.
Formulas in R1C1 style are more like the plain language description
above. If you want to enter a formula in D6 that points to the cell just
above, it would be =R[–1]C. The number in square brackets after the R
indicates to how many rows ahead or back you are referring. In our case,
row 5 is one row above row 6, so you would put a –1 in the square brack-
ets. There is no number after the C portion of the address, which means
that you are referring to the same column as the cell that contains the
formula.
If you want to refer to a cell that is two cells to the left of the cell with
the formula, you would use =RC[–2].
112 of 654 LEARN MICROSOFT EXCEL
As shown in Fig. 200, the formula from Fig. 199 can be restated in R1C1
style as follows:
=R[–1]C+RC[–1]–RC[–2]
Fig. 200
So, all relative references in R1C1 style have a number in square brack-
ets, either after the R or after the C or both.
It is very interesting to see how this style does absolute addresses. As
shown in Fig. 201, the formula in B6 is an absolute formula that always
points to cell E2. The formula in A1 style is =$E$2.
Fig. 201
Fig. 202
Part
It is also possible to have mixed references. Flip back to Fig. 177 in the II
multiplication table topic. Fig. 203 shows that formula in R1C1 style:
Fig. 203
Additional Details: Now that you understand the basics of R1C1 style
formulas, you can appreciate the amazing part. Remember that Micro-
soft invented this method for their Multiplan product. Lotus 1-2-3 was
the dominant spreadsheet in the late 1980s and early 1990s. Microsoft
was battling for market share. Everyone using spreadsheets was famil-
iar with the A1 style. No one would want to learn the R1C1 style in
order to switch to Microsoft. So, in their Microsoft Excel product, they
developed an elaborate system to actually store the formulas in R1C1
style, but then to translate the R1C1 formulas to A1 style to make it
easier for all the Lotus fans to understand.
By default, Microsoft starts with the A1 style addressing. However, you
can remember from Fig. 198 that you are just one checkmark away from
switching back to R1C1 style addressing.
114 of 654 LEARN MICROSOFT EXCEL
Finally, here is the amazing part. Examine the amortization table ex-
ample in Formula View mode. (Hit Ctrl+~ to toggle into Formula View
mode.) The Formula View mode in A1 style can be seen in Fig. 204. Ev-
ery formula in column D is different.
Fig. 204
The Formula View Mode in R1C1 style can be seen in Fig. 205.
Fig. 205
Part 2: CALCULATING with excel 115 of 354