A Guide To Advanced Data Visualization in Excel 2016 Final
A Guide To Advanced Data Visualization in Excel 2016 Final
Jon Schwabish
POLICYVIZ.COM
Table of Contents 1
Table of Contents
Introduction 5
Overlaid Gridlines 15
Vertical Line 53
Table of Contents 2
Table of Contents
Slope 137
Lollipop 162
Sparklines 170
Gantt 177
Heatmap 189
Marimekko 223
Table of Contents 3
Acknowledgments Licensing Agreement
This guide would not have been possible without the support and Copyright © Jon Schwabish 2017. All Rights Reserved.
help of a number of people. Ebook design and tech-editing could not
This ebook, including any attached files, contains confidential,
have been done without the superb help of Glenna Shaw at
privileged and/or copyrighted information for the sole use of the
GlennaShaw.com. A number of other people in the Excel
original purchaser. No part of this publication may be reproduced,
communities have been inspirational to this and much of my other
stored, transmitted, or shared in any form or by any means,
work including Jon Acampora at ExcelCampus.com, Dave Bruns at
electronic, mechanical, photocopying, recording, scanning, or
ExcelJet.net, Jorge Camoes at ExcelCharts.com, and Jon Peltier at
otherwise, except as permitted under Section 107 or 108 of the 1976
PeltierTech.com. I encourage you to visit their websites to extend
United States Copyright Act, without the prior written permission of
your Excel abilities even further.
me, the author.
I also owe a debt of gratitude to many in the data visualization
Any use, distribution or disclosure to others is strictly prohibited. If
communities who have either helped develop some of the
you are not the original purchaser and have received this ebook in
visualization types shown below and best practices to visualizing
error, please delete the original and all copies. Federal copyright laws
data (not exclusively in Excel) including Alberto Cairo, Ann Emery,
prohibit the disclosure or other use of this information without
Cole Nussbaumer Knaflic, Andy Kirk, and Robert Kosara. There are
express written permission.
many, many others, so please forgive me for not including all of them.
I encourage you to read the books, blogs and other writings and This basically means I’d like to know and approve before this is
materials from these and many others in the data visualization field. reproduced or shared. Requests for permission can be sent to Jon
Schwabish at [email protected].
4
Introduction
There is an increased recognition that effectively visualizing data is knowledge of Excel, how to create basic graphs, adding different
important to anyone who works with and analyzes data. To that data series, and combining graph types will be useful. There are
end, there has been an explosion in data analysis and data certainly different strategies to creating some of these graphs, but
visualization tools over the past few years. For many people, the approach I present here allow you to not only create those
however, Microsoft Excel continues to the be the workhorse for graphs, but also give you the techniques you can use elsewhere to
their data visualization needs. If you are an Excel user, the default create your own graphs. Along with this guide you will also receive
chart types in do not need to limit your data visualization an Excel file that you can use to recreate the graphs on your own or
capabilities; extending the tool to create other chart types is indeed to use as templates for your own work.
possible.
Should you have questions or need clarifications, please contact me
In this step-by-step guide to data visualization in Excel, you will using the Contact form at PolicyViz.com
learn how to create nearly 20 new graphs in Excel 2016/Office 365 (https://policyviz.com/about/contact/).
(O365). Each tutorial will lead you through the steps to create each
Thanks,
chart type (instructions and images use the 2016 version of Excel on
PCs, but are very similar to those on the Mac). Some basic, working Jon Schwabish
Introduction 5
Basic Data Visualization Principles
This guide is not intended to be an introductory guide to best unnecessary icons or pictures; ornamental shading and gradients;
practices in data visualization. Instead, it is intended to show you and unnecessary dimensions. Too many graphs use textured or filled
how to extend the capabilities of Microsoft Excel so that you can gradients when simple shades of a color can accomplish the same
create more and better visualizations. Yet, three basic principles task.
seem especially useful to guide your creation of better, more effective
visualizations. 3. Integrate the Text and the Graph
As a first, simple step, legends that define or explain a series on a
1. Show the Data graph are often placed far away from the content—off to the right or
People read will read the graphs in your report, article, or blog post below the graph. Integrated legends—either right below the title or
to better understand your argument. The data are the most directly on the chart—are more accessible.
important part of the graph and should be presented in the clearest
These three principles embody the idea that the graph creator should
way possible. But that does not mean that all of the data must be
support the reader’s acquisition of information quickly and easily. By
shown—indeed, many graphs show too much.
stripping out unnecessary clutter and emphasizing the data, your
2. Reduce the Clutter graphs can more clearly and more effectively communicate
Cart clutter, the use of unnecessary or distracting visual elements, information. However, default graph options in many graphing and
tends to reduce effectiveness of the graph. Clutter comes in many statistical programs tend to add clutter and to separate text and
forms: dark or heavy gridlines; unnecessary tick marks, labels, or text; graphs.
Overlaid Gridlines 15
1. Begin by creating a column chart from columns A (“Group”)
and B (“Main Series”).
Overlaid Gridlines 16
2. Remove the title.
Overlaid Gridlines 17
3. We’re now going to add the four “Line” series to the chart. that are highlighted in blue and drag across. Alternatively, you can
There are a few ways to do so. If you select the chart itself, you’ll right-click on the chart and choose the “Select Data” option to add
notice that the data are highlighted in the worksheet. You can these series one at a time. We’ll start by just adding the data in rows
simply select the little blue square at the bottom of the cells 2 through 6; the data in rows 7-11 will come later.
Overlaid Gridlines 18
4. You will now have a clustered column
chart, five series for each group. Select the
orange series for “Line 5” on the graph.
Under the “Design” tab under “Type” in
the ribbon, select “Change Chart Type”
(the third menu from the right). You can
now use the dropdown menus to change
the graph type for each series. Change the
Chart Type for each “Line” series to “Line”
and press “OK.”
Overlaid Gridlines 19
Each series except the “Main Series” now become lines.
Overlaid Gridlines 20
5. If we were to simply change the
lines to white, they would end in
the middle of the bars of the A and
E groups. We now move each of
those four lines to the “secondary
axis” so we can get them to stretch
through the bars. To do so, first
select a line, right-click, and select
“Format Data Series” (alternatively,
use the CTRL-1 keyboard shortcut).
Go to the “Series Options” tab and
select the “Secondary Axis” option.
Overlaid Gridlines 21
6. You’ll notice that a new y-axis has appeared on
the right side of the graph. When you’re done
moving all four series to the secondary axis, this
new y-axis should go from 0 to 25 (if not, adjust
the y-axes to be the same by selecting the axis
and right-clicking or using the CTRL-1
keyboard shortcut).
Overlaid Gridlines 22
7. There is also now a secondary x-axis, but we need to turn it on. To have checkmarks next to them (“Primary Horizontal”, “Primary
do so, select the “Axes” option in the “Chart Elements” menu by Vertical”, and “Secondary Vertical”). Turn on the “Secondary
pressing the “plus” button that will appear when you select the Horizontal” axis by selecting the checkbox.
chart. By hovering over the “Axes” menu, three of the boxes will
Overlaid Gridlines 23
8. Change the colors of the lines to white using the
“Format” tab option. And notice that the lines
still end in the middle of the bars for the A and
E groups.
Overlaid Gridlines 24
9. We fix that by changing how the data points line up with
the tick marks. In a default line graph in Excel, the data
markers line up between the tick marks; notice how the line
begins in the middle of the A bar, between the y-axis and
the tick mark between the A and B groups. By placing the
data markers on the tick marks, we can extend the lines
through the bars.
To do so, we’ll format the secondary x-axis (by right-
clicking and navigating to the “Axis position” options under
“Axis Options” in the “Format axis” menu (using the CTRL-
1 shortcut or using the menu from the ribbon). Here, change
the “Position Axis” marker from “Between tick marks” to
“On tick marks”. Notice how the lines now shift out slightly.
Overlaid Gridlines 25
10. Add your vertical primary axis line (Excel
2016 leaves it off as default), select the
axis and add the line under the “Format
Axis” menu. Doing so, will show some
overlap between the “gridlines” and the
axis line. We can do a couple more things
to line this up just the way we want it.
Overlaid Gridlines 26
11. We want to extend the data series for each “Line” series graph, select the “Select Data” option, and edit each of the 4 “Line”
through row 11. One way to do this is to right-click on the series to extend the data series.
Overlaid Gridlines 27
Alternatively, you can select the line on the chart and you’ll You can then drag the selection box to extend the data series.
notice that your data are selected in the spreadsheet.
Overlaid Gridlines 28
This won’t fix the overlap issue, but you’ll notice
that the group labels are shifted over to the left.
This is because we now have ten values tagged
to this secondary horizontal axis.
Overlaid Gridlines 29
12. We need to now change where the data markers line up with You’ll notice how the lines shift in slightly so that they don’t overlap
the tick marks. Once again, format the secondary x-axis and the vertical axes.
change the “Position Axis” back to “Between tick marks”.
Overlaid Gridlines 30
13. We also want to turn off the secondary horizontal axis. But (accomplished in the middle of this same menu) and set the “Line
don’t delete it! You need to turn off the tick marks and labels Color” to “No line”.
Overlaid Gridlines 31
14. Repeat the process in Step 13 for the secondary
vertical axis, remove the gridlines and style the
rest as you see fit.
Overlaid Gridlines 32
Final Version with Styling
Overlaid Gridlines 33
Overlaid Gridlines with a Formula
In this version of the Overlaid Gridlines chart, I create a stacked approach a bit more flexible: the “Breaker” cell allows you to modify
column chart. Each section of the chart is given a white outline so where the “gridlines” appear. Use the OverlaidGridlines_Formula tab
that it appears like there are gridlines. There are fewer steps in this in the Advanced Data Visualizations with Excel 2016 Hands-On.xlsx
approach, but it’s a bit more difficult to get the data set-up. The spreadsheet to create the chart.
worksheet contains a rather complicated formula that makes this
41
2. In the next menu, under “Legend Entries (Series)”
select “Add”.
42
3. We are going to add the scatterplot series, so after choosing (B10:B14) in the “Series values:” box. You’ll end up with a paired
“Add”, insert the reference to the “Scatter” name in the “Series column chart.
name:” box (cell A8) and (what will become) the y-series
43
4. Select the orange (“Scatter”) series and under the “Design” tab In the resulting menu, change the chart type for the “Scatter” series
in the ribbon, select “Change Chart Type”. to a scatterplot chart type.
44
5. We have only assigned y-values to the scatterplot series, so we choose “Select Data” again. Select “Edit” for the “Scatter” series and
now need to give it the x-values. Right-click on the chart and insert the cell reference for the x-values (A10:A14).
45
6. We now have the scatterplot overlaid with the column chart. “More Options” and menu item and in the resulting “Add Error
We now need to add the horizontal error bars. To do so, select Bars” menu that appears, select the “Scatter” series and select
the “Error Bars” option that appears in the “Chart Elements” “OK”.
menu that appears when you select the chart. Now, select the
46
7. You may notice that Excel will, by default, add
both vertical and horizontal error bars. The
default pane is for styling the Vertical Error
Bars. We don’t need these, so you can press
delete.
47
8. What we want to do is to style the horizontal
error bars. Select those error bars (again, by
right-clicking or using CTRL-1) and you’ll be
brought to the Horizontal Error Bars formatting
pane.
48
9. Some changes to make here: Under “Direction”
select “Both” and under “End Style” select “No
Cap”. At the bottom, under “Error Amount”,
select the “Custom” menu and hit the “Specify
value” button. Here, you’ll be prompted for a
Positive and Negative Error Value. We’ll insert
a reference to cell A17 for both values here. Why
2.4 for the error bar value? The error bars refer
to the position along the x-axis. We want the
lines to extend from the scatterplot point just
beyond the A bar, so that results in two
“positions” plus a bit more.
49
10. In the “Line Color” tab, you can change the line
color to a white solid line and in the “Line Style”
tab, change the line width to 1.5 pt.
50
11. Right-click (or CTRL-1) to format the scatterplot
points and under “Format Data Series”, select
the “Marker” Options” tab and then select
“None” for “Marker Type”. This will hide the
marker, and all you are left with is the column
chart with overlaid gridlines.
51
Final Version with Styling
52
Vertical Line
This tutorial shows you how to add a vertical line to a line chart. This programs (e.g. PowerPoint) and is linked to data for easier updating
could be used to mark an event, a policy change, or some other and replication. Use the VerticalLine tab in the Advanced Data
annotation. This approach is superior to drawing a line or shape on Visualizations with Excel 2016 Hands-On.xlsx spreadsheet to create
the graph because it is a part of the graph and can be moved to other the chart.
Vertical Line 53
1. Start by making the line graph using cells
A1:B13. You’ll notice you get two lines.
Excel assumes that you want to plot the
values in column A and not use them as x-
axis labels.
Vertical Line 54
2. If you select data and remove the “Year” series and remake the you’ll get a graph of the Participation series with the Year labeled
chart to use A2:A13 as Horizontal Axis labels, along the axis.
Vertical Line 55
3. We’ll add the vertical line by adding a scatterplot chart
to the line chart and then dropping a vertical error bar
from that point. We start by adding the scatterplot
point. Right-click on the chart and choose the “Select
Data” option. (You’ll notice I’ve deleted the title, legend,
and gridlines here.)
Vertical Line 56
4. From there, select “Add” and input the “Series
name” (cell A15) and the y value of 50 into the
“Series values” (cell B17) into the box.
Vertical Line 57
5. You’ll notice that two things occurred. First, the
y-axis moved from a maximum of 50 to a
maximum of 60. Excel will not allow you to put
a data series at the maximum of the chart, and
we just added a y-value of 50 to the chart.
Second, a data marker didn’t appear. This is
because we have just added a line to the chart,
but a line needs two points, so nothing appears
on the chart. To select our newly-added point to
the chart and convert it to the scatterplot, use
the dropdown menu in the “Format” tab. The
“Scatter” series will appear in that dropdown.
Vertical Line 58
6. The “Scatter” series is now selected, so while it is selected, we In that menu, select the “Scatter” option in the dropdown menu next
will change it to a scatterplot by choosing the “Change Chart to the “Scatter” series and press “OK”.
Type” button in the “Design” tab on the ribbon.
Vertical Line 59
7. We’ve now changed the point to a
scatterplot, but need to feed it an x-value.
To do so, right-click on the chart and
choose “Select Data.” Select the “Scatter”
series, click “Edit”, and input the x-value
(cell B16) into the “Series X Values” box.
Vertical Line 60
The scatterplot now appears on the chart at the y-value of
50 and an x-value of 2—note that this is the 2nd position, not
the year 2001. If, instead of 50, cell B16 was set to 2001, Excel
would interpret this as the 2,001st position on the horizontal
axis as illustrated here. Leave the x value at cell B16 on your
chart.
Vertical Line 61
8. Time to add the vertical error bar. Select the “Error Bars” menu menu if you select the “Scatter” series first and then select the
option in the “Chart Elements” menu that appears when you “Error Bars” option in the “Chart Elements” menu.) In either
select the chart. In the “Add Error Bars” menu, select the case, select the “More Error Bars Options” in the “Error Bars”
“Scatter” series and press “OK”. (You can skip this additional menu.
Vertical Line 62
9. Excel will add both horizontal and vertical error
bars. Notice that you’ll first be brought to the
Vertical Error Bars formatting menu. From
here, make a few changes: Change the
“Direction” to “Minus”, the “End Style” to “No
Cap”, and select the “Percentage” option in the
“Error Amount” menu and type 100 into the box.
Notice the vertical error bar will drop to the x-
axis.
Vertical Line 63
10. Notice that you’re also left with a horizontal
error bar, which we don’t need, so select it and
delete. To hide the scatterplot marker, select it
and select format (right-click or CTRL-1). In the
“Marker Options” tab, select the option for
“None”.
Vertical Line 64
11. Finally, adjust the maximum of the y-axis to 50
by formatting the y-axis (again, right-click or
CTRL-1) and changing the “Maximum” value to
50.
Vertical Line 65
12. As an aside, you can easily add annotation to this line by
taking the following steps.
a. First, instead of naming the series “Scatter”, give it the
name of the annotation you want; for example, “2001
Policy Passed”.
Vertical Line 66
b. Second, select the marker for that series and right-click
to add data labels.
Vertical Line 67
Alternatively, you can use the drop-down
menu in the top-left of the Format tab to
directly select the data marker.
Vertical Line 68
c. Third, select the data label and right-click
to format. In the menu, check the box for
“Series Name” and uncheck the box for “Y
value”. Format the label as you see fit.
Vertical Line 69
Final Version with Styling.
Vertical Line 70
Block Shading (annual-annual)
This chart type is typically used to mark some period of time behind annual and annual—the chart is made quickly and easily. Use the
a line or column chart, for example, a forecast period or to mark BlockShading_Annual tab in the Advanced Data Visualizations with
recessions. When the frequencies of the data match up—in this case Excel 2016 Hands-On.xlsx spreadsheet to create the chart.
Slope 137
1. Start by creating a line chart using the data provided in cells
A1:C6.
Slope 138
2. Excel will create a line chart along the columns here, but we
want to flip that. Select the chart and then select the “Switch
Row/Column” button in the “Design” tab on the ribbon.
Slope 139
3. It’s now a matter of styling and adding the data
labels. To get the lines to fill up the entire chart
space, first delete the legend. Then, format the
x-axis (select and right-click or CTRL-1): In the
“Format Axis” menu, select the “On tick marks”
button at the bottom under the “Axis position”
section of the menu. This lines up the data
markers with the tick marks and thus takes up
the whole chart space. You can also turn off the
tick marks by selecting “None” in the “Major
type” dropdown menu under “Tick Marks”, and
turn off the line in the “Line Color” tab. Press
“Close” and you can then delete the vertical axis
and horizontal gridlines.
Slope 140
4. Now to add the data markers. Begin by selecting the pink
line, right-click, and select “Add Data Labels” in the menu.
Slope 141
5. This will add a data label to either end of the line. Notice
how they are both aligned to the right of the point and
consist of the value of the point. This is fine for the point on
the right, but for the point on the left, we want the data
marker to be to the left of the point and to include the state
name.
Slope 142
6. Select the data labels—this will select both—so select the
left label again so that only that label is selected.
Slope 143
7. Right-click and select the “Format Data Label”
option in the menu. Here, you can check the
box next to “Series Name” (in addition to the
“Value” box that is already selected), and select
the “Left” option under the “Label Position”
section of the menu. You can also change the
separator from a comma to a (space) if you
want. Repeat for the remaining lines.
Slope 144
8. The advantage of making these selections through the menu
is that the labels will all be aligned together. With text
boxes, you would need to do that alignment manually. You
can now select the plot area and resize it so that the labels
fit on the chart. Style chart as desired.
Slope 145
Final Version with Styling
Slope 146
Vertical Bar-Scatter
In this chart, we combine a column chart and a scatterplot for Data Visualizations with Excel 2016 Hands-On.xlsx spreadsheet to
comparing values. Use the Bar-Scatter_Vertical tab in the Advanced create the chart
Lollipop 162
1. Create a bar chart with the Spending data using cells A1:B6.
You’ll notice that Excel sorts the data with Category E at the
top of the chart. Personally, I want my data to be visualized
in the same order as it appears in the spreadsheet. So, the
first step is to re-sort the data so that Category A appears at
the top of the chart.
Lollipop 163
2. To do so, format the y-axis by selecting it and
right-clicking or using the CTRL-1 shortcut. In
the “Format Axis” menu, check the box next to
“Categories in reverse order” and change the
“Horizontal axis crosses:” option to “At
maximum category”. The first change flips the
order of the data, but it also moves the x-axis to
the top of the chart; that’s why the second step
is needed.
Lollipop 164
3. To change this to the lollipop, we’ll use error
bars. Select the bars in the chart, and select the
“More Options” option in the “Error Bars”
section of the “Chart Elements” menu available
when you select the chart.
Lollipop 165
4. Excel will automatically add horizontal error
bars to the chart. In the “Horizontal Error Bar”
menu, change the “Direction” to “Minus”, and
the “End Style” to “No Cap”. We also want to
select the “Percentage” option in the “Error
Amount” area of the menu, and place a 100 in
the box. This will create a horizontal error bar
that goes to the left all the way to the y-axis,
regardless of the data.
Lollipop 166
5. In the “Line” menu (the first option in this
menu) change the “Begin Arrow type” to the
circle and increase its size (if you like) in the
“Begin Arrow size” menu just below. (You can
also change the color in the “Line Color” menu.)
(Note: Excel 2016 reversed how ‘begin’ and ‘end’
were defined, so if you’ve made this graph in an
earlier version of Excel and opened it in Excel
2016, you’ll notice that the circle is in the wrong
position.)
Lollipop 167
6. Change the fill on the blue bars to “No Fill” by selecting the
bars and selecting “No Fill” in the “Shape Fill” dropdown
located in the “Format” menu on the ribbon.
Lollipop 168
Final Version with Styling
Lollipop 169
Sparklines
Sparklines are a simple chart type that show small versions (or “small Use the Sparklines tab in the Advanced Data Visualizations with Excel
multiples”) of graphs. Beginning with Excel 2010, Sparklines became 2016 Hands-On.xlsx spreadsheet to create the chart.
a default option, available in the “Insert” tab of the ribbon.
Sparklines 170
1. Select where you would like to place your Sparklines (though
this could be done later too).
Sparklines 171
2. Select the “Line” option in the “Sparklines”
menu in the “Insert” tab on the ribbon.
Sparklines 172
3. Select your data for the “Data Range:”.
Sparklines 173
4. Hit OK and the Sparklines fill in.
Sparklines 174
5. Using the Sparkline Tools, you can format the color of the (in the “Show” tab), or even change the chart type to columns (in
Sparklines (in the “Sparkline Color” drop down), add markers the “Type” tab).
Sparklines 175
Final Version with Styling
Sparklines 176
Gantt
The Gantt chart consists of horizontal lines or bars and is typically This Gantt chart has a slightly different look than the typical
used as a schedule-tracking device to show the duration of different approach. Use the Gantt tab in the Advanced Data Visualizations with
values or actions. It’s easy to create a Gantt chart in Excel by simply Excel 2016 Hands-On.xlsx spreadsheet to create the chart.
highlighting cells in the spreadsheet, but Glenna Shaw shared a way
to create a different style of Gantt chart using a line chart with
markers.
Gantt 177
1. The basic Gantt chart using filled-in
spreadsheet cells is shown here. We are going to
add data to those cells to plot them in a graph.
Use the =ROW() formula to place the value of
each row in the highlighted cell. You could also
manually type in some values, but the ROW
formula is a bit faster and easier to update.
Gantt 178
2. Insert a Line with Markers chart using the data in cells
A2:H8.
Gantt 179
3. You’ll notice that the order of the lines in the graph
don’t match the order of the data in the
spreadsheet. As we’ve done before, format the y-
axis so the order of the chart matches the order of
the data by right-clicking the axis (or using the
CTRL+1 keyboard shortcut) and check the box next
to “Values in reverse order”. Adjust the axis
minimum to the lowest row number - 1 and
maximum to the highest row number + 1 to use the
full plot area of the chart.
Gantt 180
4. We can delete some of the unnecessary chart
elements such as the y-axis, horizontal gridlines, and
legend.
Gantt 181
5. We can add vertical gridlines by selecting the x-
axis (now at the top of the chart), and selecting
the Gridlines option in the Chart Elements
menu that appears when you select the plus
button to the right of the chart.
Gantt 182
6. We are now going to add the labels to the chart.
If you select the first (top) series, you’ll notice
that both points are selected. If you click again,
only the first (left) point is highlighted; right-
click and select Add Data Label.
Gantt 183
7. Click on the data label twice and right-click (or
CTRL+1) and make two changes: select only the
“Series Name” option under Label Options, and
select the “Left” option in the bottom Label
Position menu.
Gantt 184
8. This first label doesn’t look like it moved over to the left,
but if you select the plot space (not the whole chart, just
the space inside) you can shift it to the right and the
label is now lined up to the left of the point. Now repeat
the process for the other series.
Gantt 185
9. One advantage of Excel 2016 is that you can adjust the
size of the data label boxes. You may find, for example,
that the “Design Presentation” label is wrapped on
two lines. If you want this label to be on just one line,
you can select the box and select it again—this will
bring up empty circles around the box; selecting those
will enable you to adjust the size of the text box.
Gantt 186
10. You can also change the color of the labels to match
the colors of your lines.
Gantt 187
Final Version with Styling
Gantt 188
Heatmap
Heatmaps are typically used to show high-frequency data in a This visualization is relatively easy to create using Excel’s Conditional
compact format. You might think of them as a table, but instead of Formatting menu and then a little trick to hide the numbers. Use the
showing the actual numbers, the heatmap shows colors. Heatmap tab in the Advanced Data Visualizations with Excel 2016
Hands-On.xlsx spreadsheet to create the chart.
Heatmap 189
1. The basic data for this example consists of 7
variables for 28 cities, laid out in a simple grid.
We want to show frequency for each category.
Heatmap 190
2. To add color to the cells using Conditional
Formatting, select the first category (cells
B2:B28) and open the “Color Scales” option in
the Conditional Formatting dropdown found in
the “Home” tab. Select the “More Rules…”
option.
Heatmap 191
3. In the resulting menu, you can select the colors
you would like to use. It is customary to use
lighter colors for smaller values, and darker
colors for larger values. Select the colors in the
“Color:” dropdown menu. Click OK.
Heatmap 192
The column will now be shaded with the colors
selected.
Heatmap 193
4. Repeat the process separately for the remaining
columns.
Heatmap 194
5. The last task is to hide the numbers. You can’t delete them
because the shading would then disappear, and you can’t
turn them to white (to match the background) because they
would then show through the colors. Instead, it’s a small
formatting trick. Highlight the 7 columns of data and right-
click (or use the CTRL-1 keyboard shortcut) to select
“Format Cells”.
Heatmap 195
6. Select the “Custom” option at the bottom of the
“Category:” menu. Type 3 semicolons (;;;) in the
“Type:” box.
Heatmap 196
7. Press OK. This number format hides the
numbers; they are still in the cells and can be
used and manipulated, and the colors remain.
Heatmap 197
Final Version with Styling
Heatmap 198
Diverging Bars
Diverging bar charts are great for showing the differences of negative to show these categories diverging from a single midpoint. Use the
and positive values, such as Strongly Agree to Strongly Disagree. DivergingBars tab in the Advanced Data Visualizations with Excel
Because they align around a central (neutral) value, it can be clearer 2016 Hands-On.xlsx spreadsheet to create the chart.
You can choose different fill and text colors. I’ve used shades
of blue as my example colors.
Marimekko 223
The data for this example consists of 10 items and for each item we have the
percent purchased (% Purchased). We also have the share of the total sold
for each item (% of Total), which sums to 100%. For the Marimekko chart,
we’ll put % Purchased along the vertical axis and % of Total on the
horizontal axis.
The data are found in columns B and C; the rest of the worksheet is
constructed to build the graph, and much of it repeats so that we can use
the VLOOKUP formula. This version of the Marimekko uses rounded data
values; if your data have decimals, simply multiply everything by 10 or 100
and use 1,000 or 10,000 columns in the chart.
Marimekko 224
Setting up the Data
COLUMN 1 [E]
Create a new column for the % of Total variable, but change it
from a percentage to an integer. You could copy and paste the
original data and change the format of the new cells (select the
cells and right-click or use the CTRL-1 keyboard shortcut), or use
a formula [E5=C5*100] so that the data can be easily updated.
COLUMN 2 [F]
Create a Count variable that denotes the cumulative count of each
item. We’ll start with the number 1, which is hard-coded in cell F3.
A simple formula [F6=F5+E5, F7=F6+E6, …] sets the number of
cells for each value. Thus, the first Item will ultimately be
represented by the 1st through 10th columns; the second Item starts
with the 11th column; and so on.
COLUMN 3 [G]
Repeat the % Purchased series; again, the formula [G5=B5] will
make it easier to update if the data change.
Marimekko 225
COLUMN 4 [I]
Repeat the Count variable [I5=F5]. (Note: Column H is left blank
to simply separate the groups of data.)
Column 5 [J]
Simple Item # here, counting up from 1 to 10.
Column 6 [L]
Repeat the Item # series [L5=J5]. (Note: Column K is left blank to
simply separate the groups of data.)
Column 7 [M]
Repeat the % Purchased variable [M5=G5]
Marimekko 226
Column 8 [O]
You can think of starting to build the chart by setting up this
column first. This Counter simply counts from 1 to 100. Don’t type
this manually—type a “1” in cell O4 and then the formula
[O5=O4+1] in the cell just below and drag it down to row 103.
[Column 9 [P]
We’ll use a VLOOKUP formula to bring over the data for the chart.
In cell P4, we put =VLOOKUP(O4,$I$5:$J$14,2,1) and drag it down
to row 103.
[Column 10 [Q]
In cell Q4, we put =VLOOKUP(O4,$F$5:$G$14,2,1) and drag it
down to row 103.
Marimekko 227
How the Formula Works
=VLOOKUP(O4, $F$5:$G$14, 2, 1)
=VLOOKUP(O4, 1
This is the thing we look up. We are going to match each entry in this This is the “range_lookup” value and tells Excel we want an
Counter series to another look-up table to pull out corresponding “approximate match” of the value in cell O3 instead of an “exact
values. match.” It’s good practice to specify this argument whenever you use
VLOOKUP. This is the key part of the formula for this exercise. What
$F$5:$G$14
We’re going to query the data we created earlier that consists of the the approximate match does, is only fill in those cells for which the
Count and Item # data in columns I and J. VLOOKUP matches the lookup value (in column I) does not exceed the lookup reference (the
first argument in the VLOOKUP formula to the first column in the I- Counter series). Thus, you’ll notice how the values in column P equal
J table, which is why we needed to order things the way we did in the the first item number for the first 10 entries and then, starting on the
11th entry, starts with the second item number.
first set of steps. (The dollar signs ($) act as the absolute references
so that we can copy and paste this formula without changing the cell In sum, this VLOOKUP queries the Counter series and pulls out the
references.) Item # from Column J to denote each series that will populate the
2 chart.
This corresponds to the column number we want to extract, so this
refers to the Item # data in column J.
Marimekko 228
COLUMNS 11-20 [R-AA]
We’re going to create 10 different data series (one for each Item) so formula is a little complicated, but once it’s inserted into the first
that we can add them all to one chart and then color each by simply column, we can just drag it horizontally and vertically.
grabbing the entire group. The numbers at the top of the series (in
So, in cell Q3, we have
Row 2) are important here and correspond to each Item Number. This
=IF($P4=R$3,VLOOKUP($P4,$L$5:$M$14,2,1),0)
Marimekko 229
Let’s Break It Down Again
=IF($P4=R$3, VLOOKUP($P4,$L$5:$M$14,2,1), 0)
=IF($P4=R$3, 0)
To start, the IF statement evaluates the first argument, here $P4=R$3. If the first argument is False, the formula places a 0 in the cell, as
We’re simply comparing the Item Number entered in the second row specified by the “0” at the end of the IF statement. As an example, for
to how many times each series will repeat in Column P. Notice the the first Item [Column P], the first 10 rows fill with 45% and the
strategic use of the absolute/relative reference “$” symbol; we use the remainder fills with 0%; for the second Item, the first 10 rows are set
references so the cell specifications don’t move when we drag the to 0%, the next 18 rows are 38%, and the remaining 72 rows are 0%.
formula across the worksheet.
Dragging this formula across and down will give you blocks of
VLOOKUP($P4,$L$5:$M$14,2,1), numbers that repeat the % Purchased values corresponding to their
If the first argument is True, the second argument is evaluated and shares of the total.
placed in the cell. That argument uses another VLOOKUP: Here, the
You could also use the formula
first argument ($P3) looks up the Item # from column P in the last set
=IF($P4=R$3,VLOOKUP(R$3,$P$4:$Q$103,2,1),0) which uses the data
of data placed in columns L and M, specified in the second argument
we set up in Columns 9 and 10 instead of Columns 6 and 7. Both
by [$L$5:$M$14]. The third argument in the VLOOKUP (the number
formulas will return the same values.
2) looks in the second column (column M). The final piece of the
VLOOKUP (the number 1) specifies an approximate match. The
VLOOKUP formula pulls out the % Purchased variable, which is the
thing we’re going to plot.
Marimekko 230
[Column 21 [AB]
In this example, we’ll place x-axis labels at every 10% increment.
To do so, we’ll create a custom x-axis series to add to the chart.
Here’s the formula: =IF(INT(O5/10)*10=O5,O5/100,""). This
formula uses the INT function to round the number down to the
nearest integer. If we divide the Counter series (in column O) by
10 and round down to the nearest integer [INT(O5/10)] and then
multiply by 10, we get whole numbers. If those whole numbers
equal increments of ten (which works because we divided by 10 in
the INT formula), we set the cell value to that percentage; if not,
the formula returns return an empty cell, denoted by the “ ” in the
IF statement. If you enter this formula in cell AB4 and drag it down
the column, you’ll only see “10%”, “20%”, “30%”, etc. show up in
the cells.
Marimekko 231
Create the Chart
1. We now create a column chart using the data in
columns R4-AA103. To close the gaps between
the columns, right-click on the series and
change the Gap Width to 0% and the Series
Overlap to 100%.
Marimekko 232
2. You can now easily change the color of each series (i.e., each
Item) by selecting it on the chart and using the “Fill” options
in the “Format” menu.
Marimekko 233
3. To add the x-axis labels to the chart, right-click on your
chart and choose Select Data and select Column AB4:AB103
as the Horizontal (Category) Axis Labels.
Marimekko 234
4. Now go back to the chart and format the x-axis
by right-clicking (or CTRL-1). Change the
Interval between tick marks from 1 to 10. You’ll
also need to select the Specify interval unit
option in the Interval between labels menu, and
Excel should fill in the 1 for you. Format chart as
desired.
Marimekko 235
Final Version with Styling
Marimekko 236
Data Visualization Books
If you wish to learn more about data visualization, there exists a large Cole Nussbaumer Knaflic. Knaflic’s Storytelling with Data (she has a
and growing set of books that will help you dive deeper into best blog of the same name) is a great introductory treatment to data
practices and strategies to effectively create and present your data. visualization, and how to pair text with graphs to lead your reader or
More books, blogs, and other resources can be found at user to a conclusion.
PolicyViz.com.
Naomi Robbins. A succinct guide to creating effective graphs,
Alberto Cairo. Cairo is a journalism professor, so his books primarily Robbins’ Creating More Effective Graphs gives you the basic
focus on data visualizations geared towards a wide audience. His first knowledge and techniques required to choose and create appropriate
two books on data visualization, The Functional Art and The Truthful graphs for a broad range of applications.
Art, cover fundamental overviews of data, some statistics, and data
Jonathan Schwabish. Designed for presenters of scholarly or data-
visualization.
intensive content, Better Presentations: A Guide for Scholars,
Jorge Camões. All of the visuals in Data at Work are built in Excel Researchers, and Wonks details essential strategies for developing
(though it is not a step-by-step guide) and covers covers a wide range clear, sophisticated, and visually captivating presentations.
of data visualization principles and strategies.
Edward Tufte. Author of four books, Tufte’s books are sometimes
Stephen Few. Few’s Show Me the Numbers and Now You See It: Simple viewed as classics in the field of data visualization. His The Visual
Visualization Techniques for Quantitative Analysis demonstrate how Display of Quantitative Information is especially relevant to
to present data effectively and strategically. introductory data visualization with different examples and
techniques.
Andy Kirk. Kirk’s Data Visualisation: A Handbook for Data Driven
Design is one of the few books that offers a system to conceptualize Dona Wong. Wong dedicates individual pages in her book, The Wall
and develop data visualizations. Street Journal Guide to Information Graphics, to specific graph types,
and how and why to choose the best chart to fit the data.