Spreadsheet Software Level 5 Build-up workbook MS Excel 2007
SPREADSHEET FUNCTIONS A function is simply a specialised calculation that Excel has memorised. There are many functions (around 200) built into Excel and they can do lots of different things. Many functions demand specialist knowledge such as accountancy, statistics and advanced maths. Like a formula, a function needs to start with an = sign and you need to tell the spreadsheet which cells you want to use it with. Here are some of the most popular functions. Notice they start with = followed by the name of the function and then the range of cells the function is to be applied to. Average =AVERAGE(A1:A10) ~ Gives the average of all the numbers in the cells from A1 to A10 inclusive. Maximum =MAX(E4:E11) ~ Displays the largest number from all the cells from E4 to E11 inclusive. Minimum =MIN(B2:B12) ~ Displays the smallest number from all the cells from B2 to B12 inclusive. Count Suppose we want to count the number of numeric entries in the range C3 to C30. We can use =COUNT(C3:C30). Any blank lines or text entries in the range are not counted. Counta To count a number of items or names of people (not numeric entries) we need to be able to count text entries. To do this we can use =COUNTA(C3:C30). You need to make sure the headings are not included in the range so that they are not counted as well. Again blank lines are not counted. Page 2
Exercise 1 1. Create a new worksheet with the following information: 2. Enter the formula you would use to calculate the total of the car prices in cell B18 3. Enter the formula to work out the average car price in cell B19 =AVERAGE(RANGE OF PRICE CELLS E5:E17) 4. Enter the formula to work out the total number of entries in cell B20 =COUNTA(RANGE OF MANUFACTURER CELLS) 5. Enter the formula to calculate the maximum price of a car in cell B21 =MAX(RANGE OF PRICE CELLS) 6. Enter the formula to calculate the minimum price of a car in cell B22 =MIN(RANGE OF PRICE CELLS) 7. Format all the price numbers to currency with 2 decimal places. 8. Save the spreadsheet with the filename CARS and print. Page 3
Exercise 2 1. Create a new worksheet and enter the following data: 2. Right align the headings in columns B to I. 3. Using the AVERAGE function, calculate the average sunshine hours for Lisbon then replicate for the other locations. Display all numbers in integer format. NOTE: You can use the function button to find some of the most common functions click the drop-down arrow next to autosum: 4. Save the worksheet as SUNSHINE and print one copy. (Make sure your name is on the sheet). 5. Information has been omitted from the list for GIBRALTAR. Insert a blank row between Lisbon and Benidorm and insert the following data: PLACE MON TUE WED THU FRI SAT SUN GIBRALTAR 7 7 8 7 6 8 7 6. Calculate the average sunshine hours for Gibraltar. 7. Add another row heading AVERAGE below Athens in column A. Using an appropriate formula work out the average sunshine for each day. 8. Save and print one copy of the worksheet. 9. Print a copy of the worksheet showing the formulae used. Page 4
Exercise 3 1. Create a new worksheet and enter the following data: 2. Use the AVERAGE function in cells B17 and C17 to find the average maximum and minimum monthly temperatures. Format the answers to 1 decimal place. 3. In cells A18 and A19 type in the labels Highest and Lowest. Use the MINIMUM and MAXIMUM functions to find the minimum and maximum values in columns B and C. 4. In cell A20 type in the label Number of Months and in cell B20 use the COUNT function to count the number of months showing above. 5. Save the spreadsheet as TEMPERATURES and print. 6. Print showing the formulae used. Page 5
Introduction to IF statements in Excel The IF statement answers the question Is this true or false? then proceeds on some action based on this. For example If I earn more than 1000 in April, I will g o on holiday else I won t. This would be written as: =IF(April Pay>1000, Yes, No ) The IF function does not calculate values but instead do logical tests using logical comparisons like: = Equal to < Less than > Greater than <= Less than and equal to >= Greater than and equal to Fortunately Excel has a wizard to help you write simple IF functions you simple click on the function button in front of the formula bar to open it up. Exercise 4 1 Open Excel and enter the following data into a new spreadsheet: Page 6
2 Click in cell C2 and then click on the function button to open the wizard. 3 Select IF from the list of functions (you may need to scroll through the list to find it). 4 You will then see the following dialogue box: 5 Our logical test is going to be Is the value in column A larger than the value in column B. So in the logical test box we key in: A2>B2 6 The Value_if_true is what we want the cell to show if the argument is true in this case Yes. 7 The Value_if_false is what we want the cell to show if the argument is false in this case No. 8 The dialogue box should now look like this: Page 7
9 Click Ok you should now see the result No in cell C2. 10 Replicate the formula down the remainder of the column. In the formula bar you will notice that the function is written as this: =IF(A2>B2, Yes, No ) The logical test is the first section in the brackets, the answer if the logical test is true is shown after the first comma and the answer if the logical test is false is shown after the second comma). 11 Replicate the formula down the remaining cells 12 Add your name and the date to the footer. 13 Save as IF Basic and print a copy. Exercise 5 1 Open the IF Basic spreadsheet and enter the following data onto Sheet 2: If an athlete jumps 70m or more, they will qualify. 2 Write a function that will display Qualify if they have exceeded 70m or Not Qualify if they have not. Page 8
a) Click in cell C4 b) Click on the function tool c) Select the IF function d) The logical test is if the distance jumped is greater than 70: B4>70 e) The Value if true is Qualify f) The Value if false is Not Qualify g) Click Ok 3 Replicate the formula down the remaining cells 4 Insert your name and the date into the footer and save, keeping the name IF Basic. Print a copy. Exercise 6 Task A 1 Open the IF STATEMENT PRACTICE spreadsheet 2 In column F a function needs to be inserted to identify whether the performance is in the evening or if it is a matinee performance. Write a formula in cell F9 to show that if a performance is on at 14.00 hours then Matinee should be displayed, otherwise Evening should be displayed. 3 Replicate this formula for all performances. 4 Insert your name and the date on the footer. 5 Save the spreadsheet. Task B 1 In column G a formula needs to be written to display the cost of a performance, the costs depends on whether it is a matinee or evening performance. 2 In cell G9 insert a function to calculate that if a performance is matinee, the cost is 21.00, otherwise it is 30.00. 3 Replicate this formula for all performances. 4 Save the spreadsheet and print a copy. 5 Display the formulae and print a copy remember CTRL + Page 9
This should be your result: L AK E S IDE THE ATR E COMPANY Number of Seats Available 500 Date Day Time of Performance Number of Seats Sold Performance? Matinee/Evening Ticket Price 16/02/2006 Thursday 14.00 465 Matinee 21.00 16/02/2006 Thursday 19.00 410 Evening 30.00 17/02/2006 Friday 14.00 132 Matinee 21.00 17/02/2006 Friday 19.00 500 Evening 30.00 18/02/2006 Saturday 14.00 435 Matinee 21.00 18/02/2006 Saturday 19.00 500 Evening 30.00 19/02/2006 Sunday 14.00 477 Matinee 21.00 19/02/2006 Sunday 19.00 365 Evening 30.00 20/02/2006 Monday 14.00 475 Matinee 21.00 20/02/2006 Monday 19.00 471 Evening 30.00 21/02/2006 Tuesday 14.00 245 Matinee 21.00 21/02/2006 Tuesday 19.00 147 Evening 30.00 22/02/2006 Wednesday 14.00 456 Matinee 21.00 22/02/2006 Wednesday 19.00 357 Evening 30.00 Day Time of Perform ance Number of Seats Sold Performance? Matinee/Evening Ticket Price Thursday 14 465 =IF(D9=14,"Matinee","Evening") =IF(F9="Matinee"," 21.00", " 30.00") Thursday 19 410 =IF(D10=14,"Matinee","Evening") =IF(F10="Matinee"," 21.00", " 30.00") Friday 14 132 =IF(D11=14,"Matinee","Evening") =IF(F11="Matinee"," 21.00", " 30.00") Friday 19 500 =IF(D12=14,"Matinee","Evening") =IF(F12="Matinee"," 21.00", " 30.00") Saturday 14 435 =IF(D13=14,"Matinee","Evening") =IF(F13="Matinee"," 21.00", " 30.00") Saturday 19 500 =IF(D14=14,"Matinee","Evening") =IF(F14="Matinee"," 21.00", " 30.00") Sunday 14 477 =IF(D15=14,"Matinee","Evening") =IF(F15="Matinee"," 21.00", " 30.00") Sunday 19 365 =IF(D16=14,"Matinee","Evening") =IF(F16="Matinee"," 21.00", " 30.00") Monday 14 475 =IF(D17=14,"Matinee","Evening") =IF(F17="Matinee"," 21.00", " 30.00") Monday 19 471 =IF(D18=14,"Matinee","Evening") =IF(F18="Matinee"," 21.00", " 30.00") Tuesday 14 245 =IF(D19=14,"Matinee","Evening") =IF(F19="Matinee"," 21.00", " 30.00") Tuesday 19 147 =IF(D20=14,"Matinee","Evening") =IF(F20="Matinee"," 21.00", " 30.00") Wednesday 14 456 =IF(D21=14,"Matinee","Evening") =IF(F21="Matinee"," 21.00", " 30.00") Wednesday 19 357 =IF(D22=14,"Matinee","Evening") =IF(F22="Matinee"," 21.00", " 30.00") Page 10
Build Exercise 1 Task A 1 Open the skiing spreadsheet. 2 Format columns C to G as currency (using local symbol) to 2 decimal places. a) Highlight the data in columns C:G b) On the Home tab select Format then select Format Cells c) Click on the currency option d) Check that the correct symbol and decimal places will be displayed e) Click OK 3 Change the hyphen in Unit-Cost to an underscore (Unit_Cost). Press Shift and Hyphen. 4 Format the column titles to bold format the Total_Trip title in bold too. 5 VAT is charged at 17.5% of the Unit_Cost. Enter a formula in E4 which calculates the VAT. =Unit-Cost multiplied by 17.5% 6 Unit_Price is the Unit_Cost plus the VAT. Enter a formula in F4 which calculates the Unit_Price. 7 Total is Unit_Cost multiplied by Number. Enter formula in G4 which calculates the Total. 8 Copy your formulae in E4:G4 down for the rest of the items. 9 The Total_Trip is calculated by adding the Total column. Enter a function in cell G11 to calculate the Total_Trip. 10 Save your spreadsheet as skiing 1. Page 11
Task B 1 Sort the spreadsheet descending on Item. a) Highlight the data from A3:G10 b) Click the Data tab c) Click on the sort descending button (Z to A) 2 Add your name, date and Printout 1 as a footer. a) Click the Insert tab b) Click the Header and Footer option c) The page will automatically display a Header click on the Go to Footer option d) Click in the left-hand box and key in your name e) Click in the centre box and then f) Click in the right-hand box and key in Printout 1. g) Click in a blank cell above the footer. h) Click View Normal 3 Set your Page Layout to Landscape. a) Click on the Page Layout tab b) Select Orientation Landscape 4 Save as skiing 2 and print a copy. Make sure that all data is fully displayed. 5 Change your view to formula view. Press Ctrl and 6 Amend the footer to show Printout 2. Follow the steps above. Page 12
7 Print the spreadsheet showing the gridlines and column headings. Fit to one page wide by one page tall. Make sure that all of the data is fully displayed. Save as skiing 3. a) Select the Page Layout tab b) Check to print the Gridlines and column Headings c) Set both the Width and the Height to one page Task C 1 Create a pie chart of the Item and Total displaying both the Category NameI and Value. a) Highlight the Item column, press the Ctrl key and then highlight the Total column. b) Click the Insert tab and select Pie c) Click on the Chart Tools - Layout tab this allows you to set titles and data labels d) Choose the Chart Title option and select Above Chart Give the Chart the title Skiing Costs e) Choose Legend and then select None (We don t need a legend as we will be setting data labels). f) Choose Data Labels and then select More data label options (Bottom of the menu). Page 13
g) In the dialogue box check the Category Name and Value options. h) Click Close 2 Place the chart on a new sheet with the name Skiing Pie a) Click on the Chart Tools Design tab and then choose Move Chart b) Select the New Sheet option and key in the name Skiing Pie c) Click OK 3 Add your name and the date in the chart footer. a) Click the Insert tab then Header & Footer b) Choose the Custom Footer option c) In the left box key in your name d) In the centre box add the date using the Insert Date tool. e) In the right section key in Printout 3. 4 Save as Skiing 3 and print a copy of your chart. Page 14
Build Exercise 2 Task A 1 Open the file hotels. 2 Format columns D:E as currency (using local symbol) to 2 decimal places. 3 Format the column titles to bold and apply shading to the title cells. 4 Single cost of 4 night stay is calculated by multiplying the Single by 4. Enter a formula in H2 which calculates the cost of a Single room 4 night stay. 5 Double cost of 4 night stay is calculated by multiplying the Double by 4. Enter a formula in I2 which calculated the cost of a Double room 4 night stay. 6 Make sure the data in columns H and I are formatted as currency to 2 decimal places. 7 Save your spreadsheet as hotels1. Task B 1 New hotels are to be added to the list add the following details at the bottom of the spreadsheet. Hotel Name City Country Single Double Stars E-mail Address Hotel Dar Prague Czech Rep 65 85 3 bookings@dar.cz Hotel Vitkov Prague Czech Rep 33 38 3 bookings@vitkov.cz Hotel Tyl Prague Prague Czech Rep 72 76 4 bookings@tyl.cz Hotel Ambassador Prague Czech Rep 199 212 5 bookings@amb.cz Hotel Magenta Paris France 256 289 3 bookings@mag.fr L Empire Paris Paris France 280 340 4 booking@lemp.fr Hotel Palym Paris France 70 95 2 bookings@pal.fr Hotel Good Sleep Cologne Germany 77 95 1 bookings@gs.de Hotel Lilienhof Hamburg Germany 47 56 1 bookings@lil.de The Riverside Hotel and Spa Berlin Germany 55 166 3 bookings@rive.de Page 15
Hotel Piazza Bellini Naples Italy 76 95 3 bookings@pb.it Hotel Mercure Naples Italy 46 46 3 bookings@mg.it Garibaldi Hotel Domenichino Milan Italy 53 61 3 bookings@dom.it Hotel Fiorella Milan Italy 80 110 2 bookings@fio.it Bristol Hotel Gibraltar Gibraltar 54 67 1 bookings@bris.gb The Eliott Hotel Gibraltar Gibraltar 94 98 4 bookings@eliott.gb 2 Save your spreadsheet as hotels2. 3 Copy your formulas to include the new hotels you have added. 4 Sort the data on Country. a) Highlight the data from A1:I44 b) Click on the Data tab c) Click on the Sort tool d) In the Sort by menu choose Country Page 16
5 Select the column headings and those items where the Country is Czech Rep. Set this as the print area and print only those items in landscape orientation ensuring that all data is fully display, showing your name, the date and Printout 1 as the footer. a) Highlight the required data. b) Click the Page Layout tab c) Click the Orientation button to set the page in Landscape d) Click on the Print Area button and select Set Print Area e) Click in the Print Gridlines checkbox to print the gridlines Now add the required information to the footer: f) Click Insert Header and Footer g) Click in the Footer box at the bottom of the page h) Key your name into the box then press the spacebar i) Click on the date tool button to insert the date and press the spacebar j) Key in Printout 1 k) To close the footer click on one of the cells in your spreadsheet l) Click View Normal 6 Print the spreadsheet ensuring that all data is fully displayed (ie that the columns are wide enough to display all the information). 7 Save as hotels3. Page 17
Task C 1 In cell J1 add a new column title Single Discount 2 In cell J2 insert a function which shows the expression Yes if the Single cost of 4 night stay is more than or equal to 280, but otherwise shows No Remember this will be an IF function: =IF(singlecostof4nightstay>=280, Yes, No ) you will need to use the cell references! 3 In cell K1 add a new column title Double Discount 4 In cell K2 insert a function which shows the expression Yes if the Double cost of 4 night stay is more than or equal to 350, but otherwise shows No Remember this will be an IF function: =IF(doublecostof4nightstay>=350, Yes, No ) 5 Replicate these formulas down the other rows on the spreadsheet. 6 Display only those hotels that are giving a discount on double rooms. a) Click on the Data tab b) Click on the Filter tool c) You will see drop-down arrows appear next to the headings d) Click on the arrow next to Double Discount e) Select only the Yes option then click OK f) You will now only see the Hotels offering discount. 7 In cell L1 add a new column title of Discount. 8 Discount is Double cost of 4 night stay multiplied by 25% In L2 add a formula that calculates the discount for each hotel. 9 In cell M1 add a new column title of Double cost. Page 18
10 Double cost is Double cost of 4 night stay minus the Discount. In M2 add a formula that calculates the Double cost for each hotel. 11 Replicate these formulas down the remaining rows. Format columns L and M as currency with 2 decimal places. 12 Save your spreadsheet as hotels4. 13 Change your view to formula view. a) Click on Formulas Show Formulas 14 Print the spreadsheet showing your formulas with both gridlines and column headings Task D Make sure the footer shows your name, the date and Printout 2. Print in landscape orientation making sure that all data is fully displayed: a) Click on the Page layout tab b) Click on the Scale to Fit expansion button c) On the page setup page make sure the Fit to: button is selected and that it shows 1 page wide by 1 tall d) Click OK Print as normal. 1 Return to standard view by removing the Show Formula (remember in the Formulas ribbon) 2 Remove the Discount filter by clicking Data Filter Page 19
3 Create a line graph of Single and Double for hotels in Germany using the hotel name on the X (horizontal) axis and on the Y (vertical) axis a) Firstly Filter the data on country selecting Germany. b) Now select the data we need for the chart we need the Hotel Name, the Single and Double Highlight the Hotel Name column Press Ctrl then highlight Single and Double columns (Make sure you include the headings) c) Click Insert d) Select 2-D Line you can choose one with or without pointers just make sure it is one from the first column e) Click on the Chart Tools Layout tab f) Click on the Axis Titles Primary Horizontal Axis Title g) Choose Title Below Axis h) Key in Hotel Name Page 20
i) Follow the same procedure for the vertical axis choosing Rotated Title and keying in 4 Give your graph the title Single and Double Room Costs - Germany. a) Click on the Chart Tools Layout tab b) Click on Chart Title Above Chart c) Key in the required text don t worry if it looks a bit too big at the moment. 5 Make sure the legend shows the correct details for each line and save as a new sheet with the title Germany. a) Click on the Chart Tools Design tab b) Select the Move Chart option at the end of the ribbon c) Select the New Sheet option and key in the name d) Click OK 6 Insert a footer showing your name, the date and Printout 3. a) Click Insert Header & Footer b) Select Custom Footer c) Key your name into the left box d) Click in the centre box and click the date option e) Click in the right box and key in Printout 3 f) Click OK then OK again. 7 Save as hotels5. 8 Print a copy of the chart. Page 21