16
How to Make Histograms using Excel 2010 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. 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 like this: 1

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

Embed Size (px)

Citation preview

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

How to Make Histograms using Excel 2010

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. 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 like this:

1

Page 2: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewActivate the “Input Range” argument in the Histogram dialog box by 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.

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

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

Activate the “Input Range” argument in the Histogram dialog box by 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.

2

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

Note that the Input Range in the Histogram dialog box will contain the range reference for the range of cells you just dragged over. Do not click “OK” at this time.

3

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

Next activate the “Bin range” argument 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 range reference for the range of cells you just dragged over. Do not click “OK” at this time either.

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 select the range (E2:F8). Note that the “Output Range” box will contain the reference for those cells you just selected:

4

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

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

Now click ”OK.”

5

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

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

Note that Excel replaces the labels in D3:E8 with the labels we desire, and displays those labels along the horizontal axis.

6

Page 7: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewActivate the “Input Range” argument in the Histogram dialog box by 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 below:

7

Page 8: faculty.ycp.edufaculty.ycp.edu/~eweaver4/How to Make Histograms...  · Web viewActivate the “Input Range” argument in the Histogram dialog box by 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 dialog box will look as seen below:

Click on the right hand pane for the “Fill” button and click on the radio button for “Solid Fill.“ Left click on the “Size” button and the Format Chart Area dialog box will present a dialog pane in the right hand portion of the box. In the “Size and rotate” portion of the right-hand pane use the up/down arrows in the “Height” box to set the height to 4”. This will scale the height of the chart to the same size as the width as in the box below. Then click “Close.”

8

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

Your Excel worksheet should look very similar to this, below.

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…”

On the Format Data Series dialog box that appears, click on “Border Color” and the “Solid Line” radio button. Then set the color to black, as seen on the next page. Do not click “Close.”

9

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

Next, click on “Border Styles” and set the Width to 2 pts as seen below. Do not click “Close,” yet.

10

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

Finally click “Series Option” and set “Gap Width” to 0% as shown below:

Now click “Close” and your Excel window should look like this (next page):

11

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

Right click on the chart and click “Copy” and paste it wherever you want (such as just below):

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

12