53
1 Appendix 1: Basics of Excel for Chemistry 212 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 1) Step by Step Microsoft Office Excel 2007 Copyright 2007 by Curtis D. Frye And 2) Excel 2007 Help Files. Revised for Chemistry 212 (University of Victoria) by Jane Browning and Nichole Taylor, 2008. 1 Student Exercises The hand-in exercises required for Chem 212 begin on page 24. Sections 10 to 14 are due at the end of the class. Section 15 is the assignment due next week.

Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

Embed Size (px)

Citation preview

Page 1: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

1

Appendix 1: Basics of Excel for Chemistry 212 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

1) Step by Step Microsoft Office Excel 2007 Copyright 2007 by Curtis D. Frye And

2) Excel 2007 Help Files. Revised for Chemistry 212 (University of Victoria) by Jane Browning and Nichole Taylor, 2008.

1 Student Exercises The hand-in exercises required for Chem 212 begin on page 24. Sections 10 to 14 are due at the end of the class. Section 15 is the assignment due next week.

Page 2: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

2

Contents 1  Student Exercises 1 1 Welcome and Introduction 4 

1.1  What You Should Already Know 4 1.2  What You Will Learn 4 1.3  What You Will Need to Use These

Materials 4 2  User Interface Ribbon in Office 2007 Applications 4 

2.1  User Interface Ribbon 4 3  Starting up Excel 5 

3.1  Start Excel 5 3.2  The Opening Screen 5 3.3  Resize Handles 7 3.4  Moving the Active Cell 7 3.5  Opening an Existing Worksheet 8 3.6  Understanding the Worksheet 8 

4  Different Types of Data 8 4.1  Cell Contents and the Formula Bar 9 4.2  Data Entry 9 4.3  Numbers 9 

5  Formulas 10 5.1  Understanding Formulas 10 5.2  Formulas, The Cell, and The Formula

Bar 10 5.3  The Formula in Action 10 5.4  Copying Formulas 10 5.5  Clearing Formulas 10 5.6  Entering a Formula 11 5.7  Copying and Pasting a Formula 11 5.8  Complex Formulas 11 

6  Functions 12 6.1  SUM 12 6.2  Average 12 6.3  The Power of Functions 13 6.4  Formula and Function Summary 14 6.5  Saving the Inform Worksheet 14 

7  Excel Data Entry and Editing 15 7.1  Edit in the Formula Bar 15 7.2  Editing in a Cell 15 

7.2.a  To fix basic typos while typing 15 7.2.b  To Editing Existing Data in a Worksheet 15 7.2.c  To Cancel Edits 16 

8  AutoFill, Column Width, Drag and Drop 17 

8.1  AutoFill 18 8.2  Changing Column Widths 19 

8.3  Drag and Drop 19 8.4  Enter Formulas and Functions 20 8.5  AutoFill vs. Copy and Paste 21 8.6  Editing a Formula or Function 22 

9  Cell Addresses 22 9.1  Relative cell reference 22 9.2  Absolute cell reference 22 

9.2.a  Clearing Cells 23 9.2.b  Fixing the PST Formula 23 9.2.c  Use AutoFill to Copy the Corrected Formula 24 9.2.d  Enter the Total Formula and copy it 24 

10  Why Use Excel for Statistics? 24 

10.1  What the Data Represents 25 10.2  Excel Functions 26 10.3  Review of the Statistical Functions

in Excel 27 10.4  Using the Insert Function Dialog 27 10.5  Using Functions Without Insert

Function 28 10.5.a  Standard Deviations 28 

11  Using Data Analysis 30 11.1  Bivariate Statistics (Regression

Analysis) 30 11.1.a  A Regression Exercise 30 11.1.b  Run the Regression 31 11.1.c  Interpreting Regression Results 32 

12  Excel Chart Wizard 33 12.1  Create a Calibration Curve 33 12.2  Format the New Graph; Add

Trendline 34 12.3  Renaming Charts and Worksheet

Tabs 35 12.4  Common Charting Errors 36 

12.4.a  Add a Chart Title 36 12.4.b  Add Regression Equations to Graph 36 

13  Printing 36 13.1  What will Excel Print 36 13.2  Use the Page Layout tab – Page

Setup group to set page options, margins, headers and footers, etc. 37 

13.3  Preview the Worksheet 39 13.4  Printing the Worksheet 40 

14  Ending Your Session 40 15  Exercise for Next Week 40 16  Formatting the Worksheet (optional) 41 

16.1  To apply formatting: 41 

Page 3: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

3

16.2  Undo Text Formatting 42 16.3  Changing Fonts 42 16.4  Formatting Numbers 42 16.5  Using Styles 42 

16.5.a  Predefined Styles (Home tab, Styles group) 43 16.5.b  Create Your Own Style 43 

16.6  Add Rows and Columns 44 16.7  Removing Rows or Columns 44 16.8  Centering a Title Across a Range 45 

17  Custom Headers and Footers (optional) 45 18  Excel Charts (optional) 45 

18.1  Drawing Tools Enhance Charts 45 18.2  Excel Chart Types 46 18.3  Naming the Axis 47 18.4  How Charts are Plotted 47 18.5  Add text labels to the bubbles or legend 48 18.6  Area Charts 48 18.7  Bubble Charts 48 18.8  Bar Charts 49 18.9  Column Charts 50 18.10 Bar and Column Chart Variations 50 18.11 Doughnut Charts 50 18.12 Line Charts 50 18.13 Pie Charts 51 18.14 Radar Charts 51 18.15 Stock (High, Low, Close) Charts 51 18.16 Surface Charts 52 18.17 XY (Scatter Charts) 52 

Page 4: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

4

1 Welcome and Introduction

1.1 What You Should Already Know You should already know how to do the following:

Use a mouse Recognize icons Open and close windows Adjust the size of the window Access options from the menu bar Switch back and forth between applications

1.2 What You Will Learn This class introduces the basic features of Microsoft Excel. We will cover many topics, including how to:

Understand what a spreadsheet is Use Excel to create and modify worksheets Enter text, numbers, and equations Use the statistical functions needed for Chem 212 Create and modify charts

For those of you who are already familiar with Excel, the most important material is in sections 5, 6, 10, 11, 12 and 13. At the end of section 13 are the instructions for printing out your work. Section 15 contains the instructions for your assignment. If you choose to skip the other sections, be aware that the ‘key’ sections assume you know the concepts discussed in the others. Also, your work will be marked on that basis.

1.3 What You Will Need to Use These Materials You will be provided with:

The use of Microsoft Excel 2007 The exercise files inform.xlsx and Zinc Analysis.xlsx

You will need to provide: A USB storage/flash/jump drive with at least 50 KB of free memory.

2 User Interface Ribbon in Office 2007 Applications

2.1 User Interface Ribbon Toolbars were used in earlier versions of Microsoft Office applications. In the 2007 version, these have been replaced by the user interface Ribbon. When you open an application, like Excel, the Ribbon can be seen at the top of the program window. The

Page 5: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

5

Ribbon has several tabs. For example, when you first open Excel 2007, you can see the user interface ribbon at the top of the program window, with the following tabs: Home, Insert, Page Layout, Formulas, Data, Review, and View. Each tab contains a series of groups. Each group, in turn, hosts a series of controls that enable the user to perform tasks related to that group. See the figure below for more information on identifying these terms. The terms Ribbon, tab, group, and control will be used throughout this document, so take a minute to familiarize yourself with them.

3 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.

3.1 Start Excel From the Start menu, select Programs.

• Start Excel from the menu list.

Excel loads and you see the opening screen.

3.2 The Opening Screen After Excel loads, you see a blank worksheet window:

Page 6: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

6

Similar to any Windows application, there are: scroll bars, minimize and maximize buttons, and a title bar. 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 directly above the column headings, is used for examining and editing the contents of cells. 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 (also called worksheets). Each spreadsheet has a tab on the bottom marked Sheet1, Sheet2, etc. These sheets can be added, deleted, rearranged, and the tabs renamed.

Page 7: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

7

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.

3.3 Resize Handles One of the common frustrations that new users have with any windows program is that ‘the mouse won’t 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 won’t 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 won’t 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 can’t get the resize handles to go away, press the Esc key until they disappear.

3.4 Moving the Active Cell Let’s 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.

Page 8: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

8

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§ ²

3.5 Opening an Existing Worksheet Let’s open an existing worksheet. We’ll 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, click on the Microsoft Office Button and select Open from the drop-down menu. 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.xlsx 5. The worksheet opens on your screen.

3.6 Understanding the Worksheet 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.

4 Different Types of Data There are four basic types of information that can be entered into cells in Excel: text, numbers, formulas, and functions.

Page 9: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

9

Text is entered into cells by typing in characters, including letters, numbers, and/or punctuation. Names, street addresses, and cities are all examples of text data. Text can be displayed in bold, italics, different sizes and shapes, and so on.

1. To see the contents of cell B2, click cell B2

4.1 Cell Contents and the Formula Bar 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.

4.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.

4.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.

Page 10: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

10

5 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 –

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 from the real contents of the cell in the Formula Bar.

5.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.

5.2 Formulas, The Cell, and The Formula Bar • The cell displays the results or solution of the formula. • The Formula Bar displays the real contents of a cell (a formula) in case you need

to modify it.

5.3 The Formula in Action Let’s change the number of Spades sold from 2 to 12.

1. Click or ← to make D3 your active cell. 2. Type in cell D3: 12 and press the Enter key. The formula results in E3 have been

automatically recalculated.

5.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.

5.5 Clearing Formulas Let’s clear the contents of cells E3 though E9, we want to keep the contents of row 10.

Page 11: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

11

1. Select cells E3 through E9 by Click and drag from cell E3 to cell E9 or click cell E3, hold down either Shift key then click cell E9 or select cell E3, hold down a

Shift key then press ↓ to cell E9 2. Clear the contents of the highlighted cells, press: Delete or under the Home tab,

in the Editing group, click on Clear, then select Clear Contents from the drop down menu.

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.

5.6 Entering a Formula 1. Make E3 your active cell, click cell E3 2. Enter the formula, type: =C3*D3 (capitalization does not matter) 3. Accept the formula, move off cell E3 (press enter, arrow key, click another cell) 4. The results are displayed in cell E3.

5.7 Copying and Pasting a Formula

1. Make E3 your active cell, click cell E3 (or press ↑) 2. Copy the formula. Choose a mouse, keyboard shortcut, or Ribbon method. With

the mouse right click, then choose Copy; for the keyboard shortcut, hit Ctrl + C, or click Copy in the Clipboard group, in the Home tab in the interface Ribbon. 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. Home tab – Clipboard group – Paste, Ctrl + V, or right click then choose

Paste. 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.

5.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’ version of: ( )2

21222 2

EADC B+×+

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.

Page 12: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

12

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.

6 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.

6.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

3. Select the Formulas tab on the user interface (main) Ribbon. Click .

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.

4. Press Enter to see the sum.

6.2 Average The AVERAGE function calculates the mathematical average of a range of cell values.

1. Click cell C10 to see the AVERAGE function.Delete the contents of cell C10. We will replace the function. Open the Insert Function dialog by one of two ways:

Under the Formulas tab, click the Insert Function control ; OR click on the button next to the Formula Bar below the groups in the main Ribbon and above the spreadsheet workspace. Either selection will cause the following dialog box to appear:

Page 13: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

13

• Explore the list of available functions. You can narrow the search by selecting a category from the drop down menu, or typing search terms in the top box and clicking Go.

• Select AVERAGE from one of these categories: All, Statistical, or Most Recently Used. Click the Function Name AVERAGE, then click OK.

• A Function Arguments dialog box will appear, defining the cells that Excel use in performing the function.

• This range of cells appears in this function arguments dialog box (see below). If Excel guessed wrong, just reselect the correct cells.

• Click OK to finish the formula entry.

6.3 The Power of Functions Functions, like formulas are automatically recalculated if the values it uses change.

1. Click cell D4 The cell indicate 5 pick axes sold.

Page 14: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

14

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.

6.4 Formula and Function Summary The spreadsheet structure is determined primarily by formulas and functions. Spreadsheet structure can be set up before entering any data. Then as data is added the formulas and functions give running results as more data is entered. If you want a list of all the functions that Excel can use, in the user interface Ribbon, choose the Formulas tab. In the Function Library group, click the Insert Function control. As shown in section 6.2, an Insert Function dialog box will appear. There is a drop down menu to select a category. If you select “All” from this menu, the list will show all available Excel Functions.

6.5 Saving the Inform Worksheet Let’s save our revisions before we close the file.

1. Click on the Microsoft Office

Button , and select Save As. (see figure) Do NOT save this file under the same name, and do NOT save the file on the public computer. Save it on your USB drive. Please note: Excel 2007 has a new file format from earlier versions of Excel. If you want to view this file on an earlier version of Excel (i.e. Excel 2003 or earlier), you must save it in as an “Excel 97-2003 workbook”. Otherwise, select “Excel Workbook”.

2. To close the Inform workbook, select the Microsoft Office Button

, then select Close. The worksheet closes and disappears from screen.

Page 15: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

15

7 Excel Data Entry and Editing This section reviews editing in the Formula Bar and editing in the cell Creating a New Worksheet

1. Create a new blank worksheet within an existing workbook, click the Insert worksheet tab at the end of the current worksheet tabs (see below).

2. A new worksheet called “Sheet1” opens. 3. Proceed in “Sheet 1”.

7.1 Edit in the Formula Bar 1. Click cell B1 4. 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.

5. The Formula Bar now also has buttons for Cancel and Enter, as well as the Insert Function button described earlier.

Ways to cancel, enter, or begin formula:

Action Formula Bar Button 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.

To enter a function, type the equals sign (=), or select the insert function button in the Formula Bar

7.2 Editing in a Cell

7.2.a To fix basic typos while typing 1. In any empty cell type: 1996. 2. To clear the last character just typed, press: Backspace 3. Press Enter to accept the entry of 199.

7.2.b To Editing Existing Data in a Worksheet Two ways to change data already in a cell:

• Type Over an Old Entry. Just type on top of the original entry. What is typed replaces what is in the cell.

• Edit an Existing Entry in the Formula Bar. For partial edits, click in the Formula Bar to edit the contents of the active cell. The Formula Bar is like a

Page 16: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

16

one-line word processor to delete, insert, copy and paste, and typing on top of selected text replaces that text with new text.

• Editing an Existing Entry in the cell. For partial edits, double click the cell for in-cell editing.

• Editing an Existing Entry in the cell can also be done by clicking on the cell you wish to edit, and pressing F2. A cursor will appear at the end of the existing entry, allowing you to add or delete contents.

Let’s change the value in cell B1 from 199 to 2996 using the Formula Bar.

1. Make cell B1 your active cell. The cell’s contents (199) is displayed in the Formula Bar.

2. Highlight the data to change in the Formula Bar, click and drag across the 199. Home and End keys move to the beginning or end or use arrow key.

3. Type: 2996 and press the enter key. Let’s change the value in cell B1 from 2996 to 9996 using the in-cell partial editing:

1. Double click in cell B1, as close to the 2 as possible. An insertion point appears in the cell, approximately where you double-clicked.

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.

7.2.c To Cancel Edits Move back to the “Inform” worksheet. Start typing and change your mind? Cancel your typing by: Cancel before pressing the enter key.

1. To move to cell C3, or any other cell that already has some content. 2. Type: EXCEL IS FUN! (do not press enter!) 3. Cancel the edit either:

a. Press the ESC key or b. Click the Formula Bar Cancel button.

4. The original value in the cell is restored. Undo after pressing the enter key.

1. To move to cell C3, or any other cell that already has some content. 2. Type: EXCEL IS FUN! And press the Enter key! 3. Return back to the former contents either:

a. Press the Ctrl+Z key combination, or

b. Click the Undo button at the top of the screen. 4. The original value in the cell is restored.

Page 17: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

17

5. Excel keeps track of editing changes so you can “step back”. There is a Redo

button 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.

8 AutoFill, Column Width, Drag and Drop Let’s move to the new worksheet (Sheet1) that we already created. We will use this to introduce a number of Excel features:

• AutoFill • Change Column Width • Drag and Drop editing • Formulas and Function Copy and Paste • Formatting cells and worksheets.

. To illustrate these features we will edit the new worksheet with the entries illustrated in the diagram below. In order for these features to be demonstrated correctly, the following pages will introduce errors that will need to be corrected so put the data in the cells as instructed. Do not enter the values as pictured at this time, the step by step instructions below will ultimately lead you to make a worksheet as pictured below. Demonstration Worksheet

Page 18: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

Fill in

1234

8.1 AutoA moTo en

1234

5

67

Enterto est

123

456

7 More

• • •

n the A colu. In cell A2. In cell A3. In cell A4. In cell A5

AutoFill oFill allows youse that is cnter the Colu. Click cell. Type in B. Press the . Click cell

the lowerborder are

. Click andin the lowwhite plucrosshairs

. With the c

. Release th

ring the numtablish the na. Fill in cel. Highlight. Click and

The curso. With the c. Release th. To AutoF

Click and. Release th

e about AutoAutoFill For a singFor a singAutoFill space betwrecognizeFor two ctwo numb

umn labels 2 type: Supp3 type: Servi4 type: Train5 type: Produ

lyou to createclean, has a gumn Headingl B1

B1: 1st QuartEnter key. l B1 Note: r right cornea.

d hold the mower right corus symbol, tos cursor is wcrosshair curhe mouse bu

mbers using Aature of the lls: B2 type: t these cells, d hold the moor must chancrosshair curhe mouse buFill down thd drag down he mouse bu

oFill can fill by ro

gle cell of chgle cell of chwill incremween the nu

ed as part of cells with nubers, e.g. 1 3

lies ices ning uction

e a series of good mouse gs, we will e

ter

AutoFill is ner of the

ouse buttonsrner of B1. To a thin, soli

what you needrsor, Drag ac

utton and the

AutoFill reqseries 100 C2 Click and d

ouse button nge to a thin,rsor, Drag ac

utton and thehe columns, to cell E5

utton and the

ow or by colharacter and/haracters and

ment by one bumber and ththe number,umbers, Au will give th

values basedpad, etc. wi

enter only th

the box in highlighted

s on the box The cursor cid, crosshairsd to activatecross to cell

e series is fill

quires enterin

type: 200 Bdrag cells B2

on the Auto solid, crosscross to cell

e series is fillmake sure

e series is fill

lumn. AutoF/or numbers,d/or numberbeginning w

he character, so no space

utoFill will ihe series 1 3

d on one or tll help in thi

he first then u

changes froms plus symb

e AutoFill. E1.

led in.

ng at least tw

B3 type: 200 to C3

oFill handle hairs plus syE3.

led in. you still ha

led in.

Fill cannot fi, AutoFill ws, and the fir

with the num(note that ‘s

e is required)increment by5 7 9….

two values. is step. use time-sav

m a fat, ol. The

wo numbers i

0 C3 type:

in the lowerymbol.

ave the cross

fill diagonallywill repeat tha

rst charactermber, providist’, ‘th’, ‘nd’). y the differe

1

ving AutoFil

in sequence

400

r right corne

shairs curso

y. at cell. r is a numbeing there is ’, and ‘rd’ ar

ence of thes

8

ll.

er.

r,

r, a

re

se

Page 19: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

19

• 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.

8.2 Changing Column Widths 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. To 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

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. Remember to save your workbook in the appropriate format if you plan to view it on an older version of Excel.

1. Save the workbook using the Save As dialog. Click the Microsoft Office Button, then click Save As.

2. Now rename the workbook: exercise.xlsx. 3. Choose to save to your USB storage drive.

8.3 Drag and Drop 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.

Page 20: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

20

• The so-so way! Copy and Paste, then Delete cells C10 to C15. • This is fine! Ctrl X then Ctrl V, OR Home tab, Clipboard group, Cut control,

then Paste control, OR Shift Delete then Shift Insert. This uses the clipboard to temporarily hold the cut cells.

• Another good 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 location and ‘drop’ them in place.

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 with a four way arrow needed to perform the drag and drop (see figure).

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.

8.4 Enter Formulas and Functions 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 control located under the Formulas tab, Function Library group.

• Method 3, use the SUM function with the Insert Function dialog, also located in the Formulas tab, Function Library group.

Let’s use method 3.

1. Select cell B6. 2. Open the Insert Function dialog by clicking on the Formula Bar , or use

the Formulas tab, Functions Library group, Insert Function control. 3. We could access the SUM function from the Most Recently Used category; or

another way is from the All category. Or we can search for the function. For this example, let’s use the “Search for a Function” option.

4. In the Search for a Function box, type “sum”. 5. Note that the category changes automatically to Recommended. SUM should be

at or near the top of the list. 6. With your mouse, select SUM from the list. With the SUM function selected, to

confirm your choice, click OK

Page 21: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

21

7. 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 cell range. If incorrect it can be changed by typing in a cell range, or selecting the cell range 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 “Help on this Function” link in the lower left.

8. Click the OK button to enter the function in the cell. Copying Functions Using AutoFill Cells B6, C6, D6, and E6 have identical function except for the column letters so we can copy and paste the function or use AutoFill. Let’s 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.

8.5 AutoFill vs. Copy and Paste • AutoFill can copy a formula or function to adjacent cells but not to non-adjacent

cells in a different part of the worksheet. • Copy and paste can copy to both adjacent cells or to non-adjacent cells. To paste

to non-adjacent cells, copy a cell, click the cells to paste the copied contents. Paste according to directions given previously in section 5.7.

Page 22: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

22

8.6 Editing a Formula or Function Rules for editing a function or formula follow those for editing any other entry. Use the Formula Bar to make edits. 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. Hit Enter to

finish the entry. 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.

9 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.

9.1 Relative cell reference The normal condition just described is called relative cell addressing. That is, formulas and functions refer to cells relative to the location of the equation. Copying the equation to the left, for example, adjusts all cell address to the left, and so on. This is usually what you want.

9.2 Absolute cell reference Some time we need to tell Excel not to adjust a cell reference relatively during a copy operation, such as when there is a constant value like the PST. In other words, we want it to refer to the cell address absolutely. We indicate this to Excel by placing $ (dollar sign)

Page 23: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

23

in front the part of the cell address that do not change in the formula or function cell addresses. The PST is in cell A11. In the tax formula it should be written as $A$11 to make it an absolute cell address reference, so the formula in cell B7 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.

9.2.a Clearing Cells Clear the cells containing the erroneous formulas before updating the formula to contain an absolute address.

1. Select cells C7 to E7, do not include B7 as we will edit the formula. 2. To clear the cells, press: Delete or use the Clear Contents control from the

Editing group under the Home tab.

9.2.b Fixing the PST Formula Change the PST formula from =B6*A11 so a11 reference to the PST are absolutely addressed =B6*$A$11.

3. Select cell B7 4. In the Formula Bar edit the formula to read: =B6*$A$11 5. When done, press: Enter or click the Check Mark button.

Page 24: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

24

9.2.c Use AutoFill to Copy the Corrected Formula Copy the corrected formula across row 7 using AutoFill.

6. Select cell B7 7. Use AutoFill to copy the formula across the row to cell E7. 8. Examine the contents of cells B7 through E7. The formula reference to cell

$A$11 should be the same in cell and the calculation done correctly.

9.2.d Enter the Total Formula and copy it Finish entering the worksheet formulas to add the Sub Total and the Tax to give the Total. As we create the formula, we’ll see a different way we can enter it into the spreadsheet.

9. Select cell B8, 10. Begin entering the formula, type: =. Instead of typing the whole formula, select

cells in a formula by clicking them. 11. Place the first cell in the formula, click cell B6 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: Microsoft Office Button

– Save, or keyboard shortcut Ctrl + S or the icon to the right of the Microsoft Office Button at the top of the screen.

19. Close the exercise.xslx workbook.

10 Why Use Excel for Statistics? There may be times when you have a set of data and wish to compute some rather basic statistics but do not have the time to learn a statistical package or a statistical package may not be readily available. Excel can accomplish many of the basic and some of the more advanced statistical procedures. This material introduces some of the basic statistical procedures available in Excel as well as provides instruction on how to use them. If you are already very familiar with Excel, SPSS, SAS or other statistical packages, this section may be a bit basic for you. Start by opening the other spreadsheet file: Zinc Analysis.xlsx. Save this file under a new name on your USB drive in order to start making changes at this point. Click on the

Microsoft Office Button , then select Save As. Please note: if you plan on working on your assignment on an older version of Excel, please be sure to select to save your file in Excel 97-2003 format. Otherwise, just save it as an Excel Workbook.

Page 25: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

25

10.1 What the Data Represents The data in “Zinc Analysis.xlsx” are from an analysis of standards, brass samples, and a QC sample for zinc content. Samples of brass are being analyzed for zinc. On Sheet 1 of the Zinc Analysis spreadsheet, in the B column, it lists the sample masses for the unknown brass samples, as well as the mass of a QC brass sample. The QC sample in this case is a solid sample of known composition that will go through the same method as the samples, and hopefully the result will be close to the certified value. The certified, or expected, value is given below the table on Sheet 1 (see below). Please note that there is also a method blank reading which you will need to use. Each sample and standard was made in a volumetric flask. The furthest column right on Sheet 1, with the heading “Final Volume” tells the volume of the flask used to prepare the standard or sample. For the standards, this is not really an issue, since the final concentration (in ng/mL) of analyte has already been calculated and given in column A on Sheet 2. For the samples, however, this is important information that will be needed later. Each solid sample was digested, and then diluted to the final volume indicated. It is this final solution of sample that was analyzed for the data given on Sheet 2. The unknown samples and the QC samples all went through the same preparation method. So did the method blank. The average method blank signal is therefore subtracted from the sample and QC signals in order to correct them for any method- related interferences. You will get a value for the concentration of the unknown from the calibration data you will be generating (using the steps that follow). This concentration will be mass of analyte (zinc) per mL of solution. Column F on Sheet 2 asks for a concentration in mass of analyte per mass of unknown (brass). Sheet 1 of Zinc Analysis.xlsx:

Page 26: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

26

Analysis of Brass for Zinc by Atomic Absorption Spectroscopy

Concentration /(ng/mL) Weight /g Trial Final Volume /mL

1 2 3

Standards 0.00 5 8 -2 100.00

10.01 468 477 458 100.00 30.03 1635 1602 1646 100.00 50.05 2564 2581 2579 100.00 70.07 3782 3795 3811 100.00 100.10 5196 5181 5174 100.00

Samples

method blank 58 100.00 sample 1a 1.1359 510 507 498 50.00 sample 1b 1.3213 581 576 565 50.00 sample 1c 1.5307 659 664 654 50.00

QC 0.5251 4162 4110 4065 100.00

Expected QC value: 14.98 µg/g

10.2 Excel Functions Insert Function is an Excel Wizard that guides the user through various steps of completing one function at a time. These functions are organized into categories that include statistical, engineering, mathematical, and financial functions. Using these Excel function may be accomplished from the Formulas tab, Formula Library group, Insert Function control; or if you know the function and how it is generated, you can also type it in directly without having to use Insert Function. Univariate statistical functions are those operations performed on a single variable. Prior to performing any of the more complex statistical procedures, it is necessary to have a good idea of the characteristics of your data. For example, you might want to know the central tendency and distribution of each variable. These characteristics are measured by statistics such as the mean, median, and standard deviation. It is important to have this information because the characteristics of your data play a large part in determining which subsequent statistical procedures are appropriate.

Page 27: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

27

10.3 Review of the Statistical Functions in Excel The number of functions available differs between the different versions of Excel, with older versions having fewer functions.

1. From the Formulas tab, Function Library group, select the Insert Function control; or click the button on the Formula Toolbar.

2. In the drop down menu for selecting a category, click Statistical category 3. Below the category, scroll through the list of available statistical functions. Each

function name displays a brief description in the bottom of the dialog box. 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, using a single function to generate intermediate results in a cell. Then use the intermediate result for the next function.

10.4 Using the Insert Function Dialog Find the average of the instrument response for the 100.10 ng/mL standard using the Insert Function dialog. Tell Excel first where to place the results, as Excel will overwrite any data that is in the active cell. Excel calculates in a upper left to lower right manner which could give incorrect results if results are to be placed at the top of the sheet, so be sure to check the cells referenced in the Function Arguments dialog box..

1. Select ‘Sheet 2’ and then select cell C19. 2. Open Insert Function dialog, use Insert Function in the Formulas tab, or the

Formula Toolbar button. 3. In the drop down menu for category selection, select Statistical. 4. In the function name pane double click the Average function, or click the

function name then the OK button. Note, once a function is used it will be added to the Most Recently Used list.

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

Page 28: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

28

• 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.

10.5 Using Functions Without Insert Function Enter a statistical function by typing in the proper commands, assuming you know what parameters the function requires. This exercise uses this method.

10.5.a Standard Deviations Standard deviation is a measure of the degree of variance or spread of a variable’s values about its mean. The mean provides information about one characteristic of a variable. Using only the mean to describe a variable could be misleading. For example, suppose there are two towns each with ten residents and each with a mean annual income of $10,000. With no further information, you can say nothing about how the income is distributed. Further investigation reveals that in the first town, each resident had an annual income of $10,000 while in the second town nine residents had no income while one had an income of $100,000. While both towns have a mean annual income of $10,000, the distribution of the income within each is vastly different! In the first town each resident has the same annual income so there is no deviation around the mean of $10,000. The standard deviation is zero. In the second town the 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 Insert Function. The basic standard deviation function is: =STDEV(number1, number2, …). The case of the letters doesn’t 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.)

When you start to type the formula Excel will generate a list of suggested formulas. You can choose STDEV from this list or you can continue to type it out.

Page 29: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

29

OR: you can select the desired cells another way. 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.2398, is displayed in Cell D19. To set the number of decimal places for display, under the Home tab, Number group, there is a drop down menu. You can choose number from this group. There are also two controls for increasing and decreasing the number of decimal places. As well, you can select the active cell(s) and right click your mouse. Choose Format Cells from the menu that appears. In the dialog box that appears, select Number from the list of options, then select the number of decimal places you want. (Remember sig figs!!) You can also access Format Cells from the Home tab, Cells group, Format control. 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.% ×= averagedsRSD

Do not type in a % after the 100 in your formula; Excel will assume that you want to calculate the % and will divide your answer by 100. %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%.

Page 30: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

30

11 Using Data Analysis You can use the Insert Function to obtain one statistical measure at a time. Excel also has the Analysis ToolPak, a pre-packaged set of statistical procedures. Use the Data Analysis to apply multiple statistical measures simultaneously. If the ToolPak has been loaded, you should see a Data Analysis control in the Analysis group under the Data tab.

11.1 Bivariate Statistics (Regression Analysis) So far we have examined variables in isolation from one another. The mean, median, and standard deviation provide a good understanding of the data characteristics. Multivariate statistics takes the process of data analysis one step further by examining how variables interact with one another. Multivariate statistics helps to define the relationship between two or more variables and determine the strength of the relationship. In analytical chemistry, we use regression analysis to determine the relationship between concentration and ‘instrument response’. Instrument response is just the raw output from the machine; remember, the machine doesn’t know what the concentration is – it can only provide a response for each sample. This is the reason for using the typical ‘standard curve’. By measuring the instrument response of samples with known concentration (i.e., standards), we can determine a mathematical relationship between response and concentration. Then, when a sample of unknown concentration is run, it is possible to use the response to calculate the concentration. Regression is a more powerful statistical technique than a simple correlation to test if two or more variables are related. A regression calculation adds a level of precision on how changes in one variable may be reflected in changes in another variable.

11.1.a A Regression Exercise The model to be tested is: Response = Slope × Concentration + Intercept. (This is the equation of a straight line.) Where:

If an Analysis group does not appear under the Data tab then: a. Click the Microsoft Office button, then select Excel Options. Select Add-Ins from

the left hand menu. Click Go (not OK). b. In the Add-Ins available box, click the check box by Analysis ToolPak (not

Analysis ToolPak VBA). c. Click the OK button. An Analysis group should now be under the Data tab with

a Data Analysis control. 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.

Page 31: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

31

• Response is the dependent variable (depends on the concentration), =y. • Slope (=m) and intercept (=b) are constants determined by the calibration curve. • Concentration is the independent variable (in the calibration curve, concentration

is determined by the experimenter; then the response is measured; therefore the response is ‘dependent’).

11.1.b Run the Regression 1. In the Workbook Zinc Analysis.xlsx, click on Sheet 2 to make it the active

worksheet. 2. From the Data tab, in the Analysis group, select the Data Analysis control. 3. Select Regression from the dialog box menu that appears. 4. Click OK to open the Regression dialog box. 5. Specify the Y range (dependent

variable) of instrument response for the standards: B4:B21.

6. Specify the X range (independent variable) of concentration: A4:A21.

(This data is a copy of the information given in cells A3:E10 of sheet 1. The reason for recopying the data is to be able to plot all of the points on a single graph. If you used the standard data at the top of Sheet 1, you would end up with three lines, one for each data set. What we want is a single line that includes all of the replicate points, which can only be done when all the numbers are in only two columns.)

7. For the Output Option select New Worksheet Ply.

8. Name the new worksheet: Regression.

9. Click OK and Excel generates the Regression results. 10. Adjust the results table column width. To reformat a selected section, from the

Home tab, in the Cells group, click the Format control. From the drop down menu, select AutoFit Column Width. Alternative methods for adjusting column width were addressed in section 8.2.

11. (There are a number of ways to adjust column width. There is no one correct way. Use the method that is most efficient and comfortable to use. See section 8.2)

Page 32: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

32

11.1.c Interpreting Regression Results The output here contains much more information than a simple correlation. Output is divided into three sections; discussion of the output is limited here to the more frequently interpreted results in the first and third sections. 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 SS MS F Significance F

Regression 1 59041163.96 59041163.96 11106.25112 3.60408E-24Residual 16 85056.47975 5316.029984 Total 17 59126220.44

Coefficients Standard Error t Stat P-value Lower 95% Upper 95%

Intercept -0.55140186 27.60070089 -0.01997782 0.984308082 -59.0622607 57.959457X variable 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.

Page 33: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

33

12 Excel Chart Wizard Charts are Excel graphs that give a useful visual representation of your data. Creating a new chart is as easy as selecting the cells, and selecting the chart type, chart features, and where to place the chart in your Workbook. Excel Charts uses a wizard to step you through the process. Excel charts can be embedded in your worksheet, or you can create them as a separate sheet in your workbook. We will choose the second option, creating a separate chart sheet. Our data includes titles for the data; the names in Row 3 of Sheet 2. Excel charts will use these if they are included in the selected cells to use in creating the chart. In analytical chemistry, the most common type of ‘chart’ or graph is the calibration curve. The following instructions will give you step-by-step information as needed to make graphs for Chem 212.

12.1 Create a Calibration Curve The steps required for your calibration curves in Chem 212 are listed below. More information about each step, and additional options, are in Sections 16 to 18. Again, you will create the calibration curve from the standard data on Sheet 2, in cells A3:B21. Use the mouse to highlight the data for the graph.

1. Under the Insert tab, in the Charts group, select the Scatter control.

2. From the drop down menu, select the first option, Scatter with only Markers.

3. A chart will appear with the format Excel believes is best. As well, you will notice a series of new tabs in the user interface Ribbon under the heading of Chart Tools.

We want to change some of the options on the chart that Excel has generated. For example, “Instrument Response” is not a good descriptive title for this chart.

4. First, let’s move the chart to its own window. Under the Design tab, find the Location group. Select the Move Chart control. Select to move the chart to a new sheet.

Page 34: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

34

5. Next, let’s change the chart title, as well as the axes titles. a. To change the graph title, simply click on the current chart title. Click once again and a cursor will appear. Delete the current title and give your graph the title: Calibration Curve for Zinc Analysis by Atomic Absorption Spectroscopy. b. To get an x-axis title, under Chart Tools, there is a Layout tab. In this there is a Labels group. Here select the Axis Titles control. From the drop down menu, select Primary Horizontal Axis Title, then Title Below Axis. A default axis title will appear below the x-axis. Click in this title to get a cursor, and type in your new title. Your x-axis is Concentration (ng/mL); c. As you might guess, to label the y-axis choose Primary Vertical Axis Title in the same Axis Titles drop down menu. This time choose Rotated Title. Your y-axis is Instrument Response (a. u.). For this exercise, we don’t know the exact units of response, so we call the units arbitrary units (a. u.) d. To get rid of the gridlines (which follows the Chem 212 graphing guidelines), under Chart Tools, the Layout Tab, the Axes group, select the Gridlines control. Since only horizontal gridlines are currently on the chart, select Primary Horizontal Gridlines from the drop down menu, then click None. e. Finally, we need to get rid of the legend. Under Chart Tools, the Layout tab, in the Labels group, select the Legend control. Select None from the drop down menu.

6. To format the axes of the new graph, right click on the axis of choice, and select Format Axis. Select Axis Options from the menu on the left. The proper formatting for a typical calibration curve has a minimum value of zero for both the x and y axes. Set the axis minimum at zero for each axis.

12.2 Format the New Graph; Add Trendline Finish off your graph by adding a trendline with its regression equation and R2 value:

1. 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:

2. Pick Add Trendline from the menu. 3. A Format Trendline dialog box appears. Trendline Options

should be selected in the left hand menu box. For a linear trendline, you can leave the chart set to Excel’s default type.

Page 35: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

35

4. The last step is to set up the line equation. Under the same Trendline Options, click the two bottom boxes to display the numerical information, then click Close. 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.

5. To increase the number of digits displayed

for R2, right click on the equation on the chart, then choose Format Trendline Label, then choose Number from the left hand menu. Then select Number from the list of formats. Enter the number of decimal places you would like before clicking the Close button.

12.3 Renaming Charts and Worksheet Tabs Worksheet tabs can be renamed, added, deleted, and moved. A clearly named tab can help you identify and locate content.

1. To rename the worksheet tab, double click the Sheet 1 tab. Then type in the new name. OR, right-click on the tab and select ‘Rename’ from the pop-up menu. NOTE: This won’t work if a chart in the worksheet is selected (i.e., has resize handles – those little square black boxes at the corners and on each side). To unselect any object, press the Esc key until the resize handles disappear.

2. The sheet name is highlighted, type: Summary. Use Arrow keys, backspace and delete keys used as needed. Press Enter to accept.

3. If your chart sheet has the wrong name, use the pop-up menu to rename the

Chart1 tab to: CalCurve.

4. Rename the Sheet 2 tab to: Data Analysis.

5. Move the sheets so that Summary is the first worksheet, followed by Data Analysis, 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:

Page 36: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

36

12.4 Common Charting Errors If you missed any of the steps in the above, you can still add the proper formatting to your graph.

12.4.a Add a Chart Title 1. Click in the chart area in general and the Chart Tools tabs should appear in the

main Ribbon. Under the Layout tab, Labels group, select the Chart Title control.

2. The drop down menu allows you to choose between various formats for a chart title. Once you select an option, the title will appear on your chart. To enter a different title, click on this title until a cursor appears. You can then delete the default title and type in one of your choosing. For our Calibration Curve, the title is: Calibration Curve for Zinc Analysis by Atomic Absorption Spectroscopy.

12.4.b Add Regression Equations to Graph 1. Right click on the Trendline – a box under the pointer will indicate when it is ‘on’

the trendline. 2. Choose Format Trendline from the popup menu. 3. The dialog box is the same as that described above in section 12.2.

Save your worksheet onto your USB drive.

13 Printing

13.1 What will Excel Print The following is a general discussion about how Excel prints stuff. Don’t 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 • Under the Page Layout tab, in the Page Setup group, select the Print Area

control, and choose Set Print Area from the drop down menu. • 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 desired sheet and select Clear Print Area from the

same menu. For this assignment: 1. Set the Print Area of the Data Analysis sheet to include A1:I40. 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.

Page 37: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

37

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. Right click on the Data Analysis tab, and choose Move or Copy… Check the ‘create 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, go to the Formulas tab, then in the Formula Auditing group, select the Show Formulas control. Your sheet will display the formulas in the cells, rather than the final results.

Select cells A1 to I40 and set the print area. To ensure it prints on one page only, perform the following steps:

a. Under the Page Layout tab, in the Page Setup group, select the Orientation control, and choose Landscape.

b. Still under the Page Layout tab, in the Scale to Fit group, select the Width control, and select 1 page from the drop down menu. Do the same in the Height control.

c. Repeat a. and b. for the Summary, Data Analysis, and Regression worksheets.

Save your workbook again. You can now use this workbook as a reference for future lab data.

13.2 Use the Page Layout tab – Page Setup group to set page options, margins, headers and footers, etc.

• 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.)

Page 38: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

38

• Select the Data Analysis worksheet. Under the Page Layout tab, in the Page Setup group, select the Print Titles group. The following dialog box appears:

• Select the

Header/Footer tab. The Header and Footer dialog allows for manual entry of text, date/time, page, filename and sheet name.

• Section 17 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. You can see an example below. Please change the name and lab section number to your own.

Now set the custom 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

Page 39: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

39

it). In the left section select to have the Sheet name displayed with the appropriate button. If unsure, moving your mouse over the button will get a description of that button to appear on the screen. Your footer should look like the one below before you click OK.

For the Calibration Curve, the Header and Footer must be input differently. Go to the Insert Tab, then in the Text box, click on the Header/Footer button. Now set the sheet options so that the gridlines will not print. Click on Print Titles again. Under the Sheet Tab, uncheck the boxes for gridlines and for Row and Column Headings. 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. Make sure you do this for each of the worksheets in your file. 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.

13.3 Preview the Worksheet It is always a good idea to preview how your worksheet will print; it saves a lot of paper! • Under the Microsoft Office Button,

Click on Print, NOT Print Preview. The following dialog box will appear.

• Select the appropriate printer from the drop down list (Note: Fax is not an appropriate printer. The default printer

Page 40: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

40

option for your computer should be fine). • Select the Entire Workbook option under the Print What section. • Next click the Preview button to the lower left to preview what the printouts will

look like.

13.4 Printing the Worksheet

Click on the Microsoft Office Button , then click on Print. The available printer properties is dependent upon the make and model you will be using to print. Different printers have different features and capabilities available. By default Excel prints only the current sheet unless another option is selected; so, to print all your sheets, you will need to set Print What to Entire Workbook, just like when we were previewing the workbook. You will be printing all 5 pages. If you have not already done so, preview the workbook and make sure that all the pages you need will be printed!

14 Ending Your Session Shut down Excel and follow any additional shut down instructions.

1. From the File menu select Exit 2. When Excel asks if you want to save your changes, select Yes. 3. Any message about data on the clipboard can be ignored.

Staple and hand in your printed worksheets and charts to your instructor; if only one sheet has the header/footer information on it, put that sheet at the beginning of the pile.

15 Exercise for Next Week Your assignment for next week is to fill in the empty columns from C4:E21, and D28:I40 of the Data Analysis and Data Analysis (2) sheet. You will need information from other parts of the spreadsheet. 1. The solution concentration is determined from the linear regression equation you prepared in week 1. Rearrange this equation to solve for x and input this equation into the appropriate column. Have Excel calculate the concentrations for you! (You do not have to calculate the sample concentration for the method blank, this is simply used to correct sample signals, as described before.)

2. Adjust the columns to display the correct number of decimal places based on your uncertainty. Assume the uncertainty is the standard deviation. Standard deviations should never have more than 2 sig figs. Check the statistics appendix for more detail.

3. On a separate page, write out the formulas used in each column in conventional chemistry notation (i.e., not with cell addresses etc.). Show cancellation of units. Hand in a printout of both the Data Analysis and Data Analysis (2) worksheets. The other worksheets are not required.

4. Remember to e-mail an e-copy of this workbook to your TA.

Page 41: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

41

16 Formatting the Worksheet (optional) Start this section by opening the exercise.xslx workbook again. This was the spreadsheet you created in Section 8 of this tutorial. Select Sheet 1 as the active worksheet. You should always verify the data entered is correct. Let’s assume for now that it is and we will now change the appearance of our worksheet for greater visual impact. Many commonly used formatting commands are grouped in user interface Ribbon, in the Home tab, as illustrated below:

1- Font face and size 2- Bold, Italic, Underline, or use keyboard shortcut Ctrl+B, Ctrl+I, Ctrl+U 3- Add borders, background colour, or change font colour selection 4- Align vertically (top, center, bottom) and horizontally (left, center, right) 5- rotate diagonally or vertically; increase or decrease indent 6- Wrap text, Merge cells 7- Change format of cell contents; format as $, %, comma style and add/remove

decimal

Some of these controls have drop down menus for even more formatting options. Some specialized formatting options are also found in other tabs and groups.

16.1 To apply formatting: • First select the cell/range to format • Then click the appropriate format button or, with the cells highlighted, right click

and select Format Cells from the popup menu. Format the column headings in row 2.

1. Select cells B2 to E2. 2. Right click on the cells and choose Format Cells from the popup menu. Centre

the selected range from the Alignment tab. Horizontal alignment is what we are normally after. Widen narrow columns if necessary to see that the text is centred.

Page 42: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

42

3. Still in the Format Cells dialog box, under the Font tab, Add boldface and italics (Bold Italic) to the selected cells

16.2 Undo Text Formatting Sometimes formatting like bold and italics do not look good. To remove formatting, click the appropriate control button a second time (format buttons act as toggle switches) or use the right click – Format Cells dialog to make changes.

1. Remove italics from the column headings.

16.3 Changing Fonts The Home tab, Font group has two drop down list for changing fonts and font sizes. Let’s change the font of the column headings and the row headings in cells B1 through E1, and A2 to A11. This also demonstrates how to select a non-contiguous range of cells.

1. Make sure that cells B1:E1 are highlighted. 2. Add the row headings, hold down Ctrl and click and drag cells A2 to A11. Cells

B1 through E1 and A2 through A11 should all be highlighted now. 3. Select a different font from the list of your choice. 4. Change the size of the font to a size of your choice. If you made the text too wide

for the cells, adjust column widths as necessary.

16.4 Formatting Numbers Let’s put the data in cell A11 in percentage Format

1. Select cell A11 2. Change the format to % (use the % button in the Number group (Home tab)),so

the number appears as 7%. 3. Let’s give this some decimal places. Click on the Increase Decimal Point

control (in the same Home tab, Number group) twice to give the number 2 decimal places. It should now appear as 7.00%

Warning: Excel handle % entries differently, so watch that values are entered correctly.

• If the % format is applied to a blank cell then any entry to that cell will be treated as a percent. Entering 10 into the formatted cell will display as 10%.

• If a cell contains a value and then the % format is applied, then the value is converted to a percent value. Enter a value of 10 then format as the cell as a percent will display 1000%.

16.5 Using Styles Styles define a combination of text attribute formats (e.g. Italic, Bold, Helvetica, 18 point). By using styles the same combination of formats can be applied to many cells without having to select the individual formatting commands repeatedly. Excel comes with some predefined styles, and you can also create your own.

Page 43: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

43

16.5.a Predefined Styles (Home tab, Styles group) Use Excel’s predefined styles to apply the Currency style to the financial figures.

1. Select all cells with money data, click and drag B2 to E8 2. From the Home tab, in the Styles group, select the Cell Styles control. This will

open a drop down menu.

3. Select predefined styles from the Cell Styles drop-down list. Notice the two Currency styles. Currency displays numbers with 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 style, 5. Apply the style to the selected cells, click OK (or press Enter). The highlighted

cells now display currency with two decimal places.

16.5.b Create Your Own Style Let’s create a style. This new style can then be applied to other cells.

1. Select a cell which has the combination of attributes we want, select cell B1.

Page 44: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

44

2. From the Home Tab, Styles group, Cell Styles control, select New Cell Style at the bottom of the drop down menu to open the Style dialog box. The style name,

Style1, is highlighted and cell formatting attributes are listed. 3. Give a new name for the style, in the Style Name text box

type: Heading. 4. Click the Format button and make any additional changes.

Suggestions: add a border, align the text to an angle, and change font color.

5. Save your new style, click OK the style is added and the dialog disappears. (The Add button allows multiple style changes without closing the Style dialog.) Let’s apply your new style to the row headings in column A.

1. Select cells to be formatted in the new style, click and drag cells A2 through A10

2. From the Home tab, Styles group, click the Cell Styles control.

3. At the top of the available styles now is a Custom section. Pick the Heading style from this. The cells are now formatted in this style. You can customize this style by making any additional formatting changes desired.

16.6 Add Rows and Columns Let’s add a title for the entire worksheet above the column headings. There currently is no room to do this. To add rows or columns:

• Put the Active Cell in the row (or column) where you want to have a new row (or column) inserted.

• From the Home tab, Cells group, select the Insert control. From the drop down menu select Insert Sheet Rows (or Columns).

• Excel inserts a rows (or column) shifting the current row and other rows below this one down (the current column and columns to the right to the right).

• To insert multiple rows (or columns), select rows (or columns) immediately below (or right) of where you want the new rows (or columns). Select the same number of rows (or columns) as you want to insert.

16.7 Removing Rows or Columns Let’s add a column, then remove it.

1. Select column C heading (top shaded cell, containing the letter “C”) The entire column is highlighted.

2. Insert a column: Home tab, Cells group, Insert control, Insert Sheet Columns. Alternatively

Page 45: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

45

you can right click on the selected column heading and choose Insert from the popup menu. A new blank column C appears.

3. Select the blank column C. 4. Remove the column: use Home tab, Cells group, Delete control, Delete Sheet

Columns. Alternatively you can right click on the column heading and choose Delete from the popup menu. The column is deleted.

Steps 1, 3 and 4 are used to delete a row by selecting the row heading (left gray cell) Delete multiple rows or multiple columns by selecting more than one.

16.8 Centering a Title Across a Range The “center” formatting centers text within a cell. There is another formatting tool that centers text across a range of cells. Lets enter a title for the whole worksheet :

1. Select cell B1 2. Enter the title type: Quarterly Report 3. Select the range of cells to center this title across, click and drag cells B1 to E1 4. Center the title in cell B1 across the selected range, from the Home tab,

Alignment group, click Merge and Center. A less efficient method would be to right click on the highlighted cells, choose Format Cells, and then, under the Alignment tab, choose to Merge Cells (check the box) and horizontally center the text.

Save the worksheet to save the changes.

17 Custom Headers and Footers (optional) The Excel header and footer dialog contains buttons to insert time, date, page numbers, etc. in any of three sections in the header, and three sections of the footer. The sections will automatically position the contents in the left third, middle third or right third of a page. One option inserts the filename, the name used for saving, e.g. assignment2.xls. An option to include the full path, e.g. C:\My Documents\Excel\working\assignment2.xls is also available.

18 Excel Charts (optional)

18.1 Drawing Tools Enhance Charts Add an arrow or circle a section of a chart to visually point out some particular piece of information. To do this we will use the arrow and oval tools. Callouts are another good way to do this. You can find all of these in the Chart Tools ribbon, Layout tab, Insert group, Shapes control.

Page 46: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

46

Note: If the chart position is moved or the chart is rotated any drawing objects added must be

manually repositioned, as they are not part of the chart.

1. Add an arrow to the chart Click the arrow button (either in the Lines section or the Recently Used Shapes section).

2. Draw the arrow, click and drag the cursor on the chart itself. 3. Release the mouse button to place the arrow. 4. Resize and reposition as needed by click and drag a resize handle at either end

(the cursor is a double-headed cursor), or click and drag on the shaft of the arrow to move it to another position (the cursor is a four-headed cursor).

5. Additional formatting can be made to the arrow. When the arrow is selected there is a new Format tab on the ribbon under the heading Drawing Tools. The controls under this tab allow you to insert other shapes (Insert Shapes group), change the colour of the shape or other features (Shape Styles group), to fill a shape with text or change other text options (WordArt Styles group), set alignment and placement options (Arrange group), and change sizes (Size group).

6. Add a circle to the chart. Under the Drawing Tools, Format tab, click on the oval under the Insert Shapes group.

7. 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).

8. Release the mouse button to place the circle. 9. The circle hides part of the chart because the inside of the circle is coloured.

Under the Format tab, in the Shape Styles group, there is a Shape Fill control. Choose No Fill from the drop down menu.

10. Resize, reposition and additional formatting are the same as steps 5 and 6. 11. To add text to the shape, click on the shape and choose Text Fill from the

WordArt Styles group in the Format tab under Drawing Tools.

To remove a Drawing object:

Click the object (resize handles show) then press Deleteµ

18.2 Excel Chart Types This section lists the 11 basic chart types found in Excel 2007. Each chart type has various subtypes to choose from. The type of chart used can help a person to understand what the data represents. The following lists charts and when to use/avoid them for presenting different types of data. Chart types can be mixed to create combination charts (such as a column and line plotted with 2 value axes). Before making an elaborate chart, always ask, “Does the chart clearly communicate the data?” If it does not then the purpose of using a chart is defeated. Naming axes, plotting charts, and how to add bubble and legend labels are covered next

Page 47: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

47

18.3 Naming the Axis In analytical chemistry, most charts are quantitative in nature, and therefore have two value axes that relate one set of quantities to another. However, most charts in general have a category axis and a value axis. The category axis displays text labels, such as months or years, regions or cities, or item names. The category axis is usually the horizontal or X-axis. For some charts, such as in a bar chart, the category axis is the vertical axis. The value axis always displays numerical data, such as currency amounts, quantity, percents, temperature, etc. The series axis is added to some 3D chart types. The series axis placement often depends on the viewing angle of the chart.

18.4 How Charts are Plotted Worksheet column data is not always plotted as the chart categories, and worksheet row data is not always plotted as the chart series. It is the number of rows and columns of data selected that dictates how data is plotted in an Excel chart:

• If the number of columns selected >= the number of rows then Excel plots the

data in the rows. The category axis uses column headings, and the row headings become the legend labels designating the data series.

• If the number of rows selected >= the number of columns then Excel plots the

data in the columns. The category axis uses row headings, and the column headings become the legend labels designating the data series. Chart Tools, Design tab, Data group, Select Data control allows you to choose different data to plot on the chart. If you want to Switch the Row/Column data option, there is also a control for this in the Data group.

• Watch which series is plotted as one plotted by Rows produces a chart with a very

different focus than one plotted by Columns.

• 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 right click, then select Hide from the popup menu. Alternatively, under the Home tab, Cells group, select the Format control. A drop down menu appears. In the Visibility section, choose Hide and Unhide – Hide Columns. Unhide the hidden columns to update a plotted chart with this new data.

Page 48: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

48

18.5 Add text labels to the bubbles or legend The Chart Wizard does not have a direct method to add labels to some charts. Bubble charts are used for illustration, but these methods can be applied for others charts as well. Here is one workaround:

• Manually create text boxes for each label. • Create one then copy and paste. Then edit the text for each addition label. • Use the Insert tab, Text group, Text Box control.

Advantage: Retains values along x-axis and the concentration of the bubbles. Can position the text boxes where you want them.

Disadvantage: Have to manually create, position, and maintain the text boxes.

18.6 Area Charts Area charts plot a continuous line, connecting data point to data point, and are similar in that way to a line chart. Area charts do not display data markers to show precise data points and are best used to display data values in a general way. Area charts plot continuous change in volume over time, especially with multiple data series. The best variations to use are the two-dimensional stacked or the 100%; these show how each data series contributes to the total volume. Area charts

are good for sales and production volume units produced, ordered, shipped, or sold.

18.7 Bubble Charts Bubble charts are a type of XY (scatter) chart that display bubble markers for each data point. They are used to compare sets of at least three values. Each data point has at least two values, and the size of the bubble represents the value of the third. To arrange data, place the x values in one row or column and enter corresponding y values and bubble sizes in the adjacent rows or columns. Use bubble charts to plot product information, such as the number of products, sales, and market share percentage. To Hand - Colour Bubble Chart bubbles

1. Plot the Bubble Chart.

Page 49: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

49

2. Recolor individual data points select the chart. 3. Click a bubble selects the entire series of bubbles, selection handles appear on all. 4. Right-click one of the bubbles and choose Format Data Series. 5. Select Fill from the left hand menu. Check Vary Colors By Point option. Click

Close. 6. Change one bubble colour by clicking a bubble, a selection handle appears on it. 7. Right click the selected bubble. 8. Choose Format Data Point. 9. Select Fill from the left hand menu. Choose Solid Fill from the options. A

selector for Colour and Transparency appear. Choose a different fill colour. Click Close.

10. Click on the next bubble and repeat for each bubble. 11. Legend shows the bubble colour and the x-axis value associated with that colour.

18.8 Bar Charts Bar charts (like column charts) are used for side-by-side comparison of items that have distinct (non-continuous) measurements made at regular time intervals. Bar charts focus more on the horizontal value axis and less on the category axis. Use bar charts to show positive or negative variation from a centre point, the stacked variation to show cumulative totals, or for long category labels in a column chart. Use bar or column charts to plot a large number of items. If the chart looks too cluttered then try using a line chart. The bar chart has additional formatting options, these include:

• Place labels on the category axis to the left of the chart by selecting the Low option for Axis Labels in the Format Axis dialog box (Right click when axis is selected), Axis Options menu.

• 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 (Axis Options menu under Format Axis), 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 Axis Options menu

in the Format Axis dialog box.

Page 50: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

50

18.9 Column Charts Column charts are used for side-by-side comparison of items that have distinct (non-continuous) measurements made at regular time intervals. Consider using if the number of items or intervals is small e.g. (1 to 8). As the number of category labels increases, Excel automatically displays the labels at an angle or skips every other category label. Try resizing the chart, reduce the font size of the category axis labels, abbreviate the labels in the worksheet, or switch to a bar chart.

18.10 Bar and Column Chart Variations Include Cylinder, Cone, and Pyramid charts. These can be seen in the previous two figures.

18.11 Doughnut Charts Doughnut charts are used like pie charts to compare the ratio (percentage) of each segment or piece to the whole doughnut ring. A doughnut chart can show more than one data series; each series becomes a ring. Read each ring separately, comparing segment portions. Each additional data series makes reading a doughnut chart more difficult. Try to limit this chart to only two or three data series. Use doughnut charts as an alternative to multiple pie charts. To make precise distinctions between percentages or values, use a chart that has a value axis (e.g. a column chart) instead of a pie or doughnut chart. A value axis can display percentages or values.

18.12 Line Charts Line charts show trends over regular time intervals and are a good choice when a lot of data points exist. Use line charts when the category time intervals are evenly spaced or when the categories are text and spacing is irrelevant. Use line charts to show trends in business or financial data, such as production, sales, costs, or the stock market over time.

Page 51: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

51

Line charts without plotting value points show general trends without the volume shown in an Area chart. The 3-D Line chart as it is viewed at an angle may not display the detail for a fairly flat or highly variable data. To rotate, select the Corners option in the Chart toolbar then click and drag a corner handle to rotate it.

18.13 Pie Charts Pie charts compare the ratio (percentage) of each wedge or piece to the whole pie. A single data series is plotted, and each data point becomes a pie piece. If selecting multiple data series, only the first data series is plotted. Pie charts typically display percentages instead of exact values and are a good choice to show the percentage mix of items, such as products shipped, marketing expenditure, tax dollars, and target populations. For clarity try to limit the sections in a pie to no more than six or eight pieces, try the Pie-of-Pie or Bar-of-Pie variations, or change to a column chart.

18.14 Radar Charts Radar charts compare specific values in a data category and compare one entire data series with another entire data series. Each category has its own axis radiating from the centre point, like a spoke on a wheel. Data points for a category are plotted along the spoke. Lines connecting the data points form the data series and define the area covered by the items.

Radar charts can be difficult to understand; be sure your audience understand radar charts or be prepared to explain the chart. Increase the weight of the lines connecting the series data points for better visibility from the Format dialog box.

18.15 Stock (High, Low, Close) Charts Stock charts plot stock market data and can be used for other data such as temperature changes. Stock chart variations can measure volume with two value axes one for the volume and the other for stock prices. The data must be organized in the correct order in the worksheet before plotting the chart. Start with a column for the date, followed by the high, low, and close.

Page 52: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

52

Increase data series markers and high-low lines weights in the Format dialog to make them easier to see.

18.16 Surface Charts Surface charts are like topographical maps showing high and low points along a surface. The visually emphasize high and low points in two changing variables. Adjust the perspective from which you view the Surface chart by choosing Chart, 3D View, and rotate the chart by clicking and dragging a corner handle.

18.17 XY (Scatter Charts) XY or scatter charts are used to compare trends over uneven time intervals or other measurable increments. Use XY charts to plot survey responses or sampling data that was randomly gathered to display patterns or clusters of data points. Scientific, engineering, and marketing data is often charted with XY scatter charts. An XY chart can also plot two groups of numbers as one series of XY coordinates When you arrange your data, place x values in one row or column and then enter corresponding y values in the adjacent rows or columns. When plotting two groups of numbers there is a difference in the appearance of the plotted data in a Line chart vs. an XY chart. The line chart plots the category axis values at regular intervals. The line chart does not give an accurate plot with intermittent category x values. The XY (scatter) chart plots the category values at intervals that show groupings or concentrations. Line and XY (scatter) charts plot identically when the category axis values are dates.

Page 53: Appendix 1: Basics of Excel for Chemistry 212web.uvic.ca/~nicholet/chem361/Excel.pdf7 The active cell is the cell that Excel is “looking” at. In a new worksheet, the active cell

53