7. Using Formulas in Microsoft Excel
7. Using Formulas in Microsoft Excel
This is the math lesson, and whether you love or hate math, by the end of this lesson you will agree that Excel
makes math easy. We will start by explaining some of the basic concepts you need to understand regarding how
Excel does math and then will get into entering formulas.
Math Operators
Th
is
d
and the Order of Operations Th
is
d
oc oc
um um
en en
tb tb
N r e N r e
Math Operatorso u ond long o u ond long
na y@ st na y@ st
uth i o uth i o
ori nixin RON ori nixin RON
ze d DI z ed d D
The six mathematical operatorsd c oyou. o
co .co.i I HID
op co.idneedHIto DA
know to enter basic formulas in Excel are:
pie d
ies YA sa AY
all T. llo AT
ow we .
1. Addition. Plus sign (+). e d! d!
Th Th
3. Multiplication
is / Division. Multiplication and division, which Excel treats
is equally, are executed third, from left
do do
to right. c u cu
me me
nt nt
No ron b e No ron belon
lon
4. na dy@ gAddition
Addition / uSubtraction. st un
and subtraction, which Excel treats equally, dare executed
au y@i
gs last, from left to
uth i
ori nixin RON
o tho nix to RO
right. riz i
ze
d c do.co DI H ed ndo. ND
IH
op I c o co ID
i .id DA pi . id A
Entering Formulas
The simplest (not always the easiest) way to enter a formula in Excel is to:
Watch and follow along as your instructor shows you how to enter basic formulas in Excel.
Th Th
is is
do do
cu cu
AutoSum (and
me
nOther
t
Common Auto-Formulas) nt
me
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
ize indsimply
Some formulas can be rentered ize inwhich
N by clicking a button in Excel. Excel will even rguess data
N the formula
d c o.co DI H d c do.co DI H
op spreadsheet op cells.
ID is properly laid out, you don't have to select the ID
applies to, meaning that if your ies .id AY ies .id AY
all AT a l AT
ow . low .
ed ed
AutoSum ! !
Th Th
is is
do do
cu cu
me me
nt nt
3. Note that
No Excel
ron b
guessese the data you wish to sum and gives you the
Nooption be the formula if you wish:
ronto edit
lon lon
un dy g s u n dy gs
au @ t oR a uth @ to
tho ini ini RO
riz xind O N o riz x ind
ed o.c DI ed o.c NDI
co HI co HI
pi o.id DA pi o.id DA
4. Press Enter .
Count Numbers
To quickly count the number of cells in a row or column that have data:
1. SelectTthe
his cell to the right or at the bottom of a set of numbers: Th
is
do do
cu cu
me me
nt nt
No ron elonb No ron belon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co ID c o c o ID
pie .id A pie .id AY
sa YAT sa AT
llo . llo .
we we
d! d!
2. On the Home tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
d
un Numbers g un d gs
3. Select Countau y@i :s to au y@i
tho nix RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co c co c
pie o.id ID
AY pie o.id ID
AY
sa AT sa AT
llo . llo .
we we
d! d!
Th Th
4. Note thatis Excel guesses the cells in which you wish to count numbers
do
is and gives you the option to edit the
do
cu cu
me
formula if you wish: me
nt nt
No ron b e No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co I c o co ID
pie . id D AY pie . id AY
sa A s a AT
llo T. llo .
we we
d! d!
5. Press Enter .
Average
Th Th
is
To quickly average is
do the numbers in a row or column: do
cu cu
me me
nt nt
b ron belon
1. No cellrto
Select the on theeright
lon or at the bottom of a set of numbers: No
un dy un d
au @ gs to au y@i
gs
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pi o.id DA pi . id ID
A
2. On the Home tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie .id ID
AY
sa YA sa AT
llo T. llo .
we we
3. Select Average : d! d!
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
4. riz
Note that Excel guesses i d cells riz givesi
ed nthe o.c NDI
in which the data you wish to average lies and ed ndoyou .co DI H
the
N option to edit
c o H c
the formula if you wish:opie .id ID
AY
op
ies .id ID
AY
sa AT a AT
llo . l l o .
we we
d! d!
5. Press Enter .
Th Th
is is
do do
cu cu
me me
Min nt
be
nt
No ron lon No ron belon
u dy gs un d gs
To quickly find thenaminimum
uth @in number to in a row or column: au y@i
ori ix R tho nix to RO
ze indo OND riz i
ed ndo. ND
dc . I IH
op co.id HID co
pie
co
. id ID
1. Select the cell to the right ieor AY of a set of numbers:
s aat the bottom sa AY
llo AT llo AT
we . we .
d! d!
Th Th
is is
do do
cu cu
me me
nt nt
No b
ronguesseselo No ron beand
4. Note that Excel n the cells in which you wish to find the minimum number lon gives you the option to
un d gs un dy gs
au y@i t o a uth @
ini to
edit the formulathiforyounwish:
ixin RO o r x i
RO
ize N i ze n N
d c do.co DI H d c do.co DI H
op ID o ID
ies .id AY pie .id
sa AY
all AT l AT
ow . l ow .
ed ed
! !
5. Press Enter .
Th Th
Max is is
do do
cu cu
me me
nt nt
To quickly findN the maximum be number in a row or column: No ron belon
o u rond long un d gs
na y st au y@i
uth @in o tho nix to RO
ori ixin RO riz i
1. Select the cell to the ze rightdor at the
d c o.co DI H
N bottom of a set of numbers: ed ndo. ND
IH
co c
op
ies d . i ID
AY pie o.id ID
AY
all AT sa AT
ow . llo .
ed we
! d!
2. On the Home tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie . id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
3. Select Max :
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
riz i d riz ind
ed nthe o ND
I Hwhich you wish to find the maximum number edand o.c Nyou
DI the option to
4. Note that Excel guesses co .cocells in c gives HI
pi . id I DA o pi o.id DA
edit the formula if you wish:
5. Press Enter .
T Th
CopyinghiFormulas
sd
oc and Functions is
do
cu
um me
en nt
tb
No ron elon No ron belon
d fromgone
Formulas can beuncopied d
un in Excel:
s t cell to other cells in Excel. To copy formulas gs
au y@ ini oR au y@i to
tho x ON t h o n i x RO
riz ind riz ind
ed o.c DI ed o.c NDI
co HI co HI
1. Select the cell which containspie o.theid formulaDA you wish to copy. pie o.id DA
sa YA sa YA
llo T. llo T.
we we
2. On the Home tab, in the Clipboard d! group, click the Copy command. d!
Th Th
is is
do do
cu cu
me me
nt nt
3. No cellrinto
Select the b elo you wish to copy the formula. No ron belon
on which n
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
4. On the Home tab,rizin theinClipboard ND group, click the Paste command. riz i
ed do ed ndo. ND
co .co.i I HID co co
. i
IH
ID
pie d A p i e d AY
sa YA sa AT
llo T. llo .
we we
d! d!
Th Th
is is
do do
Another way to copy c umformulas is by using Autofill , or dragging the Fill Handlecuin
e methe cell containing the formula to
the other cell or cells inntwhich you wish to copy the formula. Autofill, which was nt
introduced earlier in this course, is
No ron belon No ron belon
u
especially useful nfor d g u d g
au copying
y@ formulas.
ini
st
oR
na y
uth @in
st
oR
tho x O o i x O
riz i n N riz i n
ed d o.c DI ed d o.c NDI
c op o H ID c op o HI
To use Autofill to copy formulas: ies .id AY ies .id DA
YA
all AT a llo T.
ow . w
ed ed
1. Enter a formula in one cell: ! !
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co I c o co ID
2. Click on the Fill Handle p,i which . DA in the bottom right cell of the selected cells:
id is located pi . id A
Th Th
is is
do do
3. Drag the Fill cHandle
um for as many rows or columns as desired: cu
en me
tb nt
No ro elo No ron belon
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie .id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
4. Release the mouse to enter the formula into the desired cells:
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho i n RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co c
pie o.id DA pie o.id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
Displaying Formulas
When working with formulas, if you wish to display the formula within its associated cell in a worksheet, in Excel
2013, selectThthe FORMULA tab and in the Formula Auditing group, select Th Show Formulas .
is is
do do
cu cu
me me
nt nt
No ron b e No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co I c o co ID
pie . id D AY pie . id AY
sa A s a AT
llo T. llo .
we we
d! d!
Th Th
is is
do do
cu cu
me
You can toggle this option on and off by selecting and de-selecting this option. me
nt nt
No ron b e No ron belon
lon
un d gs un d gs
au y@i to au y@i
Relative, Absolute, tho nix and RO Mixed Cell References tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co I c o co ID
pi . id DA pi . id A
Relative Cell References
Note that in the example above, when we copied the formula from one cell to others, the formula automatically
changed to add the cells in the corresponding rows:
3. etc...
Th Th
is is
do do
cu cu
me me
This happened because bthen t formula we entered contained Relative cell references. nt
No ron elon No ron belon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
Relative cell referencesrizare inddefault Excel. They are called "relative" because rthe in cellNrow and column
ed the o.c NDin IH
ize actual
d c do.co DI H
c o o ID o ID formula
pie .id Instead,
used in the formula are not significant. AY the significant thing is the location of the cell pie used.id in the AY
sa AT sa AT
l
relative to the location of the cell in whichl ow .
the formula is entered. l l ow .
ed ed
! !
The way to think of the formula E2 = B2 + C2 + D2 is Result = (cell 3 places to the left) + (cell 2 places to the left) +
(cell 1 place to the left) of the cell in which the Result is entered.
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i to au y@i to
t h
The way to tell Excel that n ix
ori a formula R t h
should always refer to a specific cell is to use dollar
ori n isigns
x R In the above
($).
ze indo OND ze indo OND
example, the formula we used d c F4I is
co in .cell HI =E4 / $B$1. No matter where we put this formula d co in IH
.c our worksheet, it will
pie o.id DA pie o.id ID
AY
s
divide the cell one to the left of thealcell Y
in whichATwe s AT
low . enter the formula by cell B1. all
ow .
ed ed
! !
Finally, notice that we entered the dollar sign twice in the above formula, before the "B" and before the "1". The first
$ made the column an absolute reference and the second made the row an absolute reference. In this example, it
was not actually necessary to make the column an absolute reference. The takeaway here is that when you refer to
a cell in a formula, you can make either or both of the column and row references Absolute or Relative.
Th Th
Mixed Cellis References
d
is
do
oc cu
um me
Mixed cell references eare nt a combination of relative and absolute references.
b
nt
No ron e lon No ron belon
un d gs un d gs
au y@i au y@i
Just like in absolute tcell nix to ROin mixed cell references the dollar sign ($) is
ho references, thused
o
to
nixrefer
to R a specific cell that
riz ind N riz ind toON
ed o.c DI ed o.c DI
is fixed. co HI co HI
pi o.id DA pi o.id DA
An example of a mixed cell reference would be: $F4. This would mean that the the column letter, F, is fixed, while
the row number is allowed to be copied from cell to cell.
Watch and follow along as your instructor further explains and demonstrates Absolute, Relative, and
Mixed cell references.
T Th
4. Enter ahformula
is to make marketing 25% of the first quarter's Total Income is each quarter (so all formulas refer
do do
to cell B5). cum cu
me
en nt
tb
No ron elon No ron belon
5. un
Enter a formula tod makegSupplies 20% of Total Income each quarter. un d gs
au y@i s au y@i
tho nix to RO tho nix to RO
riz i riz i
6. Use AutoSum to sum ed thendTotal
o ND ed ndo. ND
co .co.i ExpenseIH
I D
in row 10. c o co
. i
IH
ID
pie d A p i e d AY
sa YA sa AT
l T. l .
7. Use a formula to calculate NetloIncome we (Total Income - Total Expense). l o we
d! d!
8. Enter "Margin" in cell A12 and then use a formula to calculate the Margin (Net Income / Total Income).
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie . id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
Exercise TSolution
h Th
is is
do do
cu cu
me me
nt nt
be ron belon
1. Open orNgo
o u to rthe lon
on specified file. No
na dy@ gs t un d
au y@i
gs
uth
ori
ini
xin
oR
ON tho nix to RO
riz i
2. Use AutoSum to sum ze the
d c dTotal o.c Income
D in row 5. ed ndo. ND
op o.i I HID co
pi
co
. id
IH
ID
i d A A
A. Select cell B5 and click AutoSum and press Enter :
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie .id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
B. Grab the Fill Handle in cell B5 and drag the formula in cell B5 to cell E5:
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho i n RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co c
pie o.id DA pie o.id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie . id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
B. Grab the Fill Handle in cell B5 and drag the formula in cell B7 to cell E7.
T Th
4. Enter ahformula
is
do
is
to make marketing 25% of the first quarter's Total Incomedo each quarter (so all formulas refer
cu cu
to cell B5). me me
nt nt
No ron b e No ron belon
lon
A. In cellunB8, dy "=$B$5*.25": un d
au enter @ gs to au y@i
gs
tho ini
x RO tho nix to RO
riz i riz i
ed ndo. ND
IH ed ndo. ND
IH
co co I c o co ID
pi . id DA pi . id A
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
B. Grab the FillrizHandle i in cell NDB8 and drag the formula in cell B8 to cell E8.rize indo
ed ndo. IH dc
N
.co DI H
co co ID o ID
pie .id pie .id
5. sa
Enter a formula to make Supplies 20%AofYATotal Income each quarter.
T.
sa AY
AT
llo llo .
we we
d! d!
A. In cell B9, enter "=B5*.2".
B. Grab the Fill Handle in cell B9 and drag the formula in cell B9 to cell E9.
Th Th
is is
do do
cu cu
me me
nt nt
No ron be No ron belon
lon
un d gs un d gs
au y@i au y@i
tho nix to RO tho nix to RO
ri i riz i
ed ndoin
B. Grab the Fill zHandle
ND ed ndo. ND
co .cocell . id
B11
I H and drag the formula in cell B11 to cell E11.
I D c o co
. id
IH
ID
pie AY pie AY
sa A s a AT
l l o T. l l o .
8. Enter "Margin" in cell A12 and then we use a formula to calculate the Margin (Net Income / Total weIncome), which
d! d!
should be displayed as a percent.
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pi o.id DA pi . id ID
A
C. Grab the Fill Handle in cell B12 and drag the formula in cell B12 to cell E12.
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie .id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
Th Th
is is
do do
9. cu
Make any necessary formatting changes. cu
me me
nt nt
N ro b elo No ron belon
10. Save theoworkbook.
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co c
pie o.id DA pie o.id ID
AY
sa YA sa AT
Conclusion l low
ed
T. llo
we .
! d!
In this lesson, you learned about math operators and the order of operations, to enter basic formulas, to use
AutoSum to sum data with one click, about absolute, relative, and mixed cell references, and to copy formulas and
functions.
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pie o.id DA pie . id ID
AY
sa YA sa AT
llo T. llo .
we we
d! d!
Th Th
is is
do do
cu cu
me me
nt nt
No ro be No ron belon
lo
un ndy@ ngs un d gs
au to au y@i
tho in RO tho nix to RO
riz ixind riz i
ed o.c NDI ed ndo. ND
IH
co HI co co
pi o.id DA pi . id ID
A