You are on page 1of 20

The PMT( ) Function in Excel

The PMT( ) function expects certain values in between its two round brackets. The values that go in round brackets are
known as arguments. The arguments for the PMT( ) function are these:
PMT(rate, nper, pv, fv, tpe)
!nl the first three are needed, and ou can miss the final two out, if ou like.
"e#ll work out our monthl loan costs with the help of the PMT( ) function. $irst, create a new spreadsheet like the one
below:
%f ou look at cell &' on the spreadsheet, ou#ll see a figure of ('), ))). This is the amount we want to borrow. The
labels on *ow + show what else we need: ,n interest rate, the number of paments we#ll make over the - ears, the
present value of the loan, the amount we#ll have to pa back each month, and the total amount paid back after - ears.
&ut we onl need the first three for our PMT() function.
%n cell ,., we#ll need an interest rate. %n cell &. we#ll need the number of paments, and in cell /. we#ll need the
Present 0alue of the loan. $irst is interest rate.
%magine that the interest rate given to us b the bank is 1. percent per ear. $or the PMT( ) function, we need to divide
this figure b '1 (the number of months in a ear) 2o tr this:
3lick into cell ,. on our spreadsheet
4nter the following formula:
= 24% / 12
5it the enter ke to see the answer appear, as in the image below:
6ow that we have an interest rate, the next thing we need for the PMT( ) function is how man paments there are in
total. "e have to pa something back ever month for - ears. "hich is a simple formula. 2o,
3lick into &. on our spreadsheet and enter the following:
= 12 * 5
5it the enter ke to see a figure of 7) as the answer.
This figure of 7) is for the second argument of the PMT( ) function 8 the nper. This is 9ust the number of paments.
6ow that ou have a figure in cell ,. (rate), and a figure in cell &. (nper), there#s onl one more to go 8 the Present
0alue (pv).
The Present 0alue of a loan, also known as the Principal, is what the loan is worth at the present time. 2ince we haven#t
made an paments et, this is 9ust '), ))) for us.
3lick into cell 3. on our spreadsheet and enter the following:
= B1
5it the enter ke
:ou#ll see a figure of '), ))) appear, and our spreadsheet should now look ours below:
!;, we now have all the parts for our PMT() function: a rate (,.), an nper (&.), and a pv (3.). Tr this:
3lick into cell /. on our spreadsheet
4nter the following function:
=PMT(4! B4! "4)
5it the enter ke on our keboard, and ou#ll see the monthl amount appear. The figure ou should have is 8(1<=.7<.
The reason there is a minus sign before the total is because it#s a debt: what ou owe to the bank.
&ut this is what our spreadsheet should look like:
The onl thing left to do is see how much this loan will cost us at the end of - ears. ,ll ou need to do here is multipl
the monthl amount in cell /. b the number of paments in cell &.. 4nter our formula for this in cell 4., and ou
spreadsheet will look like ours below:
2o a ten thousand pounds loan, at the interest rate the bank is offering, means we#ll have to pa back 9ust over '=
thousand pounds over - ears.
T#ea$in% the &alue'
"e can change the spreadsheet slightl to give us more control. $or our figure in cell &., the number of paments,
ou entered '1 > -. This is '1 months multiplied b - ears. &ut what if we wanted to pa the loan back over ') ears,
or '-? 5ow much will our monthl paments then be? ,nd will be the final cost of the loan?
,lso, the interest rate seems a bit high. "hat if we can get a better rate elsewhere?
& making a few changes to or spreadsheet, we can amend these values more easil. $irst we#ll need two new rows.

(n'ertin% )e# *o#' in Excel
"e need to insert new rows in our spreadsheet. To insert a new row, click into cell ,1. Then click on the +o,e tab at
the top of 4xcel. @ocate the "ell' panel, and click the (n'ert item:
$rom the %nsert menu, click on (n'ert -heet *o#':
4xcel will insert a new row for ou. /o this again to get two blank rows. ,dd two new labels, )u, o. /ear' and
(ntere't. :our spreadsheet sheet will then look like this:

0aptin% the PMT For,ula
"e can adapt the formulas we#ve entered so far, in order to make them more usable. ,s an example, we#ll adapt the
interest rate.
To get the interest rate for cell ,., we entered a formula:
= 24% / 12
%nstead of having the interest rate in cell ,., however, we can place it at the top, in cell &+ on our new *ow. "e can
then alter the interest rate b simpl tping a new one in cell &+. To clear all that up, tr the following:
3lick inside cell &+, which is the %nterest cell in the image above
3lick inside the formula bar
Tpe in A 1.B
3ell &+ should now read 1..))B (%n 4xcel 1)') ou ma have to format the cell to a Percentage value from the
5ome tab then the 6umer item.)
To change the formula for our interest rate click inside of cell ,7. 3hange the formula from this:
= 24% / 12
to this:
= B1 / 12
5it the enter ke on our keboard and nothing should change on our spreadsheet. &ut the difference is that ou can
enter a new interest rate in cell &+, and see how this effects the loan amounts. Tr it out b tping 1+B in cell &+:
,s ou can see, the interest rate has changed to a rather long figure. &ut notice the Monthl ,mount 8 it has gone down
to (1<'.C). The total amount we have to pa back has changed, too. Pla around with the interest rate in cell &+, 9ust to
get a feel for how it works.
Exerci'e
%n cell &7 of our spreadsheet, ou have the following formula:
= 12 * 5
This calculates the number of months for the loan. 3hange this formula so that the number of ears is coming from &1.
:our finished spreadsheet should look like ours below:
%f ou pla around with the values in cells &', &1 and &+ ou should be able Duickl see the new loan repaments.
Assignment
2tud the following spreadsheet:
The spreadsheet is the school exam marks of < students. , total of < sub9ects were taken. $or this review, work out the
,verages for all < sub9ects studied, which is in the ; column above. ,lso, work out the !verall ,verages for each
student (row '' above).
The first thing to do is to recreate the spreadsheet above. :ou can then use one of the methods for working out ,verages
that ou have explored in this section. :ou#re going to be needing our completed spreadsheet in the next section 8 so
don#t skip itE
The IF Function in Excel 2007
The %$ function can be Duite useful in a spreadsheet. %t is used when ou want to test for more than one value. $or
example, has a bill been paid or not? %f it has, ou can deduct the amount from the mone ou have left to spendF if it
hasn#t, keep it on our debt list. @ater, ou#ll see how to use the %$ $unction to grade student exam scores. %f the student
has above <), award an , gradeF if the student has below +), award a fail grade. $irst, here#s what an %$ $unction looks
like:
(F(lo%ical2te't! value2i.2.al'e! value2i.2true)
The thing to note here is the three items between the round brackets of the word %$. These are the arguments that the %$
function needs. 5ere#s what the mean:
logical_test
The frst argument is what you want to test for. Is the number in the cell greater than 80, for
example?
value_if_true
This is what you want to do if the answer to the frst argument is Y!. "#ward an # grade, for
example$
value_if_false
This is what you want to do if the answer to the frst argument is %&. "#ward a '#I( grade.$
%f that#s not terribl clear, an example ma clear things up. !pen a new spreadsheet, and do the following:
)iden the * column a bit, as we+ll be putting a message in cell *,
%ow clic- in cell #, and type the number .
Type the following in the formula bar "The right angle brac-et after #, means /0reater Than/.$
=IF(A1 > 5 !"reater than Five! !#ess than Five!$
5it the enter ke on our keboard and our spreadsheet should look like ours below:
(Make sure ou have all the commas and double Duotes in the correct place, otherwise 4xcel will give ou an error
message. That right angle bracket ( G ) is known as a 3onditional !perator. :ou#ll meet some others shortl.)
&ut what we#re saing in the %$ function is this:
logical1test2 Is the 3alue in cell #, greater than 4?
3alue1if1true2 If the answer is Yes, display the text /0reater than 'i3e/
3alue1if1false2 If the answer is %&, display the text /(ess than 'i3e/
2o our first tell 4xcel what ou want to check the cell for, then what ou want to do if the answer is :42, and finall
what ou want to do if the answer is 6!. :ou separate each part with a comma.
Exerci'e
Tr this:
3lick into cell ,'
3hange the 7 into a .
5it the enter ke on our keboard
"hat happens?
Exerci'e
6ow tpe the number - in cell ,'. "hat happens now?
$or the last exercise above, 4xcel should tell ou that - is H@ess than -HE %t does this because the answer to our logical
test was 6!. "e were testing if the number in cell ,' was greater than -. 2ince - is not greater than -, the answer to
the Duestion is 6!. "e#ve told 4xcel to displa a message of H@ess than -H, if the answer was 6!. %n other words, we
didn#t tell 4xcel what to do if the value in cell ,' was the same as -.
The solution to this is to use a different 3onditional !perator. "e used the Ireater Than ( G ) operator. 5ere#s some
more:
J @ess Than
GA Ireater than !r 4Dual To
JA @ess than !r 4Dual To
JG 6ot 4Dual To
$or the second and third operators above, ou tpe an angle bracket followed b the eDuals sign. There are no spaces
between the two. $or the final one, it#s a left angle bracket followed b a right angle bracket.
2o for our exercise, the smbol we should have used was the one for Ireater than !r 4Dual To. 3hange our %$
function to this and tr again:
=(F(1 3= 5! 45reater than or E6ual to Five4! 47e'' than Five4)
Exerci'e
Test the ,' cell to see if the value is less than or eDual to -. %f it is, displa a suitable message. %f it#s not, displa the
message HIreater than $iveH.
"o,plex (. Function'
The %f $unctions ou#ve 9ust met are consider fairl simple ones. The can get reall complexE
3onsider our 2tudent 4xam problem. The spreadsheet we created to track our students looks like this, from an earlier
section:
5owever, we want to displa the following grades as well:
%f the student scores <) or above
B %f the student scores 7) to =C
" %f the student scores .- to -C
8 %f the student scores +) to ..
F(7 %f the student scores below +)
"ith such a lot to check for, what will the %$ $unction look like? 5ere#s one that works:
=(F(B23=9:! 44! (F(B23=;:! 4B4! (F(B23=45! 4"4! (F(B2 3=1:! 484! 4Fail4 ) ) ) )
Kuite long, isn#t it? @ook at the colours of the round brackets above, and see if ou can match them up. "hat we#re
doing here is adding more %$ $unctions if the answer to the first Duestion is 6!. %f it#s :42, it will 9ust displa an H,H.
&ut take a look at our 2tudent 4xam spreadsheet now:
,fter the correct answer is displaed in cell &'. on the spreadsheet above, we used ,uto$ill for the restE
/on#t worr if that long %$ statement is making our brain hurt 8 it is Duite complicated.
%on&itional For'atting
:ou can use something called 3onditional $ormatting in our 4xcel spreadsheets. 3onditional $ormatting allows ou
to change the appearance of a cell, depending on certain conditions. "hat we#ll do is to colour the !verall ,verages on
our 2tudent 4xam spreadsheet, depending on the grade. 5ere#s the spreadsheet we#ll be working on.
!pen up our 2tudent 4xam spreadsheet (:ou did complete it, didn#t ou?)
5ighlight the cells with !verall Irades, which should be cells &'' to %''
The !verall ,verages range from .. to <-. "e#ll colour each grade, depending on a scale. , different colour will appl
to the following grades:
-) and below
-' to 7)
7' to =)
=' to <)
<' and above
2o five different bands, and a colour for each. To set the 3onditional $ormatting in 4xcel, do the following:
"ith our !verall ,verages highlighted, click on the 5ome menu at the top of 4xcel
@ocate the -t<le' panel, and the "on0itional For,attin% item:
The 3onditional $ormatting menu gives ou various options. The easiest one is the 3olour 2cales option. 2elect one of
these and 4xcel will colour the cell backgrounds for ou:
That#s not Duite what we#re looking for, though. "e#d like to choose our own values. 2o click on More *ule', from the
"olour -cale' submenu. :ou#ll see the following rather complex dialogue box:
The one we want is the second option, For,at onl< cell' that contain. This will allow us to set up our values. "hen
ou click this option, the dialogue box changes to this:
The part we#re interested in is the bottom part, under the heading E0it the *ule 8e'cription. %t sas "ell &alue and
Bet#een, in the drop down boxes. These are the ones we want. "e onl need to tpe a value for the two boxes that are
currentl blank in the image above. "e can then click the For,at button to choose a colour.
2o tpe ) in the first box and -) in the second one:
Then click the For,at button. :ou#ll get another dialogue box popping up. This is 9ust the $ormat 3ells one though.
:ou#ve met this before. 3lick on the $ill tab and choose a colour. 3lick !; and ou should see something like this
under 4dit the *ule /escription:
The Preview is showing the colour we picked. 2o we#ve said, H(. the 3ell 0alue is between ) and -) then colour the
cell *edH.
3lick !; on this dialogue box to get back to 4xcel. :ou should find that one of the cells has turned red. To format the
rest of the cells, click on 3onditional $ormatting on the 2tles panel again. $rom the menu, click on Mana%e *ule':
:ou#ll get et another complex dialogue box popping upE This one:
!ur first rule is alread there 8 3ell 0alue &etween. The onl thing we#re doing here is adding 6ew *ules, similar to the
one we#ve 9ust set up. 3lick the )e# *ule button then. :ou#ll see the exact same dialogue boxes ou used to set up the
first rule. 2et a new colour for the next scores 8 -' to 7). 3hoose a colour, and keep clicking !; until ou get back to
the *ules Manager dialogue box. %t should now look something like this one:
"e now have to colours in our range. /o the rest of the scores, choosing a colour for each. The scores are these,
remember:
-) and below
-' to 7)
7' to =)
=' to <)
<' and above
"hen ou#ve done them all, our dialogue box should have five colours:
The colours above are entirel arbitrar, and ou don#t have to select the same ones we did. The point is to have a
different colour for each range of scores. &ut click !; when ou#re done. :our !verall ,verages will then look
something like this:
$ormatting our spreadsheet in this wa allows ou to see at a glance relevant information. %n the spreadsheet above,
it#s obvious who#s failing 8 9ust look for the red cellsE
%ountIF in Excel
,nother useful function that uses 3onditional @ogic is 3ount%$. This one is fairl straightforward. ,s its name
suggests, it counts thingsE &ut it counts things %$ a condition is met. $or example, keep a count of how man students
have an , Irade.
To get ou started with this function, we#ll use our 2tudent Irade spreadsheet and count how man students have a
score of =) or above. $irst, add the following label to our spreadsheet:
,s ou can see, we#ve put our new label at the start of the ; column.
"e can now use the 3ount%$ function to see how man of the students scored =) or above for a given sub9ect.
The 3ount%$ function looks like this:
"=>)T(F(range, criteria)
The function takes two arguments (the words in the round brackets). The first argument is range, and this means the
range of cells ou want 4xcel to count. 3riteria means, H"hat do ou want 4xcel to look for when it#s counting?H.
2o click inside cell ;1, and then click inside the formula bar at the top. 4nter the following formula:
="ount(.(&1:%1! 4GA =)4)
The cells &1 to %1 contain the Math scores for all < students. %t#s these scores we want to count.
Press the enter ke on our keboard. 4xcel should give ou an answer of .:
(%f ou#re wondering where the columns & to % have gone in the image above, we#ve hidden then for convenience sakeE)
To do the rest of the scores, ou can use ,uto$ill. :ou should then have a ; column that looks like this:
& using 3ount%$, we can see at a glance which sub9ects students are doing well in, and which sub9ects the are
struggling in.
Exerci'e
,dd a new label to the @ column. %n the cells @1 to @C, work out how man students got below -) for a given sub9ect.
:ou should get the same results as in the image below:
(u'IF
,nother useful 4xcel function is 2um%$. This function is like 3ount%f, except it adds one more argument:
->M(F(ran%e! criteria! 'u,2ran%e)
*ange and criteria are the same as with 3ount%$ 8 the range of cells to search, and what ou want 4xcel to look for. The
2umL*ange is like range, but it searches a new range of cells. To clarif all that, here#s what we#ll use 2um%$ for. (2tart
a new spreadsheet for this.)
$ive people have ordered goods from us. 2ome have paid us, but some haven#t. The five people are 4lisa, ;ell, 2teven,
4uan, and 5oll. "e#ll use 2um%$ to calculate how much in total has been paid to us, and how much is still owed.
2o in 3olumn ,, enter the names:
%n 3olumn & enter how much each person owes:
%n 3olumn 3, enter T*M4 or $,@24 values. T*M4 means the have paid up, and $,@24 means the haven#t:
,dd two more labels: Total Paid, and 2till !wed. :our spreadsheet should look something like this one:
%n cells &') and &'', we#ll use a 2um%$ function to work out how much has been paid in, and how much is still owed.
5ere#s the 2um%$ function again:
->M(F(ran%e! criteria! 'u,2ran%e)
2o the range of cells that we want to check are the True and $alse values in the 3 columnF the criteria is whether the
have paid (True)F and the 2umL*ange is what we want to add up (in the & column).
%n cell &'), then, enter the following formula: =->M(F("1?"@! T*>E! B1?B@)
"hen ou press the enter ke, 4xcel should give ou the answer:
2o 17- is has been paid in. &ut we told 2um%$ to first check the values in the cells 3+ to 3= (range). Then we said look
for a value of T*M4 (criteria). $inall, we wanted the values in the & column adding up, if a criteria of T*M4 was
indeed found (sumLrange).
Exerci'e
Mse 2um%$ to work out how much is still owed. Put our answer in cell &''.
"e#ll leave the sub9ect of 3onditional @ogic. %n the next section, more things ou can do with 4xcelE
"ount' the nu,Aer o. cell' #ithin a ran%e that ,eet the %iven criteriaB
()ntax
"=>)T(F(ran%e,criteria)
*an%e is the range of cells from which ou want to count cells.
"riteria is the criteria in the form of a number, expression, cell reference, or text that defines which cells will be
counted. $or example, criteria can be expressed as +1, H+1H, HG+1H, HapplesH, or &..
*e'ar+s
You can use the wildcard characters, 5uestion mar- "?$ and asteris- "6$, in criteria. # 5uestion
mar- matches any single character7 an asteris- matches any se5uence of characters. If you want
to fnd an actual 5uestion mar- or asteris-, type a tilde "8$ before the character.
9icrosoft xcel pro3ides additional functions that can be used to analy:e your data based on a
condition.
To calculate a sum based on a string of text or a number within a range, use the !;9I'
wor-sheet function.
To ha3e a formula return one of two 3alues based on a condition, such as a sales bonus
based on a specifed sales amount, use the I' wor-sheet function.
To count cells that are empty or not empty, use the <&;%T# and <&;%T*(#%= functions.
Exa',le 1- %o''on %./0TIF for'ulas
The example ma be easier to understand if ou cop it to a blank worksheet.

1
2
1
2
5
A 3
4ata 4ata
apples >?
oranges 4@
peaches A4
apples 8.
For'ula 4escri,tion (result$
B<&;%TI'"#?2#4,/apples/$ %umber of cells with apples in the frst column abo3e "?$
B<&;%TI'"#?2#4,#@$ %umber of cells with peaches in the frst column abo3e ",$
B<&;%TI'"#?2#4,#>$C<&;%TI'"#?2#
4,#?$
%umber of cells with oranges or apples in the frst column
abo3e ">$
B<&;%TI'"*?2*4,/D44/$
%umber of cells with a 3alue greater than 44 in the second
column abo3e "?$
B<&;%TI'"*?2*4,/ED/F*@$
%umber of cells with a 3alue not e5ual to A4 in the second
column abo3e "?$
B<&;%TI'"*?2*4,/DB>?/$G
<&;%TI'"*?2*4,/D84/$
%umber of cells with a 3alue greater than or e5ual to >? and
less than or e5ual to 84 in the second column abo3e ">$
Exa',le 2- %./0TIF for'ulas using 5il&car& characters an& han&ling 6lan+
values
The example ma be easier to understand if ou cop it to a blank worksheet.

1
2
1
2
5
7
7
A 3
4ata 4ata
apples Yes

oranges %&
peaches %o

apples Ye!
For'ula 4escri,tion (result$
B<&;%TI'"#?2#A,/6es/$
%umber of cells ending with the letters /es/ in the frst
column abo3e "@$
B<&;%TI'"#?2#A,/?????es/$
%umber of cells ending with the letters /les/ and ha3ing
exactly A letters in the frst column abo3e "?$
B<&;%TI'"#?2#A,/6/$ %umber of cells containing text in the frst column abo3e "@$
B<&;%TI'"#?2#A,/ED/F/6/$
%umber of cells not containing text in the frst column abo3e
"?$
B<&;%TI'"*?2*A,/%o/$ H I&)!"*?2*A$
The a3erage number of %o 3otes including blan- cells in the
second column abo3e formatted as a percentage with no
decimal places ">>J$
B<&;%TI'"*?2*A,/Yes/$ H
"I&)!"*?2*A$ G<&;%TI'"*?2*A,
/ED/F/6/$$
The a3erage number of Yes 3otes excluding blan- cells in the
second column abo3e formatted as a percentage with no
decimal places "40J$
)ote To view the number as a percentage, select the cell and click "ell' on the For,at menu. 3lick the )u,Aer
tab, and then click Percenta%e in the "ate%or< box.

You might also like