Download presentation
Presentation is loading. Please wait.
Published byLesley Watkins Modified over 9 years ago
1
Spreadsheets in Finance and Forecasting Week 5: Using Functions
2
Objectives After working through the materials for week 5 you will be able to: Get Help from Excel on a range of issues, including how to use functions and other commands Understand an use a wide range of different functions in Excel, including arithmetic, text, statistical,utility and financial functions
3
Getting Help from Excel From this point on in the module you will need to consult with Excel help files on a regular basis. To get well-focussed help from Excel you need to turn off the office assistant. Click on Options and de-select the tick bock for “Use the Office Assistant”
4
The Excel Help Files Now press F1, and these help files appear. You have a full Excel manual This can be accessed via: Contents Answer Wizard Index
5
Example of a Help File This is an example of one of the help topics. This can be found in “Creating Formulas”, then “Entering Formulas”, then “How formulas create values”
6
Functions in Excel A function can be thought of as a tool for doing a specific task. For example, instead of typing in a string of additions: A1+A2+A3+A4, we can use the SUM function: SUM(A1:A4)
7
Types of Functions CategoryFunction examples Purpose Time NOW( ) WEEKDAY Provides dates and times etc. Maths EVEN RAND( ) Calculation Tools Statistical AVERAGE COUNT Summary of Data Database DMIN DMAX Selection and manipulation of data Financial PMT PV Monetary and financial formulae Logical AND, OR IF To make decisions
8
Time Functions Two interesting functions are: NOW() This yields the current date and time WEEKDAY (Date) This yields a number corresponding to the date input 1=Sunday, 2=Monday, 3=Tuesday etc.
9
Time Functions We can use the function TEXT to extract the day of the week: =TEXT( NOW(), “dddd”)
10
Time Functions There are many more functions to investigate Try looking up: DATEDIF WORKDAYS YEARFRAC
11
Arithmetic Functions There are two functions for dealing with decimals: TRUNC This truncates a number at the decimal point, removing the fractional part. ROUND This rounds a number, either rounding up or rounding down, according to convention The format is ROUND( value, number of dec. places required)
12
Arithmetic Functions Examples: suppose A5 contains the number 3.262 TRUNC TRUNC(A5) yields the answer 3. ROUND ROUND(A5, 1) gives the answer 3.3 ROUND(A5, 2) gives the answer 3.26
13
Arithmetic Functions Functions related to division: QUOTIENT This gives the whole number part of the answer when one number is divided by another. MOD This gives the remainder when one number is divided by another
14
Arithmetic Functions Examples: QUOTIENT Format for this function is: QUOTIENT(numerator, denominator) e.g QUOTIENT( 27, 4) gives the answer 6 MOD Format for this function is MOD(Numerator, denominator) e.g. MOD(27,4) gives the answer 3
15
Functions Examples Download the spreadsheet: Functions Examples.xls The first Challenge is to create a section of a spreadsheet which inputs two dates and calculates the difference between the dates in weeks and days Action Point
16
Utility Functions 1 These functions are useful in telling you information about the data in the spreadsheet cells COUNT this counts how many cells in the range contain numbers COUNTA this counts how many cells within a particular range contain some sort of information COUNTBLANK this counts how many cells within a particular range are blank
17
Counting Cells COUNT(A1: D4) gives: COUNTA(A1:D4) gives: COUNTBLANK(A1:D4) gives:
18
Counting Cells COUNT(A1: D4) gives: 10 COUNTA(A1:D4) gives: 14 COUNTBLANK(A1:D4) gives: 2
19
Utility Functions 2 These functions are useful in telling you information about the data in specific spreadsheet cells. They return TRUE or FALSE ISBLANK tells you whether a specific cell is empty ISNUMBER tells you whether a specific cell contains a numerical entry ISTEXT Tells you whether a particular cell contains text
20
What’s in the cell? ISBLANK(D4) gives: ISNUMBER(B1) gives: ISTEXT(A4) gives:
21
What’s in the cell? ISBLANK(D4) gives: FALSE ISNUMBER(B1) gives: TRUE ISTEXT(A4) gives: TRUE
22
Functions Examples The next page on the Functions Examples spreadsheet challenges you to count the numbers of different items in cells: Action Point
23
Look Up Tables Look Up Tables are one of the most useful features of Excel. These tables allow you to select from of a list of options using a particular value as a reference The simplest of the functions is LOOKUP LOOKUP(cell, range)
24
Look Up Tables For example: A company sell 4 different sizes of roofing slate: A, B,C, D, E Costs per slate are given in the look-up table opposite We read off the cost for D, by looking up the value in the table SizeCost A£0.45 B£0.70 C£0.95 D£1.10 E£1.25
25
Look Up Tables The contents of the look-up table is place in cells B3 to C7 In cell B10 we have a type of slate for which we need to know the cost In cell C10 we put: =LOOKUP(B10, B3:C7) Action Point
26
The LOOKUP function The other use of this function is to look up a cost in a table to find an amount For example if we are willing to spend £1.00 per slate, what is the best quality that we can afford? What function should be put in this cell to look up the cost in the table above? Action Point
27
The LOOKUP function The other use of this function is to look up a cost in a table to find an amount For example if we are willing to spend £1.00 per slate, what is the best quality that we can afford? Solution: LOOKUP(G10,G3:H7) NB The answer is C because as Excel reads down the table that is the best quality for the price.
28
The LOOKUP function The table must be in alphabetical or numerical order There are two columns of figures We look down column 1, find the and then read off the value in column 2
29
VLOOKUP VLOOKUP is an extension of the idea, allowing you to create blocks of cells which contain different lookup values for different circumstances
30
VLOOKUP The simplest format for VLOOKUP is VLOOKUP(cell, range, column number) This looks up the value required in the first column of table, and reads the value from the column specified VLOOKUP (B10, B3:D7, 3) will give the New Price, by looking up D in the first column, and reading across to column 3
31
HLOOKUP HLOOKUP has the same kind of structure, except that the table is formatted horizontally instead of vertically Format:HLOOKUP(cell, table, row) HLOOKUP(B10, C3:G6, 4) will give the 2001 price for the slate
32
Naming Cells and Ranges We have seen previously that it is possible to label cells with names. It is equally possible to label ranges of cells in the same way Highlight the cells Click on here and insert a name
33
Using Name Ranges in Formulae The highlighted area of the table has been called Slates To get the old price in the cost cell: VLOOKUP(B11, Slates, 2) To get the new price in the cost cell: VLOOKUP(B11, Slates, 3)
34
Functions Examples The Functions Example spreadsheet contains a worksheet called dresses. You should now create the lookup formulae for this page. Action Point
35
Other Table Functions MATCH This looks for a specific value in a single column or row, and returns a number that indicates the position in an ordered list. e.g MATCH( D5, D1:D10) returns the position that D5 would have if the set of values D1 to D10 were placed in ascending order If the matching is done with text, MATCH yields the position of the text in the list.
36
MATCH MATCH(B6,B3:B7) yields the value 2, because that is the second value if the goods were placed in order of price. However, MATCH(“Tie”, C3:C7) also yields the value 2, because Tie is the 2 nd item in the unordered list.
37
Other Table Functions INDEX This function returns the value of a cell which is located within a named range of cells INDEX(range, row, column) gives the contents of a particular cell at the intersection of the row and column of a block of cells
38
INDEX INDEX(Slates, 3,2) gives the value £0.70, as it is at the intersection of row 3 and column 2 of the Slates Range of Cells
39
Logical Functions IF This is a very important function, as it allows us to make conditional statements. The Function has the structure: IF(condition, statement 1, statement 2) If the condition is satisfied, statement 1 is executed, otherwise statement 2 is executed. For example, IF(A2>40, “Pass”,”Fail”)
40
Logical Functions COUNTIF This function combines the idea of an “if” statement with the counting functions Format:COUNTIF( range, condition) Example: COUNTIF(A1:E5, “>100”) counts how many cells in the block A1 to E5 contain values greater than 100
41
Functions Examples The Functions Example spreadsheet contains a worksheet called Dice. Create a formula to calculate the values required. Action Point
42
Logical Functions AND and OR These functions are important conditional test tools, which allow us to combine events: To test whether A1>0 and B1>0, we would use the construction: AND(A1>0, B1>0) if both were true the AND function would yield a TRUE result. OR(A1>0,B1>0) yields a true result if either A1>0, B1>0 or both A1>0 and B1>0.
43
Putting it together: Look at the function: IF(OR(A1<0,B1<0),”One is negative”,A1*B1) This tests whether either A1 or B1 is negative, and if so, puts the a message in the cell to that effect. On the other hand, if both are positive, the two values are multiplied together and the answer put in the cell.
44
Functions Examples The Sales Returns Worksheet gives the performance figures of 5 salespeople during 2000 and 2001; you are asked to create formulae to test a variety of conditions. Action Point
45
Text Functions CONCATENATE This is a function used to glue together two or more pieces of text as output in a cell CONCATENATE(“The answer is “, C5) If the numerical value of cell C5 is 3.142, then the text created would say: The answer is 3.142 An alternative is to use the ampersand sign: & =“The answer is “ & C5
46
Text Functions MID This function reads a piece of text and extracts part of it. The format is: Mid( text, start, number of letters) For example, suppose the cell A5 contained the word “Spreadsheet” Mid(A5,3,5) would yield the word “reads”
47
Text Functions Example Suppose that: Cell A1 contains the text: SPREADSHEET Cell A2 contains a whole number from 1 to 11. At the moment the value is 5. What code would you put in cell B10 so that the text would read: The letter in position number 5 is A and that when you put 9 in B10, the text reads: The letter in position number 9 is E
48
Text Functions Example Cell A1 contains the text: SPREADSHEET, Cell A2 contains a whole number from 1 to 11. In cell B10 the code might read: = “The letter in position number “ & A1 & “ is “ & MID(A1,A2,1) Alternatively: = CONCATENATE(“The letter in position number “, A1, “ is “, MID(A1,A2,1))
49
Statistical Functions We have already used some of these functions: MINgives the minimum value from a range, MAXgives the maximum value from a range SUMsums a range of values STDEVreturns the standard deviation AVERAGE returns the average of the values e.g. MAX(C2:C40),SUM(A1:D300) etc.
50
Financial Functions DB This function calculates the depreciation of an asset for the fixed-declining depreciation period. The format is DB(initial cost, salvage, life, period) For example: DB( 5000, 1000, 10, 3) calculates the amount that needs to be written off in year 3 of a car bought for £5000, and expected to have a salvage value of £1000 at the end of 10 years
51
Financial Functions PMT This function calculates the payment for a loan based on constant payments at constant interest rate Format: PMT(int. rate, no. of payments, pres. value) For example: PMT(8%/12, 12, 10000) calculates the monthly payments on a loan of £10000 that must be paid back in 12 months at a rate of 8% per annum.
52
Financial Functions FV This is the future value of an investment based on regular constant payments and a constant interest rate. Format: FV(int. rate, no. of payments, payment value) For example: FV(4%, 25, -2500) the future value of an investment in which you make 25 yearly payments of £2500 and a constant interest rate of 4% per annum. NB the value of the payments is required to be accounted as negative, as these are outgoing payments.
53
Functions Examples The Financial page of the worksheet challenges you to create the financial functions to work out the solutions to a variety of problems. Action Point
54
More Functions Excel contains literally hundreds of functions, some of which are quite similar to, and may of which are very different from the ones in this lecture. In particular, as you look through the Excel help files, you will notice that we have been using only one form of these functions; each one has many variants.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.