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 or in this case stacked areas) to achieve this effect. Read on to learn how.

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. Download the annotated workbook HorizontalBandWorksheet.xlsx if you want to follow along in an existing workbook.
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.

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

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 that has either XY, Column, or Line type.

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.

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.

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

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.

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.

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.

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

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

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

Add a secondary horizontal axis to the chart.

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

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.

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

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

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

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.

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

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.

Here are the corresponding charts without (top row) and with (bottom row) formatting the plot area to shade above and below the 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.

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

Related Posts:
- Excel Chart With Irregular Horizontal Bands
- Order of Legend Entries in Excel Charts
- US Employment Slump Chart – How To
- Easy Two-Panel Column Chart in Excel
- Easy Two-Panel Line Chart in Excel
- Stacked Area Chart Challenge
Posted: Monday, September 19th, 2011 under Formatting.
Comments: 14
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 :/
Comment from Ron Keen
Time: Thursday, April 26, 2012, 2:27 pm
Wow, has anybody actually tried this?
I’ve spent 3 hours meticulously following these instructions, and it doesn’t work. I am using Excel 2010 … Did Microsoft just make this impossible to do with 2010?
Comment from Jon Peltier
Time: Friday, April 27, 2012, 8:10 am
Ron -
I wrote this tutorial using Excel 2007, and the protocol should be the same in 2010.
Where does your approach fail? Are you starting from scratch with a banded chart and adding your data, or are you adding bands to an existing chart? Does your value axis include negative and positive numbers?
Comment from Ron Keen
Time: Friday, April 27, 2012, 12:54 pm
Jon,
I have, in fact, followed your examples for both ways (start with banded data first, and start with existing chart). I have even started with your data and followed your instructions to try to come up with the charts that you do. No dice. I’ve also tried to apply the procedure to my data … no dice. I only have positive data, like your example.
I have also had tremendous difficulty with Excel 2010 screwing up the graph when changing from primary to secondary axis. It looks fine when everything is referenced to the primary axis, but as soon as I change it to a secondary axis, the values (bands) get placed on the graph in random order. I’m trying to do a red, yellow, and green band (good, caution, bad) for my bands. Once I change them, the order gets mixed up, and it’s always a different order. Some of your instructions are also set up significantly different than Excel 2003 (what I used to use), so some of your instructions don’t have a 1:1 mapping to Excel 2010. I have had to guess, and I may be guessing incorrectly, but I’ve tried to do the best I can with what MS has given.
Regards,
Ron
Comment from Jon Peltier
Time: Monday, April 30, 2012, 11:16 am
Ron -
I opened a new workbook in Excel 2010 and entered the data I used when writing this tutorial.
I created charts both ways: Starting with an XY, line, or column chart and adding bands, and starting with a chart with bands only, and adding XY, line, or column series.
I followed the steps as written, conscious not to add any steps or leave any steps out. The charts all ended up exactly as expected, that is, exactly as described in this article.
I’ve annotated and uploaded this new workbook, which you can download from HorizontalBandWorksheet.xlsx.
If you want, send your workbook to me at jon-at-peltiertech-dot-com. I’ll work it through for you.






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.