You are on page 1of 20

Histogram Tutorial

for Excel 2007


• What is a Histogram?
• Installing the Analysis Toolpak for Excel
• Creating a histogram using the Histogram Tool
• Alternate method for creating a histogram
What is a Histogram?
A histogram graphs the frequency of values in a set of data. It
gives a visualization of the way the data is distributed.

E.g. Here is a small set of data displayed in a bar graph:


What is a Histogram? Cont…
Now here is that same data displayed in a histogram. The range given for
the data values is from 0 to 60, with each bin being of size 10.

Number of values in the data


that were between 0 - 10
Bin ranges

Bin Ranges
Installing the Analysis Toolpak
Excel has many extra tools that can be installed to help you complete your
tasks. The Analysis Toolpak contains a set of tools, including a Histogram tool
which can be used to create a histogram in much the same way as making a
chart.

Start by clicking the Office button


at the top left corner of the excel
window.
From the menu that pops up, select
‘Excel Options’
Installing Analysis Toolpak cont…
In the window that pops up
select ‘Add-Ins’ from the left side
bar. It will display a list of all of
the active and inactive add-ins.

To activate an add-in, go down to


where it says Manage: Excel Add-
ins and click the Go button.
Installing Analysis Toolpak cont…
You should now have a pop-window
with a list of the available add-ins.
Check the Analysis Toolpak and hit OK

When you are asked if you wish to


install, hit ‘Yes’

Windows should now install the Analysis Toolpak. If it has been


installed correctly then you should be able to find a new section
named Analysis under the Data tab, with a tool called ‘Data
Analysis’
What if I don’t have a CD?...
If you did a complete install of Excel then you should not need any CDs to
install the Analysis Toolpak. If you are asked at any point to use a CD and you
no longer have it with you, you will have to follow the alternative method for
creating a histogram instead of using the Histogram tool. The steps for the
alternative method are detailed later in the tutorial.
Using the Histogram Tool
At this point we will assume that you have successfully installed the Analysis
Toolpak (pg 4). If you were unable to install it then follow the alternative
method for creating a Histogram (pg 11).

First you must set up your bin numbers so the histogram tool knows what
ranges it is using for the bins. For your assignment you do not need to
choose what bin ranges to use, they are in the instructions.
Type the bin values into your excel spreadsheet next to your chart data

Following the example from the


previous slides…
Using the Histogram Tool cont…
Go to the Data tab and from the Analysis section select the Data Analysis
button.

From the pop-up choose the


Histogram tool

Input Range: The data in your spreadsheet


you wish to graph

Bin Range: The bin values in your


spreadsheet

Select Cumulative Percentage to have a


line display the Cumulative % of the
frequencies

Select Chart Output to have a graph made of


the histogram
Using the Histogram Tool cont…

Once you’ve clicked ok, the histogram will be created in a separate worksheet
along with a table displaying the calculated frequencies and cumulative % for
each bin.
An Alternative Method
For those who are following the tutorial but could not get the Analysis
Toolpak installed, here are a set of instructions for an alternative way to
make a histogram using the Excel chart tools using the same data from the
earlier examples.
First you must set up your bin numbers so
the frequency function knows what ranges
it is using for the bins. For your
assignment you do not need to choose
what bin ranges to use, they are in the
instructions.

Type the bin values into your excel


spreadsheet next to your chart data

Following the example from the


previous slides…
An Alternative Method cont…
We will need to calculate the frequency of the values in the data that fall inside
each of those ranges defined by the bin number. In other words, how many of the
data values are between 0 – 10, how may are between 10 – 20, etc…
To do this we will use the FREQUENCY function

Start by highlighting the cells where you would like


the results of the FREQUENCY function to be
inserted into your spreadsheet

Go to the formula tab, and in the


function library look under More
Functions -> Statistical, and find the
FREQUENCY funtion
An Alternative Method cont…
Add in the cell references for the data and the bin numbers, and hit OK.
An Alternative Method cont…
The formula for the frequency funtion
should now appear in the formula bar at the
top of the spreadsheet. But where are our
frequencies?

The formula still needs to be propagated


(copied) down the rest of the cells. To do
this, make sure the cells are still highlighted
and click the formula bar and type ctr-shift-
enter (on a mac it is the command-return
keys).

You should now have the frequencies


calculated and filled in
An Alternative Method cont…

Now that you have the frequencies you can create a histogram with a simple
bar/column chart using the frequecy values for the chart data and the bin
numbers for the horizontal labels.

(Charts are covered in the CIS 1000DE Excel tutorials)


An Alternative Method cont…
Lastly we want to have the cumulative % of the frequencies represented as a
line on our histogram.

To calculate the cumulative %, first calculate the percentage of each frequency


out of the total number of all the data in the set (in this example, there were 26
numbers in the data set. So a frequency of 10 would be 38%)

In the column next to the percentages calculate the cumulative percent by adding
each percent to a total. The last value should always be 100%
An Alternative Method cont…
Now that you have the cumulative %, you can add it to the histogram by
selecting the chart and going to Select Data (under the design tab) and adding
it as a new series. The histogram should now have two sets of bars

Almost there, but first we need to turn the cumulative % into a line…
An Alternative Method cont…
Right click the cumulative %
bars on the chart, and from the
pop – up select Change Series
Chart Type. Select Line chart
and hit ok

We have the cumulative % as a line


now, but it still looks wrong. It
shouldn’t use the same y-axis
values as the frequencies…
An Alternative Method cont…
Right click the line and select
Format Data Series

In the new box where it says Plot Series On, change it to


Secondary Axis
Finished

Your histogram should now be complete!

You might also like