Lesson 3: Tips for Creating Tables and Graphs in MS Excel

advertisement
Lesson 3: Tips for Creating Tables and Graphs in MS Excel
Calculating Proportions: Slide 34
Let’s review how you can use MS Excel to calculate measures based upon existing data in your
spreadsheet.
Using the number of SARI cases and the total number of all hospital admissions, let’s calculate the key
indicator, proportion of SARI admissions/hospital medical admissions per 100 patients.
To do this, first select the cell where you wish to calculate a value – in this example, we want to
populate D5 with the proportion of SARI admissions/hospital medical admissions per 100 patients. Once
the correct cell is highlighted, enter the formula in the toolbar for Excel to use to calculate this value. Be
sure to start the formula with an equals sign, which signals excel to perform a calculation based on the
parameters set. In this example, dividing cell B5, the # of SARI cases in Week 1 by cell C5, the number of
all hospital admissions in Week 1 and multiplying by 100 will yield the proportion of SARI
admissions/hospital medical admissions per 100 patients in Week 1.
After you have entered the formula, press enter and the numerical value generated by the formula will
replace the formula itself in the cell you’ve highlighted. Note that the value 2.58 now appears in cell D5.
Instead of having to manually enter a formula for each Epi Week, we can copy and paste the existing
formula used to calculate D5 into the rest of Column D and Excel will use the data in the appropriate row
to fill in the correct proportions for each week. Note that to calculate the value 2.50 in cell D6, Excel
used the formula B6 divided by C6 and multiplied by 100.
MS-Excel –Creating a Line Graph: Slides 32-33, 35-38

Tips for Creating a Line Graph: Slides 32-33
Slide 32:
There are six general tips that you may find helpful in creating a line graph:
1. First of all, when creating a line graph, you will want to mark off each axis at equal intervals.
2. Next, you should use a scale on the x-axis that matches the intervals used during data
collection, (e.g. days, weeks, months, or years). For example, if you collected the data over
weeks, then use an x-axis scale that is also based on weeks.
3. Then, make the x-axis longer than the y-axis—this makes your graph appear horizontal.
4. Always start your y-axis with 0.
5. Next, identify the largest value that you intend to plot, and then round the value off to a
number that is just slightly larger, in order to adequately determine the range of values that
you need to use on the y-axis. Generally speaking, this means that your range of values on
the y-axis will be just slightly higher than the largest value you will be plotting.
6. Finally, select the interval size for the y-axis that will provide enough intervals to illustrate
data in adequate detail. If we have 5,000 cases, we don’t want to show intervals of 10 cases
– the graph will be far too large! On the other hand, if we only have 10 or 15 cases to show
at each point in time, we do not want a y-axis in intervals of 100.
When you use MS Excel to create a line graph, these tips are automatically incorporated by the program.
Slide 33:
The x-axis, the horizontal line, is used to show the values of the method of classification. The method of
classification is the criteria that you are using to order the information. For example, if you want to
examine rates of a disease over time, you would use the x-axis to show units of time (e.g. days, months
or years). In the sample graph that was shown before on a previous slide, the method of classification
used was Epidemiological Weeks (EW).
The y-axis, on the other hand, is used to show a frequency measure—how much or how many—such as
the number of cases or rate of disease. In the sample line graph on this slide, the percentages of
hospitalizations, ICU admission, and deaths associated with SARI are depicted.
The x- and y- axis are clearly labeled to depict what each is describing, in addition to having a title that
describes the content of that table, including person, place and time.
Finally, to plot the points on a graph, sets of coordinates based on the data, such as percent hospitalized
for SARI and epidemiological week, are used.

Making a Line Graph: Slides 35-36
Slide 35:
To create a line chart from the data in MS Excel, we will need to highlight the data in column A and
column D.
To make it easier to select the data, we can hide columns B and C. We will also remove the label weeks
in cell A4, and then highlight cells A4 through D56.
Slide 36:
Once the data is highlighted, click on the Insert Tab and then select the Line Chart Icon.
A drop down menu with 2- and 3-dimensional line graph choice will appear. From the menu, select the
1st option in the 2-D Line choices which is a line graph.
Once you select it, this line graph will appear.
The resulting graph looks good, but there are a couple of other things we need to do to make it look
better.
We need to label the x and y axes, remove the legend and add a more specific title to the chart.

Formatting a Line Graph: Slides 37-38
Slide 37
First let’s change the Title of the Graph. Select the Chart Title and change the name to Distribution of
the proportion of SARI admissions out of all hospital admissions (per 100), epidemiological weeks (EW)
1-52, 2010 in Barbados, Dominica, Jamaica, St. Lucia, St. Vincent & the Grenadines, and Trinidad &
Tobago.
Now let’s add axes titles. To insert axes titles, first make sure that the graph is still active. If it is active, a
frame should surround the graph. If no frame is visible, click on the graph to activate it.
Then select the Layout tab in order to access the Label menu. On the Label menu, select the Axis Titles
button
A menu will appear. To label the x-axis select Primary Horizontal Axis Title. To label the y-axis select
Primary Vertical Axis Title. Select Primary Horizontal Axis Title and let’s label the x-axis as EW.
Another menu will appear to the side. Select the option Title below the axis.
Once you do, a box will appear in your graph below the x-axis [Click to show]. Type EW into the x-axis in
the formula bar and hit enter. The axis title will appear on your graph. [Click to show].
Similarly we can label the y-axis as proportion of SARI hospital admissions (per 100 people), this time
selecting Primary Vertical Axis Title from the Axis Title button. A menu will appear with choice of layout
for the y-axis. You may choose a Rotated Title, a Vertical Title, or a Horizontal title. We choose Rotated
Title option.
Here is what our graph looks like now. Notice how I deleted the legend that was labeled SARI
admissions/hospital medical admissions per 100 hospital admissions. I did this by selecting the text and
clicking delete. If you’d like, you can also select different parts of the graph to change font, font size, etc.
You can even change the scale of the x-and y-axis, if you do not like the range of numbers MS Excel
chose.
Slide 38
We have decided to label every other week, rather than every week. To do this select the number labels
on the x-axis and right-click.
A menu will appear. From the menu chose the option Format Axis.
The Format Axis Menu will appear. In Axis Options, within the section marked Interval between labels,
select Specify interval unit and enter 2. Once done close the menu.
Here is our completed line graph. Note that the change to the number labels on the x-axis, which now
show every other number. Also note that we have added the source of the data at the bottom of the
graph.
This final graph shows the proportion of SARI admissions out of all hospital medical admissions (per 100)
from weeks 1-52 in select CAREC member countries in 2010.
Tips for Creating Tables: Slide 45
Although tables seem straightforward, it is important to remember the following tips to be sure your
table is displaying data in a clear and accurate fashion:
•
Use a clear and concise title, which provides brief descriptive information such as time period,
place, etc. It does not need to repeat information from row and column labels;
•
Label each row and column clearly;
•
Show totals for rows and columns when appropriate; and
•
Use footnotes to explain codes, abbreviations, and symbols, note exclusions, and note data
source.
MS Excel-Creating a Stacked Bar Chart: Slides 50-57

Tips for Creating a Stacked Bar Chart: Slide 50
Slide 50
A stacked bar chart is a chart that can be used to compare the parts to the whole. The bars in a stacked
bar chart are divided into categories. Each bar represents a total across all categories.
This bar chart shows the number of influenza cases in Ecuador by type and sub-type for weeks 45-52 in
2010, and weeks 1-49 in 2011. The green color reflects influenza B, the aqua/blue color is influenza
A/H3, the red color is influenza A/H1, the black represents influenza A not subtypeable, the yellow are
influenza not subtyped and the orange color represents numbers of influenza A H1N1 2009.

Making a Stacked Bar Chart: Slide 51
Slide 51
To begin creating the stacked bar chart, first highlight the area of data that you want to illustrate in the
graph. Since we are creating a graph depicting influenza types and subtypes, this means selecting the
data in columns B through H, including the column labels and all epidemiological weeks (2010, 45-52
and 2011, 1-52).
Once the data are selected, click the Insert Tab and then select the Column Chart Icon. A drop-down
menu will appear with column chart choices. Select the second option under 2-D Column to create a
stacked column.
Once selected, the result is this stacked bar chart. Notice that because of the amount of data in the
worksheet, the stacked bar chart appears on top of the data.

Formatting a Stacked Bar Chart: Slides 52-57
Slide 52
To remedy this we can move the chart to a new sheet within the Excel workbook, so that chart has its
own location and does not appear on top of the data in this worksheet. You will notice that once the
chart is inserted, MS Excel defaults to the Design Tab. Click the Move Chart Icon located on the right of
the screen. The Move Chart menu will appear. Select New Sheet and type a descriptive name into the
adjacent blank space. Then click okay.
The chart is now located in a new sheet.
It looks good, but we still have some work to do to make it look more like the original chart.
Slide 53
Next, you will want to add a title to the stacked bar chart. To do so select the Chart title Icon in the
Layout tab and a drop-down menu will appear. Select the Above Chart option, and type in the title into
the formula bar “Distribution of Influenza Virus by Type and Sub-Type in Ecuador, epidemiological weeks
47 of 2010 through 15 of 2011” and click enter.
You can go into the highlighted title box and alter the text and font directly.
Slide 54
To make it look like the original chart you will need to move the legend from the right side of the chart
to the bottom of the chart. To move the legend, click the Legend icon on the Layout tab. A drop-down
menu will appear. Select Show legend on the bottom. The legend is now located at the bottom of the
chart.
Notice though that the legend appears in the complete opposite order than in the original. Here it shows
A H1N1 2009, A not subtyped, A not subtypeable, A/H1, A/H3, and influenza B. If we want, we can go
ahead and change the order.
Slide 55
Click on the area around the legend and right click. A menu will appear. Click on Select Data. The Select
Data Source menu appears. Let’s start by moving the location of A H1N1 2009. To move a legend entry
up or down use the arrows located here. We want the legend entry to be last in the last, so we click on
the down arrow, over and over until the legend entry, A H1N1 2009, appears last. Once complete, click
OK. Notice A H1N1 2009 is now on the right-hand side. You can then move all legend entries to the
desired location.
Slide 56
Here we have the correct ordering of legend entries. We have also removed the y-axis lines by selecting
all the lines and clicking delete. Note that we have also added titles to both the x- and y-axes and
changed the x-axis interval unit to 4, using the steps we learned when making the line graph.
We can also change the gap size, or the size in between the bars. To do so click anywhere on the chart
bars and right click. A drop-down menu will appear. Select Format Data Series. The Format Data Series
menu will appear. In Series Options change the Gap Width to 20% either by entering the number in the
box or sliding the bar. Then click Close. Here is what our chart looks like now. Notice how the bars are
closer together.
Slide 57
Now we’re almost done. Just one more thing to do. We need to change the colors to match the original
chart. There are a couple of ways to do this. One option would be to right-click on each section of the
bars that represent the different types and subtypes and change the color using the Format Data Series
menu. This works well. But in order not to miss any types or subtypes not present in the chart for those
weeks, but included in the legend, let’s change the colors using the legend.
To do that, select each individual legend entry. Let’s begin by selecting Influenza B. Once selected, we
right-click and a drop-down menu appears. Select Format Legend Entry. The Format Legend Entry Menu
appears. In the fill area select the Solid fill option and choose the color you want for Influenza B, in this
case green. Select close.
MS Excel-Creating a Combined Graph: Slides 59-63

Making a Combined Graph: Slides 59-60
Slide 59
As shown in previous slides for making a stacked bar chart, you will need to first highlight the data you
wish to use in your MS Excel worksheet. We want to include all respiratory virus data in our chart. We
also want to include % positive for influenza data in column R, without including Columns L-Q.
We can select data in columns B-K and R, in rows 4-56, which represent epidemiologic weeks 1-52, by
using the control key on your keyboard to select the separated column(s). In this example, we first
selected cells B4-K56 as we did before. Next holding down the control key, we selected R4-R56. Once
the data is selected, we create a stacked bar chart, using the same steps we used in the previous
section. As you will recall, first click the Insert Tab and then select the Column Chart Icon. Once the
drop-down menu appears, you select the second option under 2-D Column to create a stacked column.
First, notice how % positive is included as a segment in the bar chart and not a line graph overlaid on the
bar chart. We will change that in just a moment.
Other things that need to be changed about the stacked bar chart:
o
o
o
Change the chart location.
Order of the legend entries.
Color of the bars and legend entries.
o
o
o
o
Need to add a chart Title and axes titles.
The interval unit on the x-axis should be 4.
The gap between bars needs to be much smaller.
The legend needs to be on the bottom.
Slide 60
We still need to change the % positive for any virus, and make it appear as a line graph overlaid onto this
stacked bar chart. To do that, select the legend entry % positive and right click. As usual, a menu will
appear. This time we select the Format Data Series option. The Format Data Series box will appear. In
the Series Option section labeled Plot Series On select Secondary axis. And then close.
Next, you will need to right click on the % positives legend entry and right-click again. Select Change
Series Chart Type.
The Change Chart Type menu will appear. Here you will indicate that you would like a line graph, as
shown here in the slide. Then click OK.

Formatting a Combined Graph: Slides 61-63
Slide 61
Here is the result. There are just a few more formatting issues to take care of before our combined
graph is complete. First, let’s change the color of the line graph to black. Once again, we select the
legend entry % positive and right-click. This time we select Format Legend Entry from the pop-up menu.
The Format Legend Entry menu will appear. In the Border Color section, select Solid Line and chose the
color black. Note the change in the color of the line graph.
Slide 62
Next, you will want to format the axis on the right of the chart to reflect a percentage (up to 100).
Select the second Y-axis on the right and right click. On the pop-menu, select Format Axis.
The Format Axis menu will appear. Go to the Number section of the menu. Under Category, select
percentage and change decimal places to 0.
Here is the result. There are just two more things we need to do:
1. Label the second Y-axis.
2. Add the data source.
Slide 63
To add the title to the second Y-axis, first, go to the Layout tab and select Axis Titles. Notice how we now
have options for Primary and Secondary Vertical and Horizontal Axis titles. Select the Secondary Vertical
Axis Titles option. Enter “Overall positivity for any respiratory virus” as the title.
Download