Excel Tutorial
Excel Tutorial
This document was developed based on Microsoft Excel 2000 for Microsoft Windows. Other versions of Excel or for operating systems may have different procedures and functionality. With all spreadsheet programs, there is more than one way to reach the same goal (formatting, formulas, etc.). This tutorial provides one way; you are free to use any procedure that obtains the same goal.
Based on Excel: The Basics v6.1 (1/7/00) Copyright 1999 the Trustees of Indiana University
Documentation developed and the copyright of Indiana University-Bloomington, UITS Education Program Wrubel Computing Center, 2711 East 10th Street, Bloomington, IN 47408-2671, phone (812) 855-7383.
Revised by David Stoll (dstoll@uvic.ca), 1999. http://www.cous.uvic.ca/esg/ Revised for Chemistry 212 (University of Victoria) by Suzanne Manley, 2001. Updated by Jane Browning and Nichole Taylor, as required.
1 Student Exercises
The hand-in exercises required for Chem 212 begin on page 22. Sections 11 to 15 are due at the end of the class. Section 16 is the assignment due next week.
Excel Tutorial 1
Contents
1 2
2.1 2.2 2.3
1 3
3 3 4
AutoFill Changing Column Widths Drag and Drop Enter Formulas and Functions AutoFill vs. Copy and Paste Editing a Formula or Function
16 17 18 18 19 20
10
Cell Addresses
10.2.a 10.2.b 10.2.c Formula 10.2.d Clearing Cells Fixing the PST Formula Use AutoFill to Copy the Corrected 21 Enter the Total Formula and copy it
20
20 20
21 21 21
4
4.1 4.2 4.3 4.4 4.5 4.6
Starting up Excel
Start Excel The Opening Screen Resize Handles Moving the Active Cell Opening an Existing Worksheet Understanding the Worksheet
4
4 5 6 7 7 7
22
23 23 24 24 25
25
5
5.1 5.2 5.3
8
8 8 8
6
6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8
Formulas
Understanding Formulas Formulas, The Cell, and The Formula Bar The Formula in Action Copying Formulas Clearing Formulas Entering a Formula Copying and Pasting a Formula Complex Formulas
9
9 9 9 10 10 10 10 11
27
27 28 28
13
30
30 31 32 33
33 33
7
7.1 7.2 7.3 7.4 7.5
Functions
SUM Average The Power of Functions Formula and Function Summary Saving the Inform Worksheet Edit in the Formula Bar Editing in a Cell
To fix basic typos while typing To Editing Existing Data in a Worksheet To Cancel Edits
12
12 12 12 13 13 13 14
14 14 15
13.1 Create a Calibration Curve 13.2 Format the New Graph; Add Trendline 13.3 Renaming Charts and Worksheet Tabs 13.4 Common Charting Errors
13.4.a 13.4.b Add a Chart Title Add Regression Equations to Graph
14
Printing
34
34 35 36 37
8
8.1 8.2
14.1 What will Excel Print 14.2 Use File menu Page Setup to set page options, margins, headers and footers, etc. 14.3 Preview the Worksheet 14.4 Printing the Worksheet
15 16
37 37
Excel Tutorial 2
38
38 38 39 39 39
Predefined Styles (Format menu Style). 39 Create Your Own Style 40 Turn off Style Features 40
17.6 Add Rows and Columns 17.7 Removing Rows or Columns 17.8 Centering a Title Across a Range
40 41 41
19.5 Add text labels to the bubbles or legend 19.6 Area Charts 19.7 Bubble Charts 19.8 Bar Charts 19.9 Column Charts 19.10 Bar and Column Chart Variations 19.11 Doughnut Charts 19.12 Line Charts 19.13 Pie Charts 19.14 Radar Charts 19.15 Stock (High, Low, Close) Charts 19.16 Surface Charts 19.17 XY (Scatter Charts) 19.18 Combination charts
19.18.a Create a combination chart using the built-in custom chart types: 19.18.b Create User-Defined Custom Chart 19.18.c Changing the Default Chart Type
45 46 46 47 47 48 48 48 49 49 49 50 50 50
51 51 52
43
43 44 44 44
2.2
2.3
3.2
A docked toolbar can be positioned along the edge of the application area. A floating toolbar is moved out into the document area.
3.3
Toolbar buttons are convenient, but depending on the button it may: a) have limited options; while the drop-down menu equivalent has the full set of options, e.g., the print button sends one copy to the last used printer, but using File Print gives access to all printing options. b) use the last used settings of menus with ellipses (). For example, the number and bullet list buttons change as Format Bullets and Numbering settings are changed.
3.4
All toolbars can be displayed from the View menu Toolbars. Click to check and display a toolbar. Click again to uncheck and close the toolbar.
4 Starting up Excel
Your instructor will tell you where the exercise file is located and where to save your work. Excel is a basic spreadsheet program which allows you to keep track of information in tables, perform mathematical functions with data, and create graphs and charts from them. There are no substantive differences between Excel on the PC and Excel on the Macintosh.
4.1
Start Excel
From the Start menu, select Programs. Start Excel from the menu list. Excel loads and you see the opening screen.
Excel Tutorial 4
The Office Assistant is designed to help you in your Excel work. We will not be using the Office Assistant for todays class. If the Office Assistant is displayed, hide it: In Excel 97 Click the Office Assistant Close button in the upper right corner. OR: To hide the Assistant, right-click the Assistant, and then click Hide Assistant on the shortcut menu. If the Assistant shows a tip, message, or Help topic, close it, and then hide the Assistant. To set the Office Assistant so it does not provide Help with wizards, click the Assistant, and then click Options. On the Options tab, clear the Help with wizards check box.
4.2
Rows (6, 7, 8)
Work Space
Similar to any Windows application, there are: a menu bar, scroll bars, minimize and maximize buttons, and a title bar. Excel also has its own toolbar for quick access to commands. Most of the screen is covered with a grid of rows and columns. The rows are labelled with numbers and the columns are labelled with letters. This grid is your spreadsheet work area, where you will enter your data and the see the results of your calculations. The intersection of any column and row is called a cell. Cells have addresses. The cell address is its column letter followed by its row number. For example, the name of the highlighted cell (in column A, row 2) is A2. The formula bar, which is right below the toolbar, is used for examining and editing the contents of cells.
Excel Tutorial 5
The cursor is shaped like a thick plus sign. The shape of the cursor changes in Excel. It is important to notice the shape as different cursor shapes mean different things to Excel. Excel creates documents as workbooks. Each workbook can contain many spreadsheets. Each spreadsheet has a tab on the bottom marked Sheet1, Sheet2, etc. These sheets can be added, deleted, rearranged, and the tabs renamed. Earlier versions of Excel (before Version 6.0) did not allow this. Each spreadsheet was saved as an individual file. The active cell is the cell that Excel is looking at. In a new worksheet, the active cell is cell A1. Open a pre-existing worksheet; the active cell is wherever you left it when you saved the worksheet. Data is always entered into the active cell. The active cell displays: With a highlighted border around the cell The name of the active cell is shown in the Active Cell Address Box to the left of the formula bar.
4.3
Resize Handles
One of the common frustrations that new users have with any windows program is that the mouse wont do what I want it to!. This can occur when an object in the window is selected; under these conditions, only commands that change that object can be accessed. If an object is selected, it will have resize handles on it. Below are some pictures showing an Excel graph with the resize handles shown for different areas of the graph: In the first example, a graph was created as part of an object in the spreadsheet. The entire graph is selected. You wont be able to move anywhere until you click on the spreadsheet work area and get rid of the resize handles! In the second example, the title of the chart is selected. This is a two-step process; first the chart is selected as in example one; then you can click on the title to select it. The third example shows the trendline equation box selected. You wont be able to change the plot area settings until the plot area is selected, i.e., the inner frame of the graph will have resize handles around it. If you cant get the resize handles to go away, press the Esc key until they disappear.
Excel Tutorial 6
4.4
Lets move the active cell with the mouse and the keyboard. Using the Mouse 1. To select a new active cell using the mouse, click any cell. The cell is highlighted and the name of the cell is shown in the Cell Address box. Using the Keyboard To move the active cell one cell at a time press the following keys:
or or or
To move the active cell up or down a screenful, press: page up key or page down key To move the active cell back to cell A1, press: Ctrl and Home keys
4.5
Lets open an existing worksheet. Well open the file Inform.xls, which will illustrate many of the basic principles of how real spreadsheets are organized. 1. To open an existing file, on the menu bar, click File, click Open The Open dialog requires two items: the location and name of the file. 2. Change the Look in field to the Desktop, 3. Double click any additional folders from those listed as instructed, so the required folder is now listed as the Look in field 4. Double click the file inform.xls 5. The worksheet opens on your screen.
4.6
The worksheet is shown is designed to track sales for a small business. The second column (B) lists the items for sale, the third column (C) lists the price of each item, the fourth column (D) lists the number of items sold, and the fifth column (E) shows the total price, which is calculated by multiplying columns three and four (C x D). A real business would have many more items for sale. We have fewer items, but the organizational structure could be used in a much larger worksheet.
Excel Tutorial 7
5.1
Notice that the text in the cell Items is displayed in bold face, but the text in the formula bar Items is in plain text. This is because bold face was turned on for the cell, not the text itself. The formula bar will always display the true contents of the cell, independent of any special formatting. 1. To see the contents of cell B3, press: 2. Cell B3 and the formula bar look the same because no special formatting functions were applied to this cell.
5.2
Data Entry
Suppose cell B3 we want to change the contents from Shovel to Spade. Select cell B3 if it is not the Active cell. 1. Type: Spade and press the Enter key. 2. The contents of the cell are changed. Any text entered into the active cell replaces anything that was already there once the cell is no longer the Active cell. This is an easy way to enter data. 3. View the contents of other cells in column B, press: one or more times. The real contents of the active cell are displayed in the formula bar.
5.3
Numbers
Numbers are numbers. Cells with numbers can be formatted in bold, italics etc., just as you can with text. Numbers can also be formatted in other ways such as currency, percentages, dates and time, with or without commas, etc. 1. Look at a cell containing a number, click cell C3. The data shown in the cell $8.59 is not the same as the data in the formula bar 8.59. The cell was set to display its numbers in currency format. 2. Examine some of the other cells in column C. You see the same difference between the data displayed in the cell and the formula bar. 3. Examine cells with numbers in column D. No special formatting was assigned to these cells, the spreadsheet cell data looks the same as the formula bar data.
Excel Tutorial 8
6 Formulas
The real power of a spreadsheet is with formulas. A formula uses standard mathematical symbols to operate on cell addresses and/or numbers. A formula always begins with the equal sign (=). Mathematical symbols (in order of operations on an expression) include: Brackets () to group expressions Exponent uses a caret ^ to raise a number to a power, e.g. 2^3 = 2*2*2 = 8 Division uses a forward slash / Multiplication uses an asterisk * Additions uses a plus + Subtraction uses a minus 1. View the formula in cell E3, click cell E3. The cell shows the data $17.18, while the formula is shown in the formula bar: =C3*D3. Cell data looks different than the real contents of the cell in the formula bar.
6.1
Understanding Formulas
The formula =C3*D3 means Excel multiplies the value in cell C3 by the value in cell D3. The answer is displayed in the worksheet cell, but the real cell contents is the formula.
6.2
6.3
2. Type in cell D3: 12 and press the Enter key. The formula results in E3 have been automatically recalculated. Manually recalculate a work sheet. Excel has been known to get stuck and not recalculate. This may be because Excel recalculates a worksheet in the order from upper left cell to lower right cell. If a formula contains a formula reference to a cell also containing a formula and the second formula is below or to the right of the first, the first formula depends on data that has not yet been calculated. (Newer versions of Excel are good at catching this but if you have doubts..) So, if Excel gets stuck and wont recalculate, you can press the F9 Options Calculation tab to force a manual recalculation.
Excel Tutorial 9
6.4
Copying Formulas
Look at the contents of other cells in column E and note the formula similarity. Cell E4 contains the formula =C4*D4. Cell E5 contains the formula =C5*D5. The only thing that changes is the row number. The formula can be entered once then copy and paste it to the other cells. Lets copy and paste this formula in column E, but first we will have to clear out all of the formula cells in column E.
6.5
Clearing Formulas
Lets clear the contents of cells E3 though E9, we want to keep the contents of row 10. 1. Select cells E3 through E9 by Click and drag from cell E3 to cell E9 or click cell E3, hold down either Shift
press to cell E9 2. Clear the contents of the highlighted cells, press: Delete or Edit menu Clear - All Note the first cell of the range is highlighted differently than the other selected cells. This says it is the Active cell and the thick border says it is part of the selected range of cells.
key then click cell E9 or select cell E3, hold down a Shift key then
6.6
1. 2. 3. 4.
Entering a Formula
Make E3 your active cell, click cell E3 Enter the formula, type: =C3*D3 Accept the formula, move off cell E3 (press enter, arrow key, click another cell) The results are displayed in cell E3.
6.7
Excel Tutorial 10
2. Copy the formula. Choose a menu, keyboard shortcut, or toolbar method. Edit menu Copy, Ctrl-C (Mac Cmd-C), or the toolbar Copy button. A flashing marquee appears around cell E3, indicating the contents are copied. Note the message in the status bar. 3. Highlight the cells to paste the formula into, Click and drag cell E4 through E9 4. Paste the copied formula into the highlighted cells, choose from: 5. Edit menu Paste, Ctrl V , or Shift Insert. The formula is now in cells E4 through E9. This is called a relative addressing. The formula cell addresses are adjusted relative to the row in which they are pasted. Relative addressing also applies if we had pasted across columns. This gives us a correct formula in each cell.
6.8
Complex Formulas
All Excel formulas follow the same rules of Algebra, including the order of operations. Here is a sample complex formula. =((C2 + D2) * 12 + (A2 ^ B2))/E2 which is the spreadsheet (C 2 + D 2) 12 + A2 B 2 version of: E2 Excel reads an equation from left to right following the BEDMAS rule. 1. Excel performs all operations in Brackets (parentheses). If more than one set of brackets, only the inner-most set of brackets 2. Excel does Exponentiation. 3. Excel does Division and Multiplication. 4. Excel does Addition and Subtraction. 5. If there are nested brackets repeat steps 2-4 with the next inner-most bracket. 6. Repeat steps 2-5 until Excel reaches the outer-most brackets. If the formula has no brackets then only steps 2-4 are used. In the above example, Excel adds cells C2 and D2 first. Then calculations move to the next set of brackets and raise A2 to the B2 power. Next, the result of C2+D2 is multiplied times 12; then these two results (C2+D2)*12 and (A2^B2) are added together. Finally the numerator result is divided by E2. Skill testing questions like (2+4) * 5 + 9 / 3 using these rules gives 6 * 5 + 9 /3 = 30 + 3 = 33. Brackets determine the correct order of calculations, so this formula could have been written as ((2+4) * 5) + (9 / 3) and calculated from inner to outer brackets.
Excel Tutorial 11
7 Functions
Some formulas are used so often that Excel includes them. These common formulas are called functions. They begin with the equal sign, like formulas, and are followed by a keyword identifier that tells Excel which function this is, and in brackets any required values the functions needs.
7.1
SUM
Adding a column or row of numbers used to require a formula like: =A1 + A2 + A3 + A4 + A5 can be replaced by the SUM function =SUM(A1:A5). Yes, you can type the function, but there are even easier ways of working with functions. 1. Click cell E10 to see the SUM function. 2. Move to cell D10 to add the SUM function here . Excel puts a marquee around what it believes to be the range of 3. On the toolbar, click cells to sum. If Excel guessed wrong, just reselect the correct cells. 4. Press Enter to see the sum.
7.2
Average
The AVERAGE function calculates the mathematical average of a range of cell values. 1. Click cell C10 to see the AVERAGE function. 2. Delete the contents of cell C10. We will replace the function. 3. Open the Paste Function dialog by using Insert menu Function or use the Toolbar and click 4. Explore the list of available functions, left category groups, rightclick function. 5. Select AVERAGE from the All, Statistical, or Most Recently Use. Click the Function Name AVERAGE, then click OK. 6. Excel puts a marquee around what it believes to be the range of cells to sum. If Excel guessed wrong, just reselect the correct cells. 7. Press Enter to see the average.
7.3
Functions, like formulas are automatically recalculated if the values it uses change. 1. Click cell D4 The cell indicate 5 pick axes sold. 2. Change the 5 to 50 and press Enter. 3. The formulas in cells E4, D10 and E10 display updated result for total number sold and the total cost.
Excel Tutorial 12
7.4
7.5
Lets save our revisions before we close the file. This worksheet was created in an earlier version of Excel. 1. From the File menu, click Save, or keyboard Ctrl + S or Toolbar
2. A dialog box tells you the file is read-only. In order to save any changes, a new name must be assigned to the file. For example, you could rename the file Inform2.xls. 3. Close the Inform worksheet, select File menu Close. The worksheet closes and disappears from screen.
8.1
1. Click cell B1 2. In the active cell, type: 1990 (do not press enter yet!). As soon as you start typing, what is typed appears in the formula bar.
Excel Tutorial 13
3. The formula bar also has buttons for Cancel, Enter and begin a Formula:
Cancel Start formula
Enter
Cancel cancels typing and puts the cell back the way it was before typing. Enter looks like a check mark because Excel checks for logical errors and enters your typing into the cell. Excel will not automatically check your spelling. = we have seen before to enter formulas and functions. The formula bar button enters the = into the formula bar for you!
8.2
Editing in a Cell
2. Select the 2 by: Click and drag across the 2 to select it or use the arrow keys to position the insertion cursor next to the 2, hold down the Shift key and use the left or right arrow key to select it. Use Home and End keys to move to the beginning or end of the entry. 3. Type: 9 4. Move off the cell and number is changed.
b. Click the Undo toolbar button 4. The original value in the cell is restored.
5. Excel keeps track of editing changes so you can step back. There is a redo in case you undo too far. Excel erases this history of editing changes when you close the open Workbook so you can undo and redo changes made only since opening the file.
Demonstration Worksheet
Fill in the A column labels 1. In cell A2 type: Supplies 2. In cell A3 type: Services 3. In cell A4 type: Training 4. In cell A5 type: Production
9.1
AutoFill
AutoFill, allows you to create a series of values based on one or two values. A mouse that is clean, have a good mouse pad, etc. will help in this step. To enter the Column Headings, we will enter only the first then use time-saving AutoFill. 1. Click cell B1 2. Type in B1: 1st Quarter 3. Press the Enter key. 4. Click cell B1 Note: AutoFill is the box in the lower right corner of the highlighted border area. 5. Click and hold the mouse buttons on the box in the lower right corner of B1. The cursor changes from a fat, white plus symbol, to a thin, solid, crosshairs plus symbol. The crosshairs cursor is what you need to activate AutoFill. 6. With the crosshair cursor, Drag across to cell E1. 7. Release the mouse button and the series is filled in. Entering the numbers using AutoFill requires entering at least two numbers in sequence to establish the nature of the series 1. Fill in cells: B2 type: 100 C2 type: 200 B3 type: 200 C3 type: 400 2. Highlight these cells, Click and drag cells B2 to C3
Excel Tutorial 16
3. Click and hold the mouse button on the AutoFill handle in the lower right corner. The cursor must change to a thin, solid, crosshairs plus symbol. 4. With the crosshair cursor, Drag across to cell E3. 5. Release the mouse button and the series is filled in. 6. To AutoFill down the first two columns, make sure you still have the crosshairs cursor, Click and drag down to cell E5 7. Release the mouse button and the series is filled in. More about AutoFill AutoFill can fill by row or by column. AutoFill cannot fill diagonally. For a single cell of character and/or numbers, AutoFill will repeat that cell. For a single cell of characters and/or numbers, and the first character is a number, AutoFill will increment by one beginning with the number, providing there is a space between the number and the character. For two cells with numbers, AutoFill will increment by the difference of these two numbers, e.g. 1 3 will give the series 1 3 5 7 9. AutoFill knows the days of the week given any two days in two cells including capitalization, and common abbreviations like Mon, Tue. AutoFill knows the months of the year given any two months in two cells including capitalization, and common abbreviations like Feb, Mar. To add other AutoFill lists go to the Tools menu Options Custom Lists tab.
9.2
Columns B through E are not wide enough to show the data we just entered. Excel adjusts the row heights automatically for different font sizes. But column widths must be manually adjusted. Excel give two methods to do this. Using the mouse 1. Position the cursor at the border between two column headings to change the cursor into a widen cursor. 2. Click and drag right makes the left column wider. 3. Click and drag left makes the left column narrower. To make multiple columns adjusted as a group to a new width. 4. Select column headings click the column header and drag from the first to last column (B to E). 5. Change the width of one of the columns using the above three steps. Changes to that column are applied to all of the selected columns. 6. Or Double click with the widen cursor to autofit the columns. 7. Deselect columns by clicking outside the selected columns, or use the arrow keys. Entering the Rest of your Data 8. In cell C10 type: Sub Total 9. In cell C11, type: Tax 10. In cell C12, type: Total 11. In cell C14, type: PST (leave C13 blank) 12. In cell C15, type: 0.07
Excel Tutorial 17
Saving Your Worksheet Save your work regularly, especially if you are trying new things. This way you can revert back to the saved file should things go wrong. 1. Save the worksheet using the Save As dialog since this is the first time we are saving this file. Use File menu Save As. 2. Name the workbook: exercise. 3. Choose to save to your diskette, drive A.
9.3
The contents of cells C10 to C15 are in the wrong location, they should be in A6 to A11. There are four ways to put the contents in cells A6 to A11. The hard way! Delete cells C10 to C15 and retype the contents again. The so-so way! Copy and Paste, then Delete cells C10 to C15. This is fine! Cut and Paste using toolbar, OR Ctrl X then Ctrl V, OR Edit menu 1. Select cells, position cursor Cut, OR Ctrl Delete then Shift Insert. This on the border. uses the clipboard to temporarily hold the cut cells. A new way! Drag and Drop. This does not use the clipboard. Excel supports Drag and Drop: grab one or more cells with the mouse, then drag them to another 2. Click, drag location and drop them in place. to new position and release. 1. Select the cells C10 to C15, 2. Click the edge of the selected range. At the edge the fat-plus cursor turns into an arrow-shaped cursor needed to perform the drag and drop. 3. Hold down the mouse button and drag the selected range to a new location, cells to A6 through A11. 4. Release the mouse button and the selected cells drop in the new location.
9.4
Add the needed formulas and functions to calculate the results you want for the sub-total, tax, and total rows. Calculate the totals for each column cell B6 to E6. Method 1, enter the formula =B2+B3+B4+B5. That works but is very inefficient.
Method 2, use the AutoSum button Method 3, use the SUM function with the Paste Function dialog.
Lets use method 3. 1. Select cell B6. , or use the Insert menu 2. Open the Paste Function dialog by clicking on the Toolbar Function If the Office Assistant appears, close it by clicking No, dont provide help now.
Excel Tutorial 18
3. We could access the SUM function from the Most Recently Used category; or another way is from the All category. For this example, click All. 4. In the Function Name list, click anywhere. 5. To jump to the S part of the Function Name list, type: s 6. Then press:
until the word SUM is highlighted. You could also have typed SUM
very quickly. The problem is if you took too long between the characters Excel would go to other functions beginning with U or M. 7. With the SUM function selected, to confirm your choice, click OK 8. A new dialog box opens to paste the arguments to the SUM function.
If this dialog covers up cells you want to see, click on any of gray background and drag it out of the way. Excel has already filled in a suggested cells. If incorrect it can be changed by typing in the cells, or selecting the cells right on the worksheet. If different ranges of cells were needed, each separate range could be entered in the NumberX area. Excel will add an additional Number area as needed. Note the numbers listed to the right of the selected range and the Formula result = are shown so you can verify the calculation to be made. Need more help on any function? Click the ? button in the lower left. 9. Click the OK button to display the function in the cell.
Copying Functions Using AutoFill Cells C6, D6, and E6 have identical function except for the column letters so we can copy and paste the function or use AutoFill. Lets use the AutoFill function to copy the data. 1. Select cell B6 2. Copy the function using AutoFill, point to the AutoFill handle so cursor changes to the AutoFill crosshairs. 3. Click and drag across to cell E6 4. Release the mouse button. 5. Examine the contents of cells C6 to E6 to see the copied function changed its parameters to correctly reference the column it was copied to.
9.5
9.6
Rules for editing a function or formula follow those for editing any other entry. Use the Formula Bar to make edits. The only difference is pressing Enter or the check mark button, Excel checks the formula or function for logical errors. If none are found, it is entered. If an error is detected, Excel will highlight the equation at the point where the error was detected.
Add the PST Formula This is similar to the previous step, enter the formula then copy with AutoFill. 1. Select cell B7 2. Enter the formula to calculate the Sub-total * Tax, type: =B6*A11 3. AutoFill to Copy the Formula select cell B7, 4. Get the crosshair cursor on the AutoFill handle in the lower right corner 5. Click and drag across to cell E7 6. Release the mouse button to paste the formula in the selected cells 7. There is a problem. You see zeroes in cells C7 through E7.
Examine the contents of these cells; the formula did as instructed in adjusting the formula relative to the column (or row) in which it has been pasted. It now no longer refers to cell A11, where the PST Rate is located. Before we fix this problem, we need to understand relative and absolute cell addresses.
10 Cell Addresses
Excel cell addresses are interpreted in terms of relative positions. A cell address is an instruction to take the value that is located so many cells up/down/left/right from the current position. Usually, this is just what we want. When getting the Sub-totals and summed columns in earlier exercises, Excel adjusted our formulas and functions appropriately. Now we have a formula that needs to reference just the value stored in one cell (A11) for a series of formulas. Each time the copy moved to the right, the formula adjusted the location for where to find the Tax Rate value. We could solve this by putting a row of Tax Rate values, but this is inefficient and not very nice to look at. The solution: enter Relative and Absolute cell referencing.
The PST is in cell A11 in the tax formula it is written as $A$11 to make it an absolute cell address reference, so the formula would read =B6*$A$11. Then there is only one cell to update should the PST ever change. All cells which refer to it will be automatically updated if the cell value changes. Thus there are four possible ways to reference a cell: A1 Relative cell reference, changes as it is copied to other rows or columns. $A$1 Absolute cell reference, does not change as it is copied to another location. $A1 Absolute column, relative row reference. The column does not change while the row does as it is copied to another location. A$1 Relative column, absolute row reference. The column changes while the row does not as it is copied to another location. To change relative references to absolute (and vice versa). Select the cell that contains the formula. In the formula bar, select the reference you want to change and then press F4. Each press of F4, Excel toggles through the above combinations. Once you have the combination that you want, press Enter The correct address type will be saved, and the active cell will move down one row; to make sure the address is correct, click on the formula cell.
12. Place the plus sign into the formula, type: + 13. Place the second cell in the formula, click cell B7 14. The formula bar reads =B6+B7. Accept it, press: Enter or click the Check Mark. 15. Copy the formula, select cell B8, 16. Use AutoFill to click and drag across to cell E8 17. Release the mouse button to paste formulas in the cells and display the totals. 18. Save your worksheet again, use any method you prefer: File menu Save, or keyboard shortcut Ctrl + S or Toolbar
Excel Tutorial 22
Excel Tutorial 23
HELP!
4. To obtain detailed help on a function, click the lower left corner ?. If necessary it is possible to nest functions, that is, to insert a function within a function. Do this with caution as complex calculations increase the possibility of errors. Consider instead of creating a complex function calculation, by using a single function to generate intermediate results in a cell. Then use the intermediate result for the next function.
Excel Tutorial 24
The Average dialog box open and Excel selects what it believes to be the range of cells to use, ignoring any labels in the column. Excel will pick the wrong cells, so move the dialog box out of the way and highlight the correct cells as shown above. The function is also displayed in the formula bar. 5. Verify the selected range and the Formula result. If everything is correct, click the OK button or press the Enter key. The result of 5183.66 is displayed in cell C19.
If Excel selects incorrect cells: Type the correct range (the harder way) or Click and drag in the sheet to select the required cells (an easier way) If the formula box is in the way of data cells, either: Click in any of the grey areas and drag it out of the way or Click the minimize/hide dialog button at the right side of fill-in area. Click the minimize/hide button to restore the dialog, or press the Enter key. If the range of cells required are not all in the same column or row: Use the Number 2 area, click or Tab to this area and select the next range of cells. If more cell ranges are needed a Number 3 area is added. Up to 30 cell ranges can been filled. Click the OK button or press the Enter key to calculate the function.
incomes are not so evenly distributed. Nine residents have 0 income and one has an income of $100,000. For the second town the standard deviation is 31,622.78. Using statistical measures like the standard deviation would uncover such uneven distribution and allow for a more descriptive and accurate analysis to be made. We will use the same information from the 100.10 ng/mL standard, for this exercise and not use the Paste Function. The basic standard deviation function is: =STDEV(number1, number2, ). The case of the letters doesnt matter; Excel will convert everything to upper case. 1. Select cell D19. 2. In the cell type: =STDEV(B19:B21). (Be sure to start with the equal sign.) OR: either type in the correct range of cells, B19:B21, or click and drag to select the range, after opening parentheses. (The colon means include all cells in from the first to last cell range.) 3. Verify the selected range, and the Formula result. 4. Click the OK button or press the Enter key. If you have forgotten to type in the last bracket ), Excel will add it. The standard deviation of the readings for the 100.10 standard, about 11.2398102, is displayed in Cell D19. (Use Format Cells Number - Number to set the displayed number of decimal places.) It is also useful to know how large the spread of the data is compared to the mean, which can be calculated as the %RSD or percent standard deviation. The equation for %RSD is:
100 . Do not type in a % after the 100 in your formula; Excel will assume average that you want to calculate the % and will divide your answer by 100. % RSD = s.d
%RSD can be large when the s.d. is large compared to the average; it can also be large when the average is very small. So just using %RSD without looking at the other numbers can be misleading. Create the formula to calculate the %RSD for the 100.10 standard in Cell E19. The result is RSD = 0.2168%.
Excel Tutorial 26
The other items in the Add-Ins dialog, including other valuable tools that generally have a very specific use. Because they are tools not used by a casual user, Microsoft has removed them from the menus. Once an Add-In has been selected it will remain in the Excel menus.
Excel Tutorial 27
Excel Tutorial 28
SUMMARY OUTPUT Regression Statistics Multiple R 0.999280462 R Square 0.998561442 Adjusted R Square 0.998471532 Standard Error 72.91111016 Observations 18 ANOVA df Regression Residual Total 1 16 17 Significance F 59041163.96 59041163.96 11106.25112 3.60408E-24 85056.47975 5316.029984 59126220.44 SS MS F
Intercept X variable
Coefficients Standard Error t Stat P-value Lower 95% Upper 95% -0.55140186 27.60070089 -0.01997782 0.984308082 -59.0622607 57.959457 52.4730721 0.497912176 105.3861999 3.60408E-24 51.41754568 53.528599
The numbers we will be using in Chem212 are circled. They have the following significance: R Square: A measure of the scatter of the data points as compared to the equation of the line. For analytical chemists, R Square values greater than 0.99 are expected; some methods even require an R Square of 0.999. Note that R Square only indicates scatter; it cannot tell you if a graph requires a curved calibration curve rather than a linear one!
The following information is a set of definitions, not an activity to do! Using the most common equation of a line: y = mx + b Intercept, Coefficients: The coefficient of the intercept is b Intercept, Standard Error: This is the precision error (not accuracy error!) in the value of b, based on the data scatter. It is sometimes referred to as sb.
X variable, Coefficients: The coefficient of the Concentration (or whatever else you called your x-axis) is m. X variable, Standard Error: Again, this is the precision error in the value of m based on the data scatter. It is sometimes referred to as sm. On occasion, you may not have more than one measurement for a sample; normally, it would be impossible to calculate a standard deviation for this number. However, if you have used a standard curve as part of the procedure, it is possible to obtain an average deviation from the equation of the curve.
Excel Tutorial 29
Excel Tutorial 30
3. The third screen allows you to set the default display values for your chart. a. In the Titles tab, give your graph the title: Calibration Curve for Zinc Analysis by Atomic Absorption Spectroscopy. b. Your x-axis is Concentration, ng/mL; c. and your y-axis is Instrument Response (a. u.). For this exercise, we dont know the exact units of respose, so we call the units arbitrary units (a. u.) d. Click on the Gridlines tab and uncheck the box for Value YAxis Major gridlines. e. Finally, click on the Legend tab and unclick the Show Legend box. Last of all, click Next. 4. The last screen asks you how to save the chart; either in your current worksheet or as a separate sheet; choose the As New Sheet option. Give your new sheet the name CalCurve and click
. 5. To format the axes of the new graph, right click on the axis of choice, and select format axis. Select the scale tab at the top of the box. The proper formatting for a typical calibration curve has a minimum value of zero for both the x and y axes.
Excel Tutorial 31
3. Right click on one of your data points. When the pointer is in the right position, a little box will appear underneath it that says Series graph title (x,y). The right click will bring up this menu: 4. Pick Add Trendline from the menu.
5. For a linear trendline, you can leave the chart set to Excels default type. 6. The last step is to set up the line equation. Click on the Options tab and click the two bottom boxes to display the numerical information, then click OK. If you forget to modify the options at this point, you can do it later by using a right click on the trendline, and formatting the trendline.
Excel Tutorial 32
5. Move the three sheets so that Summary is the first worksheet, followed by DataAnalysis, CalCurve, and Regression. You can do this by using the pop-up menu option Move or Copy or click and drag the sheets to their correct positions:
Use the to move through the options and Enter to select the option or just press the underlined letter to select one of the listed submenu options. In dialogs use
to select any tabs. The Tab key moves through the available
options and buttons. If you get stuck anywhere, use the Esc key to get out.
3. The next menu has three tabs; the first tab is for changing the properties of the line. The next two tabs are the same as those described above in section 13.2. Follow steps five and six. Save your worksheet onto your diskette.
14 Printing
14.1 What will Excel Print
The following is a general discussion about how Excel prints stuff. Dont print anything until you get to section 15.4. When a worksheet is printed, Excel prints only the filled-in cells and any blank cells in between. If you do not want to print an entire worksheet, but only a portion, then: Select the cells to be printed (click and drag), then From the File menu Print Area select Set Print Area This print area will automatically expand and contract if rows or columns with cells in this area are inserted or deleted. If you add any data outside this set area, it will not be included in the printout. To resize the selected area you must clear, select the cells, and set the print area again. To clear a print area, select the sheet and select Clear Area For this assignment: 1. Set the Print Area of the Data Analysis sheet to include A1:I42. Note that you can set a separate print area for each sheet. 2. Set the Print Area of the Summary Sheet to include A1:F20. It can be very useful to know the contents of the formulas, rather than just the final result. This option is set for an individual spreadsheet, not for the entire workbook. In order to make this easy for you and your marker, start by making a copy of the Data Analysis sheet. Click on Edit and choose Move or Copy Sheet, check the make a copy box, Select: (move to end). This will put a copy of the Data Analysis sheet after the Regression sheet. Your workbook sheets will now look like:
While in the Data Analysis (2) sheet, from the Tools menu, pick Options. On the View tab, check the Formulas box and click OK. Your sheet will display the formulas in the cells, rather than the final results.
Excel Tutorial 34
Select cells A1 to E21 and set the print area. Then change the column widths so that the area will fit on one sheet of paper. Save your workbook again. You can now use this workbook as a reference for future lab data.
14.2 Use File menu Page Setup to set page options, margins, headers and footers, etc.
The options available in this dialog differ between versions of Excel. If you have formatting that uses any colours, but are printing on a black and white printer, it is best to set options for printing to grey scale (select the term used in your version of Excel that has the same or similar meaning.) The page orientation (portrait vs. landscape) is set in this dialog box. Set the header & footer margins to 1 inch or 2.5 cm to prevent overlap of the data and header/footers. You must set the margins for every sheet individually.
The Header and Footer dialog allows for manual entry of text, date/time, page, filename and sheet name. Section 18 contains more information on custom header and footer. For your printouts, use the custom header option to type in your name, course and lab section number.
Excel Tutorial 35
Now set the footer to display the date in the center section by clicking on the little calender button. This will insert a field that will always display the current date. Move to the right section box and insert the page number field (button with a # on it). Your footer should look like the one above before you click OK. Now set the sheet options so that the gridlines will not print:
Now you can click OK, and your print format settings will be saved but only for the sheet you are working on. To have the same information on each sheet, you must edit each one separately. The other option for this type of work is to set up a worksheet template; then each new sheet is automatically given the assigned header/footer. Read Excel Help on templates for more info.
Excel Tutorial 36
Excel Tutorial 37
This formatting toolbar has only common formats or most recently used setting. For all formatting features use the Format menu Cells dialog. Note: If you do not see the format toolbar, View menu Toolbar and click Formatting.
First select the cell/range to format Then click the appropriate format button or Format menu Cells dialog.
Format the column headings in row 2. 1. Select cells B2 to E2. 2. Centre the selected range from the toolbar or Format menu - Cells. Widen narrow columns if necessary to see that the text is centred. 3. Add boldface to the selected cells 4. Add italics to the selected cells
Excel Tutorial 38
two digits after the decimal point. Currency [0] displays the numbers with no digits after the decimal point. The symbols that appear contain the code for special formatting such as how negative numbers should display. 4. Select the Currency [0] style, 5. Apply the style to the selected cells, click OK (or press Enter). The highlighted cells now display currency without any zeros.
Add a Row to the Worksheet. 1. Put the Active cell anywhere in row 1 2. From the Insert menu select Rows. A new row appears above the selected row.
Click here
Option 1: Use Microsoft Word header or footer. Option 2: Insert the full path in a worksheet cell instead of the header or footer. Option 3: Insert the full path in an Excel header or footer.
Option 1: Use Microsoft Word header or footer. Copy the Excel Worksheet and paste them in a Word document. Open the Word header or footer. Insert the Word field Document Information Filename with the file system path switch (FILENAME \p) to the header or footer. Option 2: Insert the full path in a worksheet cell instead of the header or footer. This option forces you to put the full path and filename within the worksheet. It will not work if put in the header or footer. Enter in the desired cell of a sheet the following: =INFO("directory") Note 1: Include the equal sign and the quote marks. Note 2: Save the workbook before printing, to provide the path information. Note 3: This will give the Word document path and file name, but if the document is saved in the same location and with the same name as the Excel file only the extensions will be different (.doc vs .xls). Option 3: Insert the full path in an Excel header or footer. This option adds the path and file name in the header or footer. It will not work if you put it in a cell in a worksheet. This requires the most work and some knowledge of macros as covered in the course Excel: Macros and User Defined Functions. Use at your own risk.
Step a) Open the workbook and select any cell in the sheet to be printed. Step b) Select ALT+F11 or Tools menu - Macro - Visual Basic Editor Step c) In the VB Editor, select Insert menu Module Step d) Enter the following three lines of code. The code will write the full path name in the left footer section Sub FullPathName() ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName End Sub
To place the path in other header or footer sections To put in the center section, replace LeftFooter with CenterFooter To put in the right section, replace LeftFooter with RightFooter To put in a header section, replace references to Footer with Header.
Before printing add the path to the header or footer section by: Step e) Save the workbook to the desired location so there is a path. If you do not save it will only insert the filename. Step f) Run the macro created in Step d, select Tools Macro Macros or Alt+F8 Step g) Select the macro FullPathName, click the Run button. The macro writes the full path to the section specified in the code. There may be a slight pause and screen flicker while this is done. Step h) Additional header and footer information can be added if necessary by selecting View menu Header and footer
Excel Tutorial 42
A number of cautions exist when using Option 3. Do not place a & in file or folder names, e.g. Tom & Jerry.xls. The & symbol is used for the predefined header/footer entries. A & in a path or filename will only confuse Excel. If you move the file to a different location, run the macro again to update the path information. This option inserts the path into the currently open workbook because it was inserted in the current VBA project with the filename of the workbook. To have the macro available for all workbooks, after step b and before step c click on VBAProject (PERSONAL.xls) so the macro will be available globally. Perhaps versions of Excel after 2000 will make this process easier. Until it is available choose from these three methods.
1. 2. 3. 4. 5.
If the Drawing Toolbar is not displayed, select View menu Toolbars Drawing Add an arrow to the chart Click the arrow button (between the line and rectangle) Draw the arrow, click and drag the cursor on the chart itself. Release the mouse button to place the arrow. Resize and reposition as needed by click and drag a resize handle at either end (the cursor is a double-headed cursor), or click an drag on the shaft of the arrow to move it to another position (the cursor is a four-headed cursor). 6. Additional formatting can be made to the arrow by selecting the format drawing buttons on the right end. Not all are available and cannot be selected. 7. Add a circle to the chart Click the oval button. 8. Hold down either Shift key and click and drag the cursor on the chart itself to draw the circle. (Without the shift key this tool draws ovals. 9. Release the mouse button to place the circle. 10. The circle hides part of the chart because the inside of the circle is coloured. Click the Fill Color list button (the small triangle on the right side of the paint bucket) and select No Fill 11. Resize, reposition and additional formatting are the same as steps 5 and 6.
Excel Tutorial 43
Watch which series is plotted as plotted by Rows produces a chart with a very different focus than one plotted by Columns.
Excel Tutorial 44
To avoid plotting a column of data, hide the column in the worksheet and the chart automatically adjusts to plot only the visible cells. Hide worksheet columns: select the column heading letters and select from the Format menu, Columns, Hide. Unhide the hidden columns to update a plotted chart with this new data.
Excel Tutorial 45
Excel Tutorial 46
Categories are plotted from the bottom of the chart upward (default). Worksheet data in alphabetical order will appears in reverse order when the data is charted. Change this by either: a) selecting Categories in Reverse Order (Scale tab of the Format Axis dialog box), this also places the value axis at the top of the chart, or b) reorder the data in the worksheet. Change the label placement by selecting an option from the Data Labels tab of the Format Data Series dialog box.
Excel Tutorial 47
Excel Tutorial 49
19.18.a
a. b. c. d.
For combination chart types, Excel automatically determines which data series is plotted using the first type of chart and then the second type of chart. An even number of data series is handled differently than an odd number of data series. For an even number of data series the first half of the data series becomes one chart type, and the remaining half becomes the other chart type.
For an odd number of data series, the first half of the data series plus one more of the data series becomes one chart type, and the remaining data series becomes the other chart type. E.g., a LineColumn chart with five data series, the first three series become columns and the remaining two series become lines.
To changing the chart type used by one of the data series do the following: 1. Right-click the series to change and select Chart Type from the pop-up menu. 2. Pick the type of chart to apply to the selected series in the Chart Type dialog box. 3. Verify the Apply to Selection box is checked. 4. Click OK. To add data to the chart plotted as a separate chart type: 1. Add the data to the worksheet. 2. Change the chart type for the newly added series. Select the chart and from the Chart menu select Add Data 3. Highlight the data to add, include the data label if appropriate. 4. Click OK. Use the built-in Line-Column on 2 Axes chart type to display two value axes. This method can be also to manually add another value axis to a different chart type. 1. Select the data series to display on the second value axis. 2. Right-click the series and choose Format Data Series. 3. From the Axis tab, choose Secondary Axis.
19.18.b
To create a custom chart type based on an existing chart: 1. Create the chart having all the features you want. 2. Select the chart. 3. On the Chart menu, Chart toolbar, or right mouse click pop-up select Chart Type. 4. Select the Custom Types tab. 5. Click the User-Defined option button. 6. Click the Add button to open the Add Custom Chart Type dialog box. 7. Enter a name and description.
Excel Tutorial 51
8. Click OK. The new chart is added to the User-Defined chart list, the description appears in the lower-right corner when that chart type is selected.
Sharing a Custom Chart Excel stores user-defined custom chart types in the file xlusrgal.xls. Its location varies with different version of Excel. Use the find files program (e.g. Start - Find) to locate it.
Destructive share by giving someone a copy of the xlusrgal.xls file. The user must copy the file to the same location as their xlusrgal.xls file on their machine. This, of course, will overwrite their xlusrgal.xls file and destroy their custom chart types. Non-Destructive sharing of custom charts: 1. Create a sample workbook containing the custom charts to share. 2. Copy the sample workbook file. 3. Copy and share this workbook file along with steps 1 to 8 above of Create a User-defined Custom Chart. 4. Recipients can then add your custom charts to their own xlusrgal.xls file.
19.18.c
If using the same chart type over and over, set it as the default chart type. The default chart type is a column chart, for a PivotChart it is a stacked column chart. 1. Create a chart it may not be the default you want. 2. Select or make the chart the active chart. 3. On the Chart menu, Chart toolbar, or right mouse click pop-up select Chart Type. 4. From the Standard or Custom tabs click the chart type to be the default. 5. Click the Set As Default Chart button, and then click Yes. 6. Close the dialog box and accept the chart type by clicking OK Verify the change in the Chart dialog by clicking the Custom Types tab, the User-Defined button displays the default chart type and any added custom charts.
Excel Tutorial 52