INFORMATION SHEET 24002/1: AN EXCEL PRIMER How to use this document This guide to the basics of Microsoft Excel is intended for those people who use the program, but need or wish to know more than the basic type your data in here and write the number that appears here. It is not specifically oriented towards the road construction industry, and if you wish to practice what you have learnt, you should use your own data and calculations as an example. What is a Spreadsheet? A spreadsheet is an electronic piece of paper containing tables of figures for such things as budgets, cash books, inventories etc; anywhere where rows and columns of data and figures are required. A spreadsheet is a computerised worksheet laid out in columns and rows. You type in column and row headings, then simply fill in the numbers you want in each row. Instead of using a calculator you now tell the program the calculations you want performed. The chart below took about 1/10 of a second to calculate. A spreadsheet is therefore a computerised version of your calculator with more power. Simple budget planners are a good example. Budget Planner Monthly Expenses Jan Feb March April May June TOTAL Fixed 628 628 628 628 628 628 3,768 Variable 450 601 740 620 340 140 2,891 Sundry 529 529 450 110 850 360 2,828 Total Expenses 1,607 1,758 1,818 1,358 1,818 1.,128 9,487 Income Fixed 3,120 3,120 3,120 3,120 3,120 3,120 18,720 Variable 70 75 50 100 150 60 505 Total Income 3,190 3,195 3,170 3,220 3,270 3,180 19,255 Total Savings 1,583 1,437 1,352 1,862 1,452 2,052 9,738
On the simple spreadsheet on the previous page there are a number of calculations: To find the total amount of savings, you would have to: add together the fixed, variable and sundry expenses for each month to find the total expenses add together the fixed and variable incomes, for each month, in order to find the total income subtract the total income from the total expenses, for each month, in order to find the total savings That is 26 calculations so far involving 90 numbers! Let s imagine you get a pay rise and so your fixed income has increased, but so does your rent! With a calculator, the calculations would have to be done all over again from the start. This is the greatest benefit of a spreadsheet - alter one figure and the spreadsheet will automatically recalculate. The ability to recalculate (at lightning speed) gives spreadsheets an advantage that paper and pencil will never have. A spreadsheet allows you to: create electronic worksheets by typing in headings, numbers and calculations calculate answers to problems involving numbers automatically recalculate the answers if any numbers are changed view your worksheet on the computer screen and print it view and print graphs illustrating your figures Spreadsheets may be used for: laboratory calculations test method results budget and forecast analysis sales and profit projections personnel records analysis stock control job cost estimates Page 2 of 10
Parts of a spreadsheet Formula bar Active cell Active cell name The basic parts of the spreadsheet are: Row a horizontal line of cells; they are represented by numbers listed down the left hand side of the screen Column a vertical line of cells. They are represented by letters listed across the top of the screen Cell the basic unit of the spreadsheet, which is designed to hold one piece of information. You identify the cell by the letter of the column and the number of the row that the cell is in, for example A1. Active cell the cell is outlined with a thicker box for you to see more readily; this is cell you can enter data in or edit existing data. Formula bar displays what is entered in the active cell, which in the case of a formula is not what is displayed in the cell Spreadsheets are very large. They have more than a million rows and columns!!! Who would create a spreadsheet needing so much space your guess is as good as ours! Data entry Data entry is the process of entering data into individual cells. When data is keyed in, it is shown on the formula bar. When you press Tab, Enter or any Arrow key from the keyboard, the data is then shown in the active cell of the worksheet. Page 3 of 10
There are a number of types of information that can be entered into a cell: Text allows you to enter names onto the columns, and headings onto the worksheet and meaning into the whole spreadsheet Numbers fairly obviously, since this is a calculation program Formulae an expression indicating the way in which you want numeric data to be manipulated, e.g. =B5+G4 means you want to add together the contents of Cell B5 and G4. Function a special type of formula, e.g. =AVERAGE(A1:B2) means that the average of the values in all those cells A1, A2, B1 and B2, called a range indicated by the first (top left) and last (bottom right) cells separated by a colon is calculated and displayed in the cell The spreadsheet determines which data type is being entered by the first keystroke of the cell entry. If the first keystroke is not a equals (=) sign, then the computer assumes it is not a formula, but ordinary text. When you highlight a row or a column by clicking in the coloured area to the left or top indicating the row or column name, be aware you are highlighting many more cells than what you can see. To move around a spreadsheet you can use the keyboard arrows (located at the bottom right of your keyboard). You can also use the scroll bars, as in the word processor. Why use a spreadsheet? People use spreadsheets because the computer can calculate things faster and it is very simple to update a spreadsheet if it has been designed correctly. The most important thing to remember about spreadsheets is that you use cell references (i.e. A3) in calculations rather than typing in actual numbers (i.e. the number 3). For example look at the very simple spreadsheet below that adds two numbers together. A B C D 1 2 3 =2+3 2 2 3 =A2+B2 3 Both answers that would be displayed in column C would be the same. However the correct way is the formula in row 2, because if the numbers in column A or B change, the answer would automatically change. Page 4 of 10
EXERCISE 1. USING CELL REFERENCES IN FORMULAE 1. Type in the simple spreadsheet above into the blank spreadsheet you currently have open. (You can use the set of four arrows on your keyboard to move from cell to cell, or move your mouse over the cell you want to type in and left-click.) 2. Now change cell A1 and A2 to the number 6, and press Enter. (Notice that cell C2 changes to the new correct answer but cell C1 doesn t) Mathematics in Excel The table below shows how to use the basic mathematical operations on two numbers in two different cell locations. In the example used, the number 40 is in cell C6 and the number 10 is in cell D6. Operation Symbol Formulae Result Addition + = C6 + D6 = 40 + 10 = 50 Subtraction - = C6 - D6 = 40 10 = 30 Multiplication * = C6 * D6 = 40 * 10 = 400 Division / = C6 / D6 = 40 / 10 = 4 Mathematical expressions are calculated in a specific order based on the type of operation being performed and symbols, such as brackets. This order is the same as those used by people doing any type of calculation, by calculators and by all computer spreadsheet packages: 1. Brackets ( ) 2. Exponential (eg. 4 2 or m 3 ) 3. Multiplication & division 4. Addition & subtraction That is, all the calculations in brackets are done first, followed by any multiplication and division, before any addition and subtraction. Page 5 of 10
Formula Answer Explanation = 5 + 4 * 2 13 4 and 2 are multiplied first ( giving 8 ) then 5 is added (giving 13) = (5 + 3) * 2 18 5 and 4 are added first ( giving 9 ) then multiplied by 2 (giving 18) = 5 * 4 / 2 10 Both multiplication & division have the same order so calculation is done from left to right. This answer is the same if the division was done first then the multiplication. Formulae Formulae can be added to a spreadsheet to make it perform these calculations. A formula always begins with an equals (=) sign and typed into the active cell where you want the result to be placed in the spreadsheet. In spreadsheets, cell references are used instead of numbers, so the first formula in the above table would normally be typed as = A1 + B1 * C1 as shown below. A B C D 1 5 3 2 = A1+B1*C1 2 3 EXERCISE 2. WRITING FORMULAE What would the formulae be for the other two calculations in the above table, using the cell references above? Answers at the end of the document. Functions Functions can sometimes be used as short cuts instead of using long or complex calculations. A function is a special type of formula. As with any formula, a function always begins with an equals (=) sign but uses an action word with a cell reference or range of cells in brackets. For example, to calculate the average of a set of values in the cell range A1 to B6 can be done by the formula =AVERAGE(A1:B6). This avoids the alternative way of calculating this =(A1+A2+A3+A4+A5+A6+B1+B2+B3+B4+B5+B6)/12 and also avoids the need to know how many values are in the set. Page 6 of 10
EXERCISE 3. USING FUNCTIONS Try this to demonstrate how functions are better than simple mathematical formulas. 1. Type the number 1 into the first six cells of column A. 2. In cell B1, type =AVERAGE(A1:A6). 3. In cell C1, type =(A1+A2+A3+A4+A5+A6)/6. Both formulas should read 1. 4. Now delete one of the 1s. The function-based formula should still display 1, but the addition-based one will display 0.83333. Some common functions are listed in the following table: Function Example SUM Adds a range of numbers together =SUM(A1:A10) AVERAGE MIN MAX Calculates the average number, from a range of numbers. The average is the sum of all the numbers divided by the number of numerical values in the range. Finds the smallest number in a range of numbers. Finds the largest number in a range of numbers. =AVERAGE(A1:A10) =MIN(A1:A10) =MAX(A1:A10) Functions can also be used in formulas with the mathematical operators (+ - * /) and numbers and cells. For example =B1*AVERAGE(A1:A5)+2.5. Occasionally, you might see ########## in a cell. This simply means that the column is too narrow to show all the data, and needs widening (explained later). Page 7 of 10
EXERCISE 4. CREATING A SIMPLE SPREADSHEET 1. Start Excel a blank worksheet will open up. 2. Enter the information (words & numbers) into the cells as shown in the figure right. 3. In cell B8, enter a formula which calculates the maximum value of the five data values. 4. In cell B9, enter a formula which calculates the minimum value of the five data values. 5. In cell B10, enter a formula which calculates the difference between the maximum and minimum values (called the range). 6. In cell B11, enter a formula which calculates the average value of the five data values. 7. In cell B12, enter a formula which is the equivalent of the equation shown below. 8. Save the spreadsheet, as it can be used to practice some other skills. A few things to note: some amount of the words Relative precision will have disappeared because the text was too wide to fit in column A when there was something in column B changing column width is covered below the number of decimal places in the Relative precision result (B12) is too many that too will be covered below the formula for the range in B10 could have been =MAX(A1:A5)-MIN(A1:A5) but since you had already calculated the maximum and minimum in B8 and B9 with those individual functions, typing them in again is a waste of time Changing the column width There are various ways to do this, but the simplest is to simply drag the right-hand margin of the column header where the letters are to the width you need. You can do similarly with the row height, but this is generally much less likely to be needed. EXERCISE 5 In the spreadsheet you created in Exercise 4, make column A wide enough to show all of the words fully. Page 8 of 10
Formatting text Formatting and aligning text in spreadsheets is basically the same as in word processing. Individual cells and text within cells can be formatted separately. Formatting numbers The most likely display options that you may need to use are controlling the number of decimal places and showing percentages. Both these are found in the Number part of the command ribbon (see right) or the Format Cells dialog (shown below). The quicker way is to use the ribbon buttons which are fairly self-explanatory. EXERCISE 6 In the spreadsheet created in Exercise 4, select % for the value calculated for the Relative precision. (a) What do you notice? (b) Remove the 100* from the formula. That problem is now corrected. (c) Change the number of decimals to 1. Page 9 of 10
Inserting rows and columns The simplest way to add an extra column (or row) is to click in the cell to the right (for a column) or below (for a row) where you want the addition to occur. Right click the mouse and choose Insert. Deleting rows and columns This is also done most simply by right-clicking, but this time it is the current row or column (not an adjacent one) that disappears. Always remember the Undo function! Charts Charts (normal people call them graphs) allow you to display the information from a spreadsheet in a graph. Charts will show a variety of trends and relationships, and may make understanding the data easier. Charts can then easily be placed into a report or into a word processing document. The unit Process and interpret data has three Information Sheets 5, 6 & 7 which cover graphing in some detail, and also certain aspects of the use of Excel for graphing. It is very simply to create a generic graph in Excel. Go to the Insert tab, highlight the data you want graphed and click on the graph type. Getting the formatting exactly as you might wish is then a matter of experimentation. Answers to Exercises 2. =(A1+B1)*C1 =A1*B1/C1 4. The two formulas that require more than just a function are those in B10 and B12: B10: =B8-B9 B12: =100* (0.5*B10)/B11 or =50*B10/B11 6. (a) a % symbol is added, but the value is 100 times too high, because using the % format automatically multiplies the value in the cell by 100, which your formula has done as well. Page 10 of 10