You are on page 1of 22

Spread Sheet Manual (Form 7)

Microsoft Excel

Page 1

Background from Form Six that you must know!!


1. Simple file handling. a) Navigate to drives and folders b) Organise files c) Create, copy, move, rename, find, files and folders. Using Worksheets a) Rename, delete, insert, change order. Cell a) Copy, paste, drag and drop b) Create a Series c) Alter cell width and height Formatting a) Wrap, Centre across selection, shade, border, change font attributes b) Number formatting number of decimal places, currency Formulas a) Order of operations (BEDMAS) and use of operators + - / * ^ () b) Use of functions, SUM, MAX, MIN, AVERAGE, COUNT, COUNTA c) Use of % sign d) Relative and Absolute cell references Graphing simple pie, bar and column graphs. Apply Data Integrity Practices a) comparison with original information sources b) audited formulae c) check-totals.

2. 3.

4.

5.

6. 7.

If you do not know the above you should get the Form 6 Manual and revise this work.

Page 2

A bit of revision Coins


Task A survey was carried out to find out the number of coins of each denomination carried by students and how money this equates to. Skills Number formats, alignment (wrap), centering, relative/absolute cell references, copy/paste, paste special, fill, graph. Instructions 1. Enter the data shown and format the spreadsheet as it is shown below. 2. Sum the rows to find the number of coins each student has 3. Sum the columns to find the number of coins of each denomination (5c, 10c etc) 4. Enter and fill formulae to produce the second table so that it shows the money value of the coins in the first table. 5. Sum rows to calculate the total amount of cash each student has. 6. Sum columns to calculate the total amount of cash in each denomination.

centre across headings

use currency format with no decimal places

format as a numbers with no decimal places and a trailing letter c

wrap the text within this cell

sum rows

wrap the text within this cell

use copy/paste special to copy the format of this table to create the table below. sum columns

use cell references to repeat the names above here

wrap the text within this cell

wrap the text within this cell enter formulae to calculate the coin value for each item in the table above

sum columns

add rows

Page 3

Spreadsheets Logical Functions


Boolean expressions equate to either TRUE or FALSE. In Microsoft Excel two Boolean functions are AND and OR. Their result has only two possible outcomes. These are either TRUE or FALSE. This is a simple Yes it is true or No it isn't true result.

AND Function
To have a true result all expressions must equate to TRUE. Below is a simple example to check whether the car will start or not. To keep it simple we are only considering two factors, petrol and the state of the battery.

The function used in column C 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 combinations will give a FALSE result. Enter the data into columns A and B and the AND function into Cell C2. Fill this down and convince yourself that ANDs really do work. Here is an example of how the AND function can be applied to numeric data. This AND function checks to see if 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 Function
To have a true result the expression must equate to TRUE. Opposite is a simple example to decide whether you will buy a new car. To keep it simple we are only considering two factors, Sold Old Car or Have a Bank Loan. 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 if either one or other of the marks 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)
Page 4

Enter the data below and check that you are able to get the same result.

Combining AND/OR with IF Functions


A simple TRUE or FALSE is not a very friendly way to display a result and therefore is not likely to be used on its own. To be really useful the AND and OR functions are combined with the IF function. Below is the structure of an IF function.

A Boolean test which may use AND/OR functions

Result when the Boolean test returns TRUE

Result when the Boolean test returns FALSE

=IF( __________________ , _______________, ________________ )

Take the previous AND example and add to it the IF function. This is how the function will look: =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 OR example and add to it the IF function. This is how the function will look: =IF(OR(A3>=B$1,B3>=B$1),"Pass","Resit") Enter the function and check your answer with the one shown opposite.

Page 5

Logical Functions Exercises


Better Brains College want a spreadsheet to determine how many of their students pass all modules, pass at least one module and pass exactly three modules.

You are to: a) Enter the data into the cells in columns A to E b) Enter IF/AND function into cell F4 c) Enter IF/OR function into cell G4 d) Enter the IF/OR/AND function into cell H4 e) Fill the formulae down. f) Check to see if your results are the same as those shown opposite. The Comfortable Coach Company runs buses from Christchurch to Invercargill. They give a 20% concession to: Children under 12 Adults over 64 Disabled people

You are to: 1. enter a formula into cell D11 to calculate the fare to Ashburton. 2. This formula must have the correct combination of relative and absolute cell addresses to fill across and down without having to alter the formula. It must also refer to cells B4, B5 that are the conditions for fare reduction and E3 as this refers to the percentage fare reduction allowed.
Page 6

Air Force Entry


To enter into the Air Force it is required that a recruits vision be 6/6, colour vision normal and their age is from 20 to 25.

The names of those tested are shown above. Type in the data above and enter a formula into Cell E4 to indicate, based on these tests, whether the applicants would be suitable or not. Fill the formula down the column and check your answers with those in column E opposite.

Page 7

Simple single IF
Below is a table the lists a choice of computer components to make up a basic personal computer. The purpose of the spreadsheet is to allow you to choose the components you wish to incorporate into your system and return the final purchase price of the complete system. By entering a "Y" into each category the price for the chosen component is returned in column D

Instructions:
1. 2. 3. 4. 5. 6. 7. 8. Enter the headings and data into the spreadsheet. Centre the heading, "Colin's Custom Computer Company" across columns A to E. Enter the appropriate IF formula into cell E3. Fill this formula down to E28 Sum column E, in cell E30. Calculate GST (12.5%) on the total in E30. Add total exclusive GST to the GST payable to give the final purchase price in E32. To check your work choose the same items shown in the example opposite to see if your results are the same. 9. You should also check your work by doing the same calculation another way. Eg using a calculator.
Page 8

So far we have dealt with simple Ifs that return two possible values based on a Boolean test. Assume you wish to convert a test mark into a simple Pass/Fail result. The Diagram opposite shows how a single If statement returns "Pass" if a mark entered is greater or equal to fifty and "Fail" for any mark lower than fifty. =IF(A3>=50,"Pass","Fail")

> Y e s

5 0 N o " F a il"

Nested If's

" P

a s s "

These are simply single If's strung together to give multiple binary decisions. Suppose you wish convert test marks into grades A to E where:
> Y " A " Y " B " Y " C " Y " D " Y " E " e s = N > e s 8 5 o = N > 6 5 o = 5 0 N o > e s = N > e s 4 0 o = 0 N o " N

Greater than or equal to 85 Greater than or equal to 65 Greater than or equal to 50 Greater than or equal to 40 Greater than or equal to 0 Otherwise The structure diagram opposite shows graphically how a number of simple binary decisions are used to separate a grade out into the categories A, B, C, D, E shown in the table above. Unfortunately spreadsheet If's, when nested become rather long and clumsy. Simply, the ELSE part of the IF becomes the start of another IF Statement. At the finish make sure there are an equal number of closing brackets to opening brackets The words o t V a lid " Yes and No can be substituted for True and False

A B C D E Not Valid

e s

In the example the branch "Not Valid" only applies to numbers less than zero. 1. Open a new work sheet and type in the data headings and marks shown opposite. 2. Enter the formula below into cell B3 3. Fill the down. formula

4. Save the file as: Grade Calculator

Page 9

=IF(A3>=85,"A",IF(A3>=65,"B",IF(A3>=50,"C",IF(A3>=40,"D",IF(A3>=0,"E","Not Valid"))))))))

Page 10

IS functions
Is functions are used for testing the type of a value or reference. Is functions check the type of value and return TRUE or FALSE depending on the outcome. For example, the ISBLANK function returns the logical value TRUE if value is a reference to an empty cell; otherwise it returns FALSE. The following nine functions are available: Value is the value you want tested. Value can be a blank (empty cell), error, logical, text, number, or reference value, or a name referring to any of these, that you want to test

ISBLANK(value) ISERR(value) ISERROR(value)

Value refers to an empty cell. Value refers to any error value except #N/A. Value refers to any error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!). Value refers to a logical value. Value refers to the #N/A (value not available) error value. Value refers to any item that is not text. (Note that this function returns TRUE if value refers to a blank cell.) Value refers to a number. Value refers to a reference. Value refers to text.

ISLOGICAL(value) ISNA(value) ISNONTEXT(value)

ISNUMBER(value) ISREF(value) ISTEXT(value)

Validating Number

These functions are useful for validating data you enter into a spreadsheet. A common error would be to type the letter O instead of zero when entering a number.
Enter the example below and type an O rather than a zero.
=IF(ISTEXT(A2),"Enter a number",A2)

Adding Validation to the Grades Exercise The data entry errors that could be made are: not entering a number at all entering text instead of a number entering a negative number entering a number greater than 100 entering a number less than zero Change the formula in Grades problem to that shown below.
=IF(ISBLANK(A3),"Enter value",IF(OR(ISTEXT(A3),A3>100,A3<0),"Not Valid",IF(A3>=85,"A", IF(A3>=65,"B",IF(A3>=50,"C",IF(A3>=40,"D",IF(A3>=0,"E")))))))

Validation Exercise
In the example to the right below the iserror function is used to avoid the #DIV/0! Before data has been entered into a spreadsheet template. 1. Enter the data into the spreadsheet as shown below and then enter the appropriate formula to calculate BMI which is Weight(kg)/Height(m)2 2. Use and IF(IsError( formulae to avoid the #DIV/0! in column D

Page 11

Financial Functions (FV, NPER, IPMT & PMT)


These financial functions relate to loans, investments etc. Microsoft Excel has 54 financial functions. We are going to look at the four functions. By familiarising yourself with these functions you should be able to handle 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 and interest rates do not alter. The syntax is: FV(Rate, Nper, PMT, PV, Type)

Rate
This is the interest paid. Most interest is on a yearly basis, however payments may be made monthly. In this case the interest must be divided by 12. Eg. If the interest rate is 8% yearly then the monthly interest = 8%/12

Nper
This is the number of periods the payment is spread over. If payment is made monthly and the investment is over 5 years then the number of periods will = 5 x 12

Pmt
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 default is zero. This is money paid in therefore it too is a negative value of -2000

Type
This has values 1 and 0. 0 indicates the end of the pay period, whilst 1 indicates the beginning of pay the period. Zero is the more usual and is the default value if nothing is entered.

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

Page 12

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 constant interest 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.

Pv
Is the present value, or the lump-sum amount that a series of future payments is worth now.

Fv
Is the future value, or a cash balance you want to have after the 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. 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 years Note: The last two parameters are not required as both their default values are 0. When the loan is paid off and at the end of the period.

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 a constant 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 out how 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.

Page 13

Pv
Is 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 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. 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 percent annual interest: IPMT(0.1/12, 1, 36, 8000) equals -$66.67

PMT
Syntax =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 repayments. Rate This is the interest rate paid each period. This is usually given for a year, therefore if payments are monthly then the 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. Pv Is the present value or amount of the loan. The amount of money borrowed. Fv The 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 the payments 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 25 years. 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.

Page 14

Below is a table of repayments for a loan using the two formulae. PMT and IPMT. PMT calculates the total payment for each period IPMT calculates the interest portion of each payments Principal repayment is calculated by subtracting the IPMT value from the PMT value.

Financial Formulae Exercise


The purpose of the spreadsheet shown below is to compare the cost of three loan options to buy a car. This exercise requires the use financial functions and relative/absolute cell addressing. 1. Enter the data as shown below, making principal a calculated value. 2. Enter appropriate formula into cells B10, B11 and B12. 3. Copy these cells across the range C10:D12

Page 15

Lookup Function
Using Excel you can look up a table containing the information you want and return a value in the same position in another table. For example: George needs to know how many days there are in each month so he can calculate his income as he works out his spreadsheet. To achieve this he has made two columns containing the months of the year, and how many days in the month. Do the following: 1. In cell A1 type in Jan and drag down until you have the first six months. 2. In cell B1 type in the number of days for each month. 3. Now for this function to operate you must sort the months alphabetically so click on cell A1 and click the Sort button (The first column must always be sorted). Note that the second column also changes to stay the same as the first once they are sorted. 4. Below the Monthly table, create the spreadsheet shown

5. In B11 we are going to place the Look Up formula that will read the month from B10 (Jan), then look up the table (A1:A6) and display the days from (B1:B6). 6. Click in B11 and find the Look Up Function using the Function 7. Type in the values shown in the three windows. We are going to look up B10, read the month in that cell, then find the month in the range A1:A6. 8. The number of days will be found in the range B1:B6. 9. Click OK if the Formula result = 31, otherwise check your input and correct. 10. If you drag the formula from B11 to G11 the values will change as the cell references are Relative. You must make them all Absolute except for B10 . How will you do that? 11. Create the Daily Income fields as well and save as Look-Up exercise. Button.

Page 16

Lookup Bargain Hire Cars Another Lookup Exercise


1. Open a new work book and rename the first work sheet Costs. 2. Select the Costs work sheet and enter the data shown opposite 3. Rename the second work sheet Account. 4. Enter the headings as shown opposite. 5. Enter the data in columns A, B and C. 6. Enter a Lookup function into cell D4 to look up the cost of hiring the chosen car for one day. 7. Enter a formula in E4 to calculate the cost of hire for the required number of days. 8. Copy these two formulae down. 9. Format all money values to currency. Note: Make sure that you click on cells to enter cell references (don't type cell references into formulae), also make sure you make references relative or absolute where necessary

10. Save you work book under the name B Rental Cars.

Page 17

Date and Time Functions


Microsoft Excel stores dates as sequential numbers known as serial values and stores times as decimal fractions because time is considered a portion of a day. Dates and times are values and therefore can be added, subtracted, and included in other calculations. To type a time based on the 12-hour clock, type a space followed by AM or PM (or A or P) after the time. Otherwise, Microsoft Excel bases the time on the 24-hour clock. For example, if you type 3:00 instead of 3:00 PM, the time is stored as 3:00 AM. Regardless of the format used to display a date or time, Microsoft Excel stores all dates as serial numbers and stores all times as decimal fractions. To display a date as a serial number or display a time as a fraction, select the cells that contain the date or time. On the Format menu, click Cells, click the Number tab, and then click General in the Category box. Times and dates can be added, subtracted, and included in other calculations. To use a date or time in a formula, enter the date or time as text enclosed in quotation marks. For example, the following formula would display a difference of 68: ="5/12/94"-"3/5/94" Days are numbered from the beginning of the century; the date serial number 1 corresponds to the date January 1, 1900. (serial value 1) to December 31 1999 (serial value 2958525). This has been extended forY2K compliance. When you enter a date in Microsoft Excel 97 and you enter only two digits for the year, Microsoft Excel enters the year as follows: The years 2000 through 2029 if you type 00 through 29 for the year. For example, if you type 5/28/19, Microsoft Excel assumes the date is May 28, 2019. The years 1930 through 1999 if you type 30 through 99 for the year. For example, if you type 5/28/91, Microsoft Excel assumes the date is May 28, 1991. To display days, months, and years, include the following format codes in a section. If you use "m" immediately after the "h" or "hh" format code or immediately before the "ss" code, Microsoft Excel displays minutes instead of the month.

To display

Use this for mat cod e m mm mmm mmmm mmmmm d dd ddd dddd yy yyyy

To display

Use this format code h hh m mm s ss h AM/PM h:mm am/pm h:mm:ss a/p [h]:mm [mm]:ss [ss] h:mm:ss.00

Months as 1-12 Months as 01-12 Months as Jan-Dec Months as January-December Months as the first letter of the month Days as 1-31 Days as 01-31 Days as Sun-Sat Days as Sunday-Saturday Years as 00-99 Years as 1900-9999

Hours as 0-23 Hours as 00-23 Minutes as 0-59 Minutes as 00-59 Seconds as 0-59 Seconds as 00-59 Hours as 4 AM Time as 4:36 pm Time as 4:36:03 p Elapsed time in hours; for example, 25.02 Elapsed time in minutes; for example, 63:46 Elapsed time in seconds Fractions of a second

Page 18

If 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 the minutes. With date and time functions, you can analyse and work with date and time values in formulas. For example, if you need to use the current date in a formula, use the TODAY worksheet function, which returns the current date based on your computer's system clock.
Date Datevalue Day Days360 Edate Eomonth Hour Minute Month Networkdays Now Second Time Timevalue Today Weekday Workday Year Yearfrac Returns the serial number of a particular date Converts a date in the form of text to a serial number Converts a serial number to a day of the month Calculates the number of days between two dates based on a 360-day year Returns the serial number of the date that is the indicated number of months before or after the start date Returns the serial number of the last day of the month before or after a specified number of months Converts a serial number to an hour Converts a serial number to a minute Converts a serial number to a month Returns the number of whole workdays between two dates Returns the serial number of the current date and time Converts a serial number to a second Returns the serial number of a particular time Converts a time in the form of text to a serial number Returns the serial number of today's date Converts a serial number to a day of the week Returns the serial number of the date before or after a specified number of workdays Converts a serial number to a year Returns the year fraction representing the number of whole days between start_date and end_date

Page 19

Harrys Bar Date and Time exercise


Harrys Bar needs a timesheet to record the hours of its casual workers. Create the spreadsheet below using the following functions. Hour Minute Now All functions are opened with the Function Button.

E2

Format cells B5 to C10 as time.

Format cell E2 as below

Page 20

Macros: Automating tasks


A macro is a series of commands and functions can be run whenever you need to perform a task. You record then run the macro to repeat, or "play back," the commands. Before recording a macro, plan the steps and commands you want the macro to perform. If you make a mistake when you record the macro the corrections you make will also be recorded. In this exercise we are going to make a simple macro that moves a column of numbers across 2 columns and then a second macro to return the column back to the original position. 1. Open the Spreadsheet Macro, or type in the information left on a new spreadsheet. 2. On the Tools menu, point to Macro, and then click Record. 3. In the Macro name box, enter the name Move for the macro. 4. To run the macro with a keyboard-shortcut key, enter the letter (m) in the Shortcut key box and complete the description window. 5. Click OK, the macro will begin to record. 6. The small window that appears shows the Stop button and the button that changes the macro between absolute and relative cell references. The macro will automatically select the same cell reference every time its played back regardless of which cell is highlighted when the macro is run because it records absolute cell references. If you want a macro to select cells in relation to the position of the highlighted cell when you run the macro, press the button to record relative cell references. 7. Highlight the column C3 to C9 right click your mouse button and choose copy. 8. Right click in E3 and choose Paste Special and click Skip blanks. Skip blanks will prevent blank cells from being copied over cells with characters in them. This is a good safety tool to prevent accidentally erasing your data. 9. Now that you have 2 columns of data, go back to the C3 to C9 column and delete out the data 10. Press the Stop button, you have created your first macro. 11. Return the Column E numbers back to Column C and press CTRL m to run your macro.

Extra Exercises
Run the macro again to move the data to column E, and then create a second macro, called Return to return the column back to the original position. Using the Add operation under Paste Special, create a macro that adds the numbers in column C to a new column in F. Each time you run this macro the numbers in F will increase by the numbers in E.
Page 21

Run a macro from a button


You can easily assign a macro to a button on your worksheet. When you click the button your macro will run automatically. We will use the macros we have already created in this exercise. 1. Open the Forms Toolbar by going View / Toolbars / Forms. 2. Click on the Button symbol and drag a button onto your spreadsheet. 3. In the Assign Macro window click on the macro you want the button to run, in this case the Move macro and then click OK. 4. Resizing and moving the button is easiest if you click on the Select Objects arrow on the Drawing toolbar before attempting to work with the button. This will prevent you accidentally starting the macro. 5. With the Select Objects button on, double click on the button to change the Font, Format and Colour of the text. 6. Create a button for both the Move and the Return Macros and size them together in a suitable place.

Run a macro from a Toolbar


1. It is also easy to attach a macro to a toolbar button where you can easily use it. 2. Go: View / toolbar / Customise to open the Customise window 3. Click on Commands Tab, then Macro category and drag the custom button onto the toolbar to where you want your button to be. 4. Right-click the button, and then click Assign Macro on the shortcut menu. 5. In the Macro name box, enter the name of the macro.

Once created the button can be edited to meet your needs. Use Change Button Image to select another picture, or more creatively use Edit Button Image to edit the picture on the button (Note that the Customise dialogue box must be open for you to get the menu shown opposite. These features are available for any button whenever the Customise window is open.

Page 22

You might also like