19
How to Make Histograms using Excel 2013 Excel now has the capability to produce histograms from raw data, given that the user tells Excel how to bin the data, and where to display the graph. That graph will probably need to be modified to suit the user’s preferences on size, labels, format, etc. The final graph can then be copied and pasted into a document. We shall use the exam scores data from EXAMPLE 3 in Chapter 5 Unit C of the textbook. There are 20 scores from a 100-point exam. To match the histogram in the text (left graph of FIGURE 5.7), we shall use 5- point bins, except we shall label them more appropriately (70-74, 75- 79, 80-84, 85-89, 90-94, and 95+). Before starting this lab, you might want to print out these instructions so you can refer to them while using Excel. You may visit http://faculty.ycp.edu/~eweaver4/MAT111.html and download this file (in MS WORD format). Also, from that web page, download a copy of the Excel file (HistogramData.xlsx) which contains the exam scores and histogram bin “instructions.” When you open the Excel file, it will look something like this (note that the screen shots have been reduced in size which hides portions of the ribbon): 1

faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

  • Upload
    dokhanh

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

Page 1: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

How to Make Histograms using Excel 2013

Excel now has the capability to produce histograms from raw data, given that the user tells Excel how to bin the data, and where to display the graph. That graph will probably need to be modified to suit the user’s preferences on size, labels, format, etc. The final graph can then be copied and pasted into a document.

We shall use the exam scores data from EXAMPLE 3 in Chapter 5 Unit C of the textbook. There are 20 scores from a 100-point exam. To match the histogram in the text (left graph of FIGURE 5.7), we shall use 5-point bins, except we shall label them more appropriately (70-74, 75-79, 80-84, 85-89, 90-94, and 95+).

Before starting this lab, you might want to print out these instructions so you can refer to them while using Excel. You may visit http://faculty.ycp.edu/~eweaver4/MAT111.html and download this file (in MS WORD format). Also, from that web page, download a copy of the Excel file (HistogramData.xlsx) which contains the exam scores and histogram bin “instructions.”

When you open the Excel file, it will look something like this (note that the screen shots have been reduced in size which hides portions of the ribbon):

1

Page 2: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Note that column C contains the lower bound for each 5-point bin (i.e., exam score data above 69 to and including 74, then above 74 to and including 79, and so forth). Column D contains the bin labels you’ll use to replace the Excel-generated labels.

Start by left clicking on the “Data” tab on the ribbon, which will reveal a “Data Analysis” section of the ribbon on the right. If the “Data Analysis section does not appear, then Excel’s AnalysisToolPak add-in will have to be installed. In that case, on the ribbon, click on the “File” tab and a new window will appear:

On the left vertical bar, click “Options” and an Excel Options dialog box will appear:

2

Page 3: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Click “Add-Ins” in the leftmost pane in that dialog box and a new dialog pane will appear on the right. Select “Analysis ToolPak” in that menu list, then click “Go” on the right of the “Manage: Excel Add-ins” menu box at the bottom of the right-hand pane as shown on the next page:

3

Page 4: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

An Add-Ins dialog box will appear, check the box to the left of “Analysis ToolPak” in the menu list, and then click “OK.”

4

Page 5: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Now you should see the “Data Analysis” portion of the ribbon.

Left click on the “Data Analysis” button, which will present the menu below, and select “Histogram.”

5

Page 6: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

When you click “OK” a Histogram dialog box will appear as shown here:

In the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then select the input range by clicking on cell A2 and while holding the left mouse button down, drag down to cell A21 (as shown below) and release the mouse button.

6

Page 7: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Note that the “Input Range” text box in the Histogram dialog box will contain the absolute range reference (with the “$” symbols; this is correct) for the range of cells you just dragged over. Do not click “OK” at this time.

Next activate the “Bin range” text box in the Histogram dialog box, and in similar fashion as you did for the “Input Range,” left click on cell C2 and drag through C7. When you release the left mouse button, the “Bin Range” text box will now contain the absolute range reference for the range of cells you just dragged over. Do not click “OK” at this time either.

7

Page 8: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Next, in the Histogram dialog box click on the “Output Range” radio button and activate the output range (range of cells on the worksheet where you’ll want Excel’s frequency table for the binned data and your chart to appear), and hold the left mouse button down and drag over the range E2:F8 to select that range (which will appear as an absolute range reference in the text box).

Click the “Labels” box and the”Chart Output” box, as shown below.

Make sure you didn’t inadvertently click something you shouldn’t have (which may have changed the values those text boxes). Those values should be exactly as shown above.

8

Page 9: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Now click ”OK.”

Note that Excel produces a frequency table in the range E2:F8 and displays the chart to the right.

We’ll have to modify that table and the chart to get the format we want (like the left graph of FIGURE 5.7 in the textbook). Furthermore, Excel labels the bin above the 95 score as “More.” However, we shall define new labels for the chart.

Select the range D3:D8, right click, then click “Copy.” Select cell E3, right click, and then click on the leftmost “Paste” button.

Excel replaces the labels in D3:E8 with the labels we desire, and displays those labels along the horizontal axis as shown on the next page:

9

Page 10: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

In the chart area, click on the Frequency legend (with the color box), right click and click “Delete” to remove the legend from the chart. At the bottom of the chart, click on the “69” and edit it to display “Scores.” At the top of the chart, click on “Histogram” and edit it to display “Exam Scores.”

Your Excel worksheet should look very similar to that on the next page:

10

Page 11: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Now we format the chart. Right click within the chart area just to the right of the chart title, and on the menu that appears, click on “Format Chart Area.” The Format Chart Area pane will appear in the right side of the window as below:

11

Page 12: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Click “FILL” in the Format Chart Area pane and that pane will open a menu with radio buttons to the left of the choices. Click the radio button for “Solid Fill” and set the Color to “white” using the down arrow:

This sets the background color of the chart to white.

Also in the Format Chart Area pane, left click on the “Size & Properties” button (to the right of the graphic that looks like a pentagram. Left click on the “SIZE” button that appears, and below that will open a dialog area with text boxes for the “Height” and “Width.” The “Width” is preset to 4 inches, so reset the “Height” to 4 inches. The chart will increase in vertical size as shown on the next page:

12

Page 13: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Click the “x” in the upper right corner of the Format Chart Area pane to close the pane, and your Excel worksheet should look very similar to this (next page):

13

Page 14: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Next, we want to finalize the histogram by changing the width of the bars and putting a black border around each bar. Right click on any bar, and on the menu that pops up, click on “Format Data Series…” A Format Data Series pane will appear in the right side of the window as seen below:

14

Page 15: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

We want to eliminate the space between the bars to make the width of each bar represent a test score range of 5 points (bin size). Click on the “Gap Width” slider and drag it to the left until the width shows 0%. Next, add a black border around each bar: click on the “Fill & Line” icon (tilted paint bucket) under “SERIES OPTIONS.” When the new menu appears (as shown below), click on “BORDER.”

Set the “Color” to black, and the Width to 1.25 points. Click the “x” in the upper right corner of the Format Data Series pane to close the pane. Then click any place in the upper right chart area. The Excel window should look like this:

15

Page 16: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewIn the Histogram dialog box, activate the “Input Range” text box clicking in its text box, then

Right click on the chart area (not just the histogram itself), click “Copy,” and paste it wherever you want (such as just below in this WORD document):

70-74 75-79 80-84 85-89 90-94 95-990

1

2

3

4

5

6

7

Exam Scores

Scores

Freq

uenc

y

16