Database Operations, Graphing Data, and Embedding a Spreadsheet in a Word Processing Document Written by Hayden Porter and David Bykowski for the 1999 Johnson/Mellon Introductory Workshop. Some modifications made by Geoff Mazeroff. Overview: It can be helpful to see the final grade distribution for the class as you decide how to assign grades that fall near the grade boundaries. You can use Excel's database functions to help you count the number of grades in the “A” range, the “B” range, and so on. These same database techniques are directly applicable for analyzing the results of surveys or data acquired from the Internet or other on-line sources. The examples in the following section make use of a built-in function named DCOUNT. There are many other database functions in Excel that provide useful database capabilities. For example, DAVERAGE will compute average values for selected database items. Please note that this tutorial is written for an audience of a professor. Objectives: This tutorial will show you how to use one of Excel’s database functions, how to produce charts to view data, and how to embed a spreadsheet into a Word document. You will experiment with altering grades and observing how the database information and charts are automatically changed as a result of your data modifications. Conventions used: In the following, actions you are to perform appear within a shaded background. Parenthetical remarks associated with actions are indented within the shaded areas. Where menu operations are to be performed, they are indicated as menu>selection. For example, File>Save would mean “select the Save option under the File menu.” This tutorial will take approximately 20 minutes. Using Database and Graphing Features of Excel DCOUNT is a function that requires three arguments. The first argument is a range of cells containing the data to be analyzed. In the case of the grades spreadsheet you completed in the previous tutorial, you might take the range A2..P17. This range includes both the names of the columns as well as all the grades. Alternatively if you only wanted to analyze the final grade distribution, you could take the database range to be P2..P17. Cell P2 contains the field name “Final.” As the second argument, you must define the range of field names for which the analysis will be performed. For analyzing only the final grades the field name is “Final” and is contained in cell P2. For the third argument, you must specify a range containing the criteria to be used for counting. For example, to count the number of “A”s in the Final column the grade must be greater than or equal to 90. In Excel a criterion is entered by placing a condition such as “>=90” in a cell. Criteria may be put together using “AND” or “OR” operations. For example to define a criterion for a “B” letter grade, we require that the grade be less than 90 (“<90”), and greater than or equal to 80 (“>=80”). Criteria ranges in the same row are treated as “AND” in evaluation, while criteria in the same column range are treated as “OR” in evaluation. If Excel isn’t running, start Excel. If Netscape isn’t running, start Netscape. Navigate to Go to the Cadre home page at http://www.furman.edu/~porter/cadre and select “Cadre On-Line Tutorials.” Follow the instructions for downloading grades2.xls. Minimize Netscape. Open the file grades2.xls in the mellon folder on your hard drive. Observe that cells B25..B29 show letter grades and cells C25..C29 contain the number of final grades that fall into each letter grade category. Double-click the entry for cell C25 to see its formula. It has the following formula: =DCOUNT(P2:P17,P2,C22:C23) As noted above, the range P2..P17 is the database range, P2 is the field name, and C22:C23 is the criteria range. Looking at the cells in the range C22:C23 you find the entries Final >=90 The field name must appear in the cell above the selection criteria. In this case Excel compares each grade in the Final column to see if it is greater than or equal to 90. DCOUNT increments the value in cell C25 by one each time a grade satisfies the criteria. After all values are tested, C25 contains the number of “A”s. Examine the formulas in the other cells C26 through C29 and observe how those criteria are defined. Note that the criteria for C26 include two adjacent columns and rows. Consequently the count is incremented only if the grade is less than 90 AND greater than or equal to 80. Change the exam grades and/or other grades and see how the final average is changed. Note that the count of the number of grades in each grade range reflects your changes. In the following, you'll set up a chart to display the final grades. You'll create a bar chart showing the number of grades in each grade range. Highlight the range from B25 to C29 and select Insert>Chart. A dialog box, which contains a list of available chart types, appears. From the chart types on the left side of the dialog box, choose Bar. From the Chart Sub-type section of the dialog box, choose the first chart on the second row (Clustered bar with a 3-D visual effect). Click the Next button. Next, you will see the dialog box that allows you to set the data range. Since we have already specified the data range, click the Next button. For now, we are not concerned about entering axis names or chart titles, so click the Next button. The last dialog box allows you to choose whether the chart is to be created as a new spreadsheet, or inserted into the current spreadsheet. Click on the radio button entitled Choose object in: so that the chart will be inserted into the current document, then click Finish. A simple chart appears on the screen. Note that each row of the chart shows the letter grade. The length of the bar is determined by the number with that letter grade. Left-click inside the frame containing the chart. You are selecting the chart for editing. Note the handles that appear on the chart frame. Click on the small box containing the name Series 1 (legend for this chart). Handles appear along its borders. Hold down the right mouse button, and drag down to Clear. The legend is removed from the chart. Move the mouse cursor into the white area surrounding the bars of the chart but inside the frame. Press the right mouse button, and then select Chart Options. In the dialog box presented, click the Title tab. Now click inside the text field labeled Chart Title. Type “Grade Distribution” and then press Enter. The title “Grade Distribution” appears on your chart. You may experiment with other variations on this chart by producing labels, etc. See the Excel Help system for more details. In completing this tutorial, you will see how use the object linking and embedding (OLE) features of Microsoft Office. You can embed your Excel spreadsheet inside your syllabus document, and subsequently access the spreadsheet from your syllabus. Save the spreadsheet as finalgrd.xls on your hard drive. Close Excel and open Word. Open your final copy of syllabus.doc on your C: drive. Place the insertion point at the beginning of a blank line above your lecture table. 2 Select Insert>Object, then click on the Create from File tab. Click the Browse button and navigate the file system to find finalgrd.xls, and then click OK. The spreadsheet is now embedded into your word processing document. Double-click on the spreadsheet. You can now alter the spreadsheet data and view results from within your Word document. If you need to distribute materials to students that include both Word and Excel documents, you may embed an Excel spreadsheet inside the Word document or alternatively, you can embed a Word document into an Excel spreadsheet. For example, you can include an extensive set of spreadsheet data about problems and/or exercises that you want students to perform. As you will see soon, you may also embed a Powerpoint presentation into your Word or Excel documents. Project Many students are interested in learning how their final course grade will depend on their final exam score. You can easily set up a spreadsheet to compute, for each student, final course grades for a set of final exam grades. You might, for example, enter four exam scores 75, 85, 95, and 100 in the cells Q2 to T2 of the example spreadsheet. Copy the formula for computing the grade in P3 into Q3 and modify the formula in cell Q3 to reference cell Q2 for the exam score. Once you have this formula correctly modified, copy it down column P. Perform this same process for each of the other columns Q, R, and S. You can now show your students how well they will do in your course for a given final exam grade. 3