excel lessons advanced time (1)

Upload: singhsdh

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Excel Lessons Advanced Time (1)

    1/12

    Spreadsheet Manual

    Level 3

    Page 1 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    2/12

    ContentsCONTENTS....................................................................................................................................................................2

    WHY USE A SPREADSHEET?..................................................................................................................................3

    PLANNINGTOUSEASPREADSHEET................................................................................................................................3

    BACKGROUND...........................................................................................................................................................3

    FINANCIAL FUNCTIONS (FV, NPER, IPMT & PMT).........................................................................................4

    FV (FUTURE VALUE)................................................................................................................................................4NPER (NUMBEROFPERIODS)....................................................................................................................................4IPMT (INTEREST PAYMENT)......................................................................................................................................5PMT.......................................................................................................................................................................5

    LOGICAL FUNCTIONS..............................................................................................................................................6

    COMBINING AND/ORWITH IF FUNCTIONS.................................................................................................................7NON-NESTED IFS A REMINDER................................................................................................................................7NESTED IFS..............................................................................................................................................................7

    DATE AND TIME FUNCTIONS AND FORMATS.................................................................................................9HOW EXCELSTORESDATES.........................................................................................................................................9TIPSONENTERINGDATESANDTIMES.............................................................................................................................9AMERICANAND ENGLISH DATES..................................................................................................................................9CUSTOMFORMATCODESFORDATESANDTIMES..............................................................................................................924 HOURAND 12 HOURCLOCKS..............................................................................................................................10ENTERINGACUSTOMFOMAT......................................................................................................................................10DATESINFORMULAE................................................................................................................................................11TODAY FUNCTION...............................................................................................................................................11HOUR, MINUTE, SECOND FUNCTIONS.............................................................................................................11HOUR, MINUTE, SECOND PRACTICAL EXAMPLE............................................................................................11

    CONDITIONAL FORMATTING.............................................................................................................................12

    SIMPLEEXAMPLEOF CONDITIONAL FORMATTING..........................................................................................................12

    Page 2 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    3/12

    Why use a spreadsheet?Why would you choose to use a spreadsheet to do a task rather than do it some other way?There may be several alternative solutions to solving a problem that involves calculations. They are:1. Manual calculation pen, paper and calculator2. Database3. Word Processor

    4. Program a dedicated program written in a programming language such as Visual Basic

    You should choose to use a spreadsheet when a task largely involves calculations. A spreadsheet is more suitablethan a database or word processor for this purpose and is less time consuming than writing a program fromscratch eg Visual Basic.

    In this course the sort of tasks you want to use a spreadsheet for are to: Perform calculations on rows and columns of data. Make logical decisions using mathematical operators and in-built functions. Store and manipulate dates Change data Format to for a professional appearance Present trends as graphs and charts Output to a printer

    Planning to use a spreadsheet.There is no point in trying to solve a problem with a spreadsheet if you dont understand how to solve the

    problem manually and you are unaware of the features of a spreadsheet application that you could use.

    Below is a list of what you should plan before you start to solve a spreadsheet problem:Plan includes:1. Headings2. Labels3. Formats

    4. Formulae5. Functions6. Where relative and absolute references are to be used

    BackgroundThis manual assumes you have completed all the exercises in the Hagley Community College Excel Manual andare familiar with the following spreadsheet functions:1. Sum2. Max3. Min4. Average5. Count

    6. CountA7. CountIF

    You must be able to apply your knowledge of:1. Relative and absolute addressing2. Cell formatting

    Page 3 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    4/12

    Financial Functions (FV, NPER, IPMT &PMT)These financial functions relate to loans, and investments.Microsoft Excel has 54 financial functions. We are going to look at the four functions. By familiarizing yourselfwith these functions you should be able to follow any others you come across in the future.

    FV (Future Value)Future Value calculates the value of an investment after a given period of time. It assumes that payments andinterest rates do not alter.The syntax is: FV(Rate, Nper, PMT, PV, Type)

    Rate

    This is the interest paid. Most interest payments are on ayearly basis, with monthly payments therefore the interestmust be divided by 12. Eg. If the interest rate is 8% yearlythen the monthly interest = 8%/12Nper

    This is the number of periods the payment is spread over. If

    payment is made monthly and the investment is over 5 yearsthen the number of periods will = 5 x 12Pmt

    This is the payment made that includes principal and interest.Any money paid out has a negative value.Assume the payment is $200 dollars then pmt will be 200

    Pv

    This is the present value. This could be the value of an initial deposit. Eg $2000. If PV is not entered its defaultis zero. This is money paid in therefore it too has a negative value of -2000Type

    This has values 1 and 0. O = at the end of the pay period, 1= beginning of pay the period. Zero is the moreusual and is the default value if nothing is entered.

    ExampleFred wants to buy another car so he invests $2000.00 dollars at 8% interest rate for two years. He is going to payin $200 each month.=FV(8%/12, 2*12, -200, -2000,0) Result is $7,532.41

    NPER (Number of periods)Syntax =Nper(Rate,Pmt,Pv,Fv,Type)

    NPER returns the number of periods for an investment based on periodic, constant payments and a constantinterest rate. This could be the number of months to pay off a loan.

    Rate

    Is the interest rate per period. Eg. month.

    Pmt

    Is the payment made each period; it cannot change.Typically, pmt contains principal and interest.

    PvIs the present value, or the lump-sum amount that a seriesof future payments is worth now.

    Fv

    Is the future value, or a cash balance you want to have afterthe last payment is made. If fv is omitted, it is assumed to

    be 0 (the future value of a loan, for example, is 0).

    Type

    Is the number 0 or 1 and indicates when payments are due. 0 = end of period, 1= beginning of the period.

    Page 4 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    5/12

    Example:Jayne has taken out a reducing loan for $6,000 and the interest rate is 7%. How long is it until she has nothing to

    pay if she pays $80 each month.=NPER(7%/12, -80,6000) Result is 98.92126 months or=NPER(7%/12, -80,6000)/12 Result is 8.243438 yearsNote: The last two parameters are not required as both their default values are 0.

    IPMT (Interest Payment)

    Syntax =IPMT(rate,per,nper,pv,fv,type)Returns the interest payment for a given period for an investment based on periodic, constant payments and aconstant interest rate.When you are paying off a reducing mortgage you pay the same amount each period, however the interest you

    pay decreases as the capital repayment portion of the payment increases. This function allows you to find outhow much you are paying out in interest in any given period.Syntax

    Rate

    Is the interest rate per period.Per

    Is the period you have chosen to find the interest and must be in the range 1 to nper.Nper

    Is the total number of payment periods in an annuity.PvIs the present value, or the lump-sum amount that a series of future payments is worth right now.Fv is the future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it isassumed to be 0 (the future value of a loan, for example, is 0).TypeIs the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.

    Example

    The following formula calculates the interest due in the first month of a three-year $8000 loan at 10 percentannual interest:

    IPMT(0.1/12, 1, 36, 8000) equals -$66.67

    PMTSyntax =IPMT(rate,nper,pv,fv,type)Is the payment that is made each period to pay off a loan. Payment will consist of interest and capital repayment.Rate

    This is the interest rate paid each period. This is usually given for a year, therefore if payments are monthly thenthe interest will be divided by 12. Eg. 8% for a year would be 8%/12 for each month.Nper

    The number of periods you have to pay. (For example, if you get a four-year car loan and make monthly

    payments, your loan has 4x12 (or 48) periods. You would enter 48 into the formula for Nper.PvIs the present value or amount of the loan. The amount of money borrowed.FvThe future value of the loan (this will be 0 if you intend to pay the loan off),Type

    Type of payment to be made (this is 0 if your payments begin at the end of the month you get the loan; 1 if thepayments begin immediately when you get the loan -- 0 is the most common option here).

    Example:You take out a loan for $120,000 to buy a house. The interest rate is to be 9% and the loan is to be paid off in 25years. How much do you need to pay each month.=PMT(9%/12,25*12,120000) Result is -$1,007.04 per month.

    Note as FV = 0 and Type = 0 these parameters have been omitted.Below is an table of repayments for a loan using the two formulae. PMT and IPMT.PMT calculates the payment for each periodIPMT calculates the interest portion of each payment.Principal repayment is calculated by subtracting the IPMT value from the PMT value

    Page 5 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    6/12

    Table showing repayments

    Logical FunctionsBoolean expressions equate to either TRUE or FALSE. In Microsoft Excel two boolean functions are AND and

    OR. Their result has only two possible outcomes which are TRUE orFALSE. This is a simple Yes/No result.AND

    To have a true result all expressions must equate to TRUE. Below is a simple example to check whether a carwill start or not. To keep it simple we are only considering two factors, petrol and the state of the battery.The function used is: =AND(A2=yes,B2=OK)For the result to be true A2 must be Yes and B2 must be OK. Any of the other three possible combinationswill give a FALSE result.

    Enter the data into columns A and B and the AND function into Cell C2. Fill this down and convince yourselfthat ANDs really do work.

    Here is an example of how the AND function can be applied to numeric data. This AND function checks to seeif both tests are greater than or equal to the pass mark, which is in this case is 50.The function used is: =AND(A3>=B$1,B3>=B$1)Enter the data below and check that you are able to get the same result.

    OR

    To have a true result any of the expressions must equate to TRUE. Below is a simple example to check whetheryou will buy a new car. To keep it simple we are only considering two factors, Sold Old Car or Have aBankLoan.The function used is: =OR(A2=Yes,B2=Yes)Enter the data below and check that you are able to get the same result.

    Here is an example of how the OR function can be applied to numeric data. This OR function checks to see ifeither one of the expressions is greater than or equal to the pass mark, which is in this case is 50.The function used is: =OR(A3>=B$1,B3>=B$1)Enter the data below and check that you are able to get the same result.

    Page 6 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    7/12

    Combining AND/OR with IF FunctionsA simple TRUE or FALSE is not a very friendly way to display a result and therefore is not likely to be used onits own. To be really useful the AND and ORfunctions are combined with the IF function where decisions haveto be made.You have met the IF function before but to remind you here is its structure again.

    IF( __________________, _______________, ________________ )

    Take the previous AND example and add to it the IF function. This is what the function will look like:=IF(AND(A3>=B$1,B3>=B$1),"Pass","Resit")Enter the function and check your answer with the one shown below.

    Take the previous ORexample and add to it the IF function. This is what the function will look like:=IF(OR(A3>=B$1,B3>=B$1),"Pass","Resit")Enter the function and check your answer with the one shown below.

    Nested IFsA single IF only allows you to make a two-way branch. One branch occurs when the test condition is trueand the other when the condition is false.

    Nesting IFs allows multiple branches to be made.Unfortunately the nested IF is rather a clumsy structure on spreadsheet and it is bit difficult to visualise whatis happening. Structure diagrams are used here to clarify the workings of nested IFs.

    Non-Nested IFs A reminderSuppose you can buy discs cheaper if you buy them in tens rather than singly. This example has only two

    paths, one is when the quantity bought is below ten, the other when the quantity bought is ten or more.

    The formula entered into cell B2 to do thisis:=IF(A2

  • 7/31/2019 Excel Lessons Advanced Time (1)

    8/12

    In the example below five price categories are provided by four nested IF functions.

    The formula entered into cell B2 to do this is:=IF(A2

  • 7/31/2019 Excel Lessons Advanced Time (1)

    9/12

    Date and Time Functions and Formats

    How Excel stores datesDays are numbered from January 1, 1900. This is the start number for recording dates.

    Try this:

    Type 1/1/1900 in a cell

    Right click on the cell Click on Format cells Click on the Number Tab Click General

    Your format should display 1, showing that the serial number for January 1, 1900 is equal to 1.Find the serial number for todays date. This is the number of days since January 1,1900

    Tips on entering dates and timesMicrosoft Excel treats dates and times as numbers. The way that a time or date is displayed on a worksheetdepends on the number format that is applied to the cell. When you type a date or time that Microsoft Excelrecognises, the cell's format changes from the General number format to a built-in date or time format. Bydefault, dates and times are right-aligned in a cell.

    If you enter a date in the incorrect format it will be treated as text and be left-aligned. You should check that thedates you enter align to the right.

    American and English DatesAmerican dates are entered in the format: Month/Day/Year

    New Zealand dates are entered in the format: Day/Month/YearTo make sure date format is English(New Zealand) format follow the path:

    Choose English(New Zealand)

    Times are stored as the decimal part of the number. The part of the number to the right of the decimal point.

    Try this:

    Type 1/1/1900 12:00 ina cell Right click on the cell Click on Format cells Click on the Number Tab Click General

    Your format should display 1.5 The .5 represents half a day which is 12 hours.

    Custom format codes for dates and timesTo display days, months, and years, include the following format codes in a section. If you use "m" immediatelyafter the "h" or "hh" format code or immediately before the "ss" code, Microsoft Excel displays minutes insteadof the month.

    To display Use this format code

    Months as 1-12 mMonths as 01-12 mmMonths as Jan-Dec mmmMonths as January-December mmmmMonths as the first letter of the month mmmmmDays as 1-31 dDays as 01-31 dd

    Days as Sun-Sat dddDays as Sunday-Saturday ddddYears as 00-99 yyYears as 1900-9999 yyyy

    Page 9 of 12

  • 7/31/2019 Excel Lessons Advanced Time (1)

    10/12

    To display hours, minutes, and seconds, include the following format codes in a section.

    To display Use this format code

    Hours as 0-23 hHours as 00-23 hhMinutes as 0-59 mMinutes as 00-59 mmSeconds as 0-59 sSeconds as 00-59 ss

    Hours as 4 AM h AM/PMTime as 4:36 pm h:mm am/pmTime as 4:36:03 p h:mm:ss a/pElapsed time in hours; for example, 25.02 [h]:mmElapsed time in minutes; for example, 63:46 [mm]:ssElapsed time in seconds [ss]Fractions of a second h:mm:ss.00

    24 Hour and 12 Hour ClocksIf the format contains an AM or PM, the hour is based on the 12-hour clock, where "AM," "am," "A," or "a"indicates times from midnight until noon, and "PM," "pm," "P," or "p" indicates times from noon until midnight.Otherwise, the hour is based on the 24-hour clock. The "m" or "mm" must appear immediately after the "h" or

    "hh" format code or immediately before the "ss" code, or Microsoft Excel displays the month instead of theminutes.

    Entering a custom fomat

    Try this:

    Type Your birth date Right click on the cell Click on Format cells Click on the Number Tab Click Custom

    Type this format into Type dddd m mmmmyyyy

    Your format should display Sunday 8 August 1956

    Page 10 of 12

    Type thecustom formathere

    ChooseCustom

    ChooseNumber Tab

    Click OK

    1

    4

    3

    2

  • 7/31/2019 Excel Lessons Advanced Time (1)

    11/12

    Dates in formulaeThere are number of functions to help make handling dates easier. We will examine 5 of them.

    If you are simply dealing with dates and not times it is possible to add a number to a date or to subtract a numberfrom a date.

    Adding a Number to a Date Practical exampleIn the example below 28 is added to the dates in column A to calculate the date payment is due.

    TODAY FunctionTODAY() Returns the current date (Todays date)

    The example below shows the subtraction of a future date from todays date. Cell B2 will need to be formattedas a number.By using the function Today() instead of typing in the current date ensures that a spread sheet is always up to

    date.

    NOW() Returns the current date and time. (Similar to Today but includes time.)

    HOUR, MINUTE, SECOND FunctionsHOUR Returns the hour component of a serial numberExamples:=HOUR("12:45 PM") Returns 12 which is the hour component of the time.

    =HOUR("7/2/00 12:45 PM") Returns 12 which is the hour component of date and time.=HOUR(0.5) Returns 12 as 12 hours is half a dayNote: Both MINUTE and SECOND work in the same way as HOUR does.MINUTE Returns the Minutes component of a serial numberSECOND Returns the Seconds component of a serial number

    HOUR, MINUTE, SECOND PracticalExampleThe spreadsheet below displays race times for athletes in hours and minutes from recordings made of the racestart-time and each individuals finishing time. The formulae for these calculations are shown to the right.

    Page 11 of 12

    Formulae

  • 7/31/2019 Excel Lessons Advanced Time (1)

    12/12

    Try this:

    Type the above data into a spreadsheetAdd a column EEnter the label Seconds into E3Enter the Seconds function into E4 and E5Change the finish times of each athlete to include seconds:

    Jane 12:45:12 PMFred 1:20:36 PMTania 1:34:21 PM

    Conditional FormattingConditional formatting is used to apply formats to cells according to the cellcontents or as a result of a formula in a related cell.To select Conditional Formatting: Highlight the area you wish to format

    On the menu bar click: Format Conditional Formatting

    Simple example of Conditional FormattingBelow is part of a class list with Student names and Periods absent.Conditional Formatting is used to highlight those students with more than five absences

    The result of conditional formatting is shown below. Any absence over 5 is formatted with White text on a Redbackground.Example 1Formatting on a cell value

    Example 2Formatting on a formula makes it possible to apply the format to other related cells.

    Page 12 of 12