Peltier Tech Blog

Excel Chart Add-Ins | Training | Charts and Tutorials | Peltier Tech Blog

 

Main menu:

Peltier Tech Chart Utilities for Excel Peltier Tech Panel Chart Utility Peltier Tech Waterfall Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

 
Excel Dashboards
 

 
Amazon Books
 

Subscribe

Site search

Subscribe

Site search


Recent Posts

Popular Posts

Categories


 

Privacy Policy

Creative Commons License
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Excel Charts With Horizontal Bands

 
by Jon Peltier
Monday, September 19th, 2011
Peltier Technical Services, Inc., Copyright © 2012.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

You may want to highlight certain ranges of values in a chart, to make it easier to judge the values in the chart. For example, you may want to highlight “good” values with green or blue, and “bad” values with red. Or you may want to highlight the standard deviation bands in a control chart. This banding is not a native feature of Excel, but you can use standard chart elements (i.e., stacked columns) to achieve this effect. Read on to learn how.

Chart With Horizontal Bands

This technique works with XY (Scatter), Column, and Line charts, and all of the chart triptychs in this tutorial show these chart types in that left to right order.

Original Charts and Data

This screenshot shows the data used in this exercise. Column A has the X values for the XY (Scatter) charts, column B has the X labels for the Column and Line charts, and column C has the Y values for all charts. Column E lists the values at the tops of the bands, from the bottom up, starting with the top of the blank area below the lowest band. Column F has a label for these bands, which I’ve simply filled with the intended colors of the bands. Columns G and H have the same values, G2:H2 containing the lowest value from F2 (=F2), and the rest of the cells containing the band heights (e.g., =F3-F2). These heights will be used to populate the values of stacked area charts, which will serve as our bands.

Chart With Horizontal Bands - Data

Here are the XY (Scatter), Column, and Line charts of our original data.

Original Chart Without Bands

You can start with a chart containing your original data, and add the bands, or you can follow a somewhat easier approach which starts from scratch, building a banded chart, then adding the original data. I’ll start the tutorial with the second approach. Skip ahead to Adding Bands to Existing Chart if you are not starting from scratch.

Starting From Scratch

Select the data for the bands (the shaded range F1:H8) and create a stacked area chart (not stacked 100% area), with series data in rows. The charts all look the same for a few steps, until we actually have a series thathas either XY, Column, or Line type.

Chart With Horizontal Bands - In Progress

This is as good a time as any to apply your fill colors to the bands. It is best to use light shades, so the bands do not overwhelm the original data.

Chart With Horizontal Bands - In Progress

Copy the original data, select your chart, and use paste special to add the data as a new series. It is added as another stacked area series.

Chart With Horizontal Bands - In Progress

Change the added series to the desired chart type (XY Scatter, Column, or Line). Now the charts assume their unique appearances.

Chart With Horizontal Bands - In Progress

Format the new series and assign it to the secondary axis. This was already done in the first chart when the added series was converted to XY type.

Chart With Horizontal Bands - In Progress

Add a secondary horizontal axis to the chart. This was also done in the first chart when the added series was converted to XY type.

Chart With Horizontal Bands - In Progress

The rest of the protocol is the same as for the case where you start with your original chart and add the bands. Skip the next section, and follow the instructions in Finishing the Chart below.

Adding Bands to Existing Chart

Copy the range with the band data (F1:H8 in our example), select the chart, and use Paste Special to add the data as new series, with data in rows.

Chart With Horizontal Bands - In Progress

One by one, change the chart type of the added series to stacked column (not stacked 100% column). This is the step that is so tedious, you’ll wish you had started from scratch (the above protocol).

Chart With Horizontal Bands - In Progress

Apply your fill colors to the bands. It is best to use light shades, so the bands do not overwhelm the original data.

Chart With Horizontal Bands - In Progress

Format the original series, and assign it to the secondary axis.

Chart With Horizontal Bands - In Progress

Add a secondary horizontal axis to the chart.

Chart With Horizontal Bands - In Progress

Finishing the Chart

Format the primary (bottom) horizontal axis so the crossing axis is positioned on tick marks.

Chart With Horizontal Bands - In Progress

The next four steps switch the axes left and right, top and bottom.

Format the primary (left) vertical axis so the crossing axis crosses at the maximum value.

Chart With Horizontal Bands - In Progress

Format the secondary (right) vertical axis so the crossing axis crosses at the automatic position.

Chart With Horizontal Bands - In Progress

Format the primary (top) horizontal axis so the crossing axis crosses at the maximum category.

Chart With Horizontal Bands - In Progress

Format the secondary (bottom) horizontal axis so the crossing axis crosses at the automatic position.

Chart With Horizontal Bands - In Progress

Hide the primary (top) horizontal axis by formatting it so it has no line, no axis ticks, and no tick mark labels. Select the primary (right) vertical axis and press Delete.

Chart With Horizontal Bands - In Progress

You were either done in that last step, or you can add a fill color outside (above and below) the bands by formatting hte plot area with the desired fill color.

Chart With Horizontal Bands - Finished

Negative Data and Charts

What makes this technique more flexible than that in my original tutorial is that stacked areas can span the horizontal axis without the strange behavior of stacked column charts. To illustrate, here is the same data as above, offset so it spans the horizontal axis.

Chart With Horizontal Bands - Negative Data

Here are the corresponding charts without (top row) and with (bottom row) formatting the plot area to shade above and below the bands.

Chart With Negative Horizontal Bands

Arbitrary Data and Charts

In the examples above, the bands are uniform in width, and each band touches the bands on either side without gaps. This isn’t necessary, of course. The bands can be any width, and there can be gaps between adjacent bands (the gaps being transparent bands). The worksheet below has the same original data as above, but the bands have arbitrary top and bottom values, and there are a couple gaps.

Chart With Horizontal Bands - Arbitrary Data

The chart doesn’t care what the band values are or how we format them.

Chart With Arbitrary Horizontal Bands

Related Posts:

Learn how to create Excel dashboards.

Comments


Comment from Joe Mako
Time: Monday, September 19, 2011, 10:33 am

Jon, Thank you for another great tutorial.

For fun, I remade this in Tableau as well :)
http://public.tableausoftware.com/views/databands/Dashboard
Thankfully, Tableau provides a reference band feature that can be based on a formula.


Comment from veekay
Time: Thursday, November 3, 2011, 5:20 am

Hi Jon,

You have a great website, thanks for all the knowledge you have shared over the years.

I am trying to create a vertical-banded glidepath chart, with each “color band” being a date range (within a quarter) comprising one “wave”, and one or more performance metrics (e.g, Customer Satisfaction, Revenue) being the series plotted as line curves across these “waves”.

If you can add an example of doing something like that to this page, it would be really useful, as charting the performance metrics over a period is a common requirement for many people.


Comment from Jon Peltier
Time: Thursday, November 3, 2011, 8:30 am

Veekay -

Is this what you want?
Highlight Certain Time Periods in a Chart


Comment from veekay
Time: Wednesday, November 9, 2011, 4:25 am

Jon, that was close to what I was looking for, and it is a good insight too.

If the time periods on an axis are asymmetrical, color-shading them vertically using a MOD formula on the date might not be the answer.

I had also understood from another of your articles that the series for the background color bars can be coded as percentages of the width of the chart. This worked for me and I was able to build the chart exactly the way I needed.

Thanks a lot for all your wonderful advice!


Comment from Bill Christian
Time: Tuesday, December 13, 2011, 4:52 pm

I am completely new to Excel and not very computer savy. I have made a list of my movies in alphabetical order in column A and the actors in column B. I want to add a horizontal line separating each movie and a vertical down the center separating A from B. The program has these lines but they do not print.
Can anyone help me?
Thank You and Merry Christmas to all.


Comment from Jon Peltier
Time: Tuesday, December 13, 2011, 8:46 pm

Bill -

Not sure what you’re looking for. Formatting in the worksheet?


Comment from Bob
Time: Sunday, January 1, 2012, 9:18 pm

I have set up a spreadsheet in which I can specify a date range within a long time series and the graph will automatically adjust horizontally and vertically to display the data. This means the vertical axis is set for automatic, so max and min values depend on the data range selected. When I add color bars per your method, I can’t see any way to sync the max and min of the display values of the color bars to those of the data. I can work around by always reformatting the color bar vertical axis whenever the data max/min changes, but that gets pretty tedious.

Any ideas on how to fix?

Thanks!


Comment from Yevhen
Time: Friday, January 13, 2012, 6:16 am

Jon,
thank you for a great tutorial.

I am interested if you could suggest how I can add horizontal bands in case my chart is already using both axis – primary & secondary. I tried but not successfuly.

Thanks in advance.


Comment from Jon Peltier
Time: Friday, January 13, 2012, 3:22 pm

Yevhen -

You’ll have to figure out which set of axes you can put the bands on, and modify the protocol accordingly.

Is this a case where the data would be better in two charts (or in a panel chart) than on two axes? This is true of 99% of the dual axis charts you’ll ever encounter.


Comment from Yevhen
Time: Monday, January 16, 2012, 6:38 am

Jon,
thank you for feedback.

I think about actions I have to do with the chart and it’s clear, more likely i’ve missed some step previously, i’ll try the actions once again.

Unfortunately, I am not the owner of this report, so I am not authorized to divide two axes in two charts :/

Write a comment

I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.

If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.

Read the PTS Blog Comment Policy.





Subscribe without commenting

Peltier Tech Chart Utilities for Excel Peltier Tech Waterfall Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Panel Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

Create Excel dashboards quickly with Plug-N-Play reports.