<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peltier Tech Blog &#187; Formatting</title>
	<atom:link href="http://peltiertech.com/WordPress/category/formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Wed, 16 May 2012 17:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Conditional Formatting of Excel Charts</title>
		<link>http://peltiertech.com/WordPress/conditional-formatting-of-excel-charts/</link>
		<comments>http://peltiertech.com/WordPress/conditional-formatting-of-excel-charts/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 08:00:20 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>
		<category><![CDATA[conditional chart]]></category>
		<category><![CDATA[conditional format]]></category>
		<category><![CDATA[conditional formatting]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3367</guid>
		<description><![CDATA[It&#8217;s relatively easy to apply conditional formatting in an Excel worksheet. It&#8217;s a built-in feature on the Home tab of the Excel ribbon, and there many resources on the web to get help (see for example what Debra Dalgleish and Chip Pearson have to say). Conditional formatting of charts is a different story. People often ask how to conditionally [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s relatively easy to apply conditional formatting in an Excel worksheet. It&#8217;s a built-in feature on the Home tab of the Excel ribbon, and there many resources on the web to get help (see for example what <a href="http://www.contextures.com/tiptech.html#ConditionalFormatting" rel="nofollow" class="vt-p" >Debra Dalgleish</a> and <a href="http://cpearson.com/excel/cformatting.htm" rel="nofollow" class="vt-p" >Chip Pearson</a> have to say). Conditional formatting of charts is a different story.</p>
<p>People often ask how to conditionally format a chart, that is, how to change the formatting of a chart&#8217;s plotted points (markers, bar fill color, etc.) based on the values of the points. This can be done using VBA to change the individual chart elements (for example, <a href="http://peltiertech.com/WordPress/vba-conditional-formatting-of-charts-by-value/"class="vt-p" title="VBA Conditional Formatting of Charts by Value" >VBA Conditional Formatting of Charts by Value</a>), but the code must be run whenever the data changes to maintain the formatting. The following technique works very well without resorting to macros, with the added advantage that you don&#8217;t have to muck about in VBA.</p>
<h2>Unformatted Charts</h2>
<p>Here is the simple data for our conditional chart formatting example.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondData1.png" alt="Data for Conditional Chart Formatting Example" /></p>
<p>The data makes a simple unformatted bar chart. . .</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtBar0.png" alt="Unformatted Bar Chart" /></p>
<p>. . . or a simple unformatted line chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtLine0.png" alt="Unformatted Line Chart" /></p>
<p><span id="more-3367"></span>We want our charts to show different colored points depending on the points&#8217; values.</p>
<p>Except for some simple built-in formats, conditional formatting of worksheet ranges requires formulas to determine which cells should take on the formatting. In the same way, we will use formulas to define the formatting of series in the charts.</p>
<p>We will replace the original plotted data in the line and bar charts with several series, one for each set of conditions of interest. Our data ranges from 0 to 10, and we will create series for each of the ranges 0-2, 2-4, 4-6, 6-8, and 8-10.</p>
<h2>Conditional Formatted Bar Chart</h2>
<p>The data for the conditionally formatted bar chart is shown below. The formatting limits are inserted into rows 1 and 2. The header formula in cell C3, which is copied into D3:G3, is</p>
<pre><code>=C1&amp;"&lt;Y&lt;="&amp;C2</code></pre>
<p>The formula is cell C4 is</p>
<pre class="vbasmall"><code>=IF(AND(C$1&lt;$B4,$B4&lt;=C$2),$B4,"")</code></pre>
<p>The formula shows the value in column B if it falls between the limits in rows 1 and 2; otherwise it shows an apparent blank. The formula is filled into the range C4:G13.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataBar0.png" alt="Calculated Data for Conditional Bar Chart Formatting" /></p>
<p>When the bar chart is selected, the chart&#8217;s source data is highlighted as shown.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataBar1.png" alt="Unformatted Bar Chart Source Data" /></p>
<p>We need to change the source data, removing column B and adding columns C:G. This is easily done by dragging and resizing the colored highlights.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataBar2.png" alt="Formatted Bar Chart Source Data" /></p>
<p>The chart now shows five sets of colored bars, one for each data range of interest. It&#8217;s not quite right, though, since it&#8217;s a clustered bar chart, and each visible bar is clustered with four blank values.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtBar1.png" alt="Partially Formatted Bar Chart" /></p>
<p>This is easily corrected by formatting any one of the bars, and changing the Overlap property to 100%. This makes the visible bars overlap with the blank bars.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtBar2.png" alt="Conditionally Formatted Bar Chart" /></p>
<h2>Conditionally Formatted Line Chart</h2>
<p>The data for the conditionally formatted bar chart is shown below. The formatting limits are inserted into rows 1 and 2. The header formula in cell C3, which is copied into D3:G3, is</p>
<pre><code>=C1&amp;"&lt;Y&lt;="&amp;C2</code></pre>
<p>The formula is cell C4 is</p>
<pre><code>=IF(AND(C$1&lt;$B4,$B4&lt;=C$2),$B4,NA())</code></pre>
<p>The formula shows the value in column B if it falls between the limits in rows 1 and 2; otherwise it shows an error, #N/A, which will not be plotted in a line chart. The formula is filled into the range C4:G13.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataLine0.png" alt="Calculated Data for Conditional Line Chart Formatting" /></p>
<p>When the line chart is selected, the chart&#8217;s source data is highlighted as shown.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataLine1.png" alt="Unformatted Line Chart Source Data" /></p>
<p>We need to expand the source data, keeping column B as a line connecting all points and adding columns C:G for the separately formatted series. This is easily done by resizing the colored highlights.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondDataLine2.png" alt="Formatted Line Chart Source Data" /></p>
<p>The chart now shows five sets of colored markers and line segments, one for each data range of interest.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtLine1.png" alt="Partially Formatted Line Chart" /></p>
<p>A little formatting cleans it up. Remove the markers from the original series, remove the lines from the other series, and apply distinct marker formats to the added series.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtLine2.png" alt="Partially Formatted Line Chart" /></p>
<p>Remove the unneeded legend entry (for the gray line) by clicking once to select the legend, clicking again to select the label, and clicking Delete.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/CondChtLine3.png" alt="Conditionally Formatted Line Chart" /></p>
<h2>Conditional Formatting Flexibility</h2>
<p>This simple example has formatting formulas defined based on the Y values in the chart. It is possible to define formatting based on Y values, X values, or values in another column which is not even plotted. As in worksheet conditional formatting, the only limit is your own ability to construct formulas.</p>
<p>This technique works on most useful Excel chart types, including bar and line charts shown here, and XY charts as shown in <a href="http://peltiertech.com/WordPress/conditional-xy-charts-without-vba/"class="vt-p" title="Conditional XY Charts Without VBA" >Conditional XY Charts Without VBA</a>.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/conditional-formatting-of-excel-charts/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Excel Charts With Horizontal Bands</title>
		<link>http://peltiertech.com/WordPress/excel-charts-with-horizontal-bands/</link>
		<comments>http://peltiertech.com/WordPress/excel-charts-with-horizontal-bands/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 09:00:52 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>
		<category><![CDATA[colored bands]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3336</guid>
		<description><![CDATA[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. [...]]]></description>
			<content:encoded><![CDATA[<p>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 (<em>i.e.</em>, stacked columns or in this case stacked areas) to achieve this effect. Read on to learn how.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Finished.png" alt="Chart With Horizontal Bands" /></p>
<p>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 <a href="http://peltiertech.com/images/2012-04/HorizontalBandWorksheet.xlsx" rel="nofollow" class="vt-p" title="Annotated workbook with horizontal band example worked out." >HorizontalBandWorksheet.xlsx</a> if you want to follow along in an existing workbook.</p>
<h2>Original Charts and Data</h2>
<p>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&#8217;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.</p>
<p><span id="more-3336"></span><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Data.png" alt="Chart With Horizontal Bands - Data" /></p>
<p>Here are the XY (Scatter), Column, and Line charts of our original data.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Original.png" alt="Original Chart Without Bands" /></p>
<p>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&#8217;ll start the tutorial with the second approach. Skip ahead to <a href="#addingbands" rel="nofollow" class="vt-p" title="Adding Bands to Existing CHart" >Adding Bands to Existing Chart</a> if you are not starting from scratch.</p>
<h2>Starting From Scratch</h2>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A01.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A02.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A03.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Change the added series to the desired chart type (XY Scatter, Column, or Line). Now the charts assume their unique appearances.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A04.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A05.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_A06.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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 <a href="#finishing" rel="nofollow" class="vt-p" title="Finishing the Chart" >Finishing the Chart</a> below.</p>
<p><a class="vt-p" name="addingbands"></a></p>
<h2>Adding Bands to Existing Chart</h2>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_B01.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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&#8217;ll wish you had started from scratch (the above protocol).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_B02.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Apply your fill colors to the bands. It is best to use light shades, so the bands do not overwhelm the original data.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_B03.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Format the original series, and assign it to the secondary axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_B04.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Add a secondary horizontal axis to the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_B05.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p><a class="vt-p" name="finishing"></a></p>
<h2>Finishing the Chart</h2>
<p>Format the primary (bottom) horizontal axis so the crossing axis is positioned on tick marks.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C01.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>The next four steps switch the axes left and right, top and bottom.</p>
<p>Format the primary (left) vertical axis so the crossing axis crosses at the maximum value.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C02.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Format the secondary (right) vertical axis so the crossing axis crosses at the automatic position.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C03.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Format the primary (top) horizontal axis so the crossing axis crosses at the maximum category.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C04.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>Format the secondary (bottom) horizontal axis so the crossing axis crosses at the automatic position.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C05.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_C06.png" alt="Chart With Horizontal Bands - In Progress" /></p>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Finished.png" alt="Chart With Horizontal Bands - Finished" /></p>
<h2>Negative Data and Charts</h2>
<p>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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_DataNegative.png" alt="Chart With Horizontal Bands - Negative Data" /></p>
<p>Here are the corresponding charts without (top row) and with (bottom row) formatting the plot area to shade above and below the bands.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Negative.png" alt="Chart With Negative Horizontal Bands" /></p>
<h2>Arbitrary Data and Charts</h2>
<p>In the examples above, the bands are uniform in width, and each band touches the bands on either side without gaps. This isn&#8217;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.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_DataArbitrary.png" alt="Chart With Horizontal Bands - Arbitrary Data" /></p>
<p>The chart doesn&#8217;t care what the band values are or how we format them.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/HBand_Arbitrary.png" alt="Chart With Arbitrary Horizontal Bands" />
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/excel-charts-with-horizontal-bands/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Excel Chart With Irregular Horizontal Bands</title>
		<link>http://peltiertech.com/WordPress/excel-chart-with-irregular-horizontal-bands/</link>
		<comments>http://peltiertech.com/WordPress/excel-chart-with-irregular-horizontal-bands/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 15:10:14 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3314</guid>
		<description><![CDATA[I built an interesting example of the Excel Chart With Horizontal Bands this morning. A user on Excel Forum wanted a way to present soil analysis data, where the typical values for each element tested were very different, and the cutoffs between different ranges of results (i.e., low, medium, high) were not only different, but [...]]]></description>
			<content:encoded><![CDATA[<p>I built an interesting example of the <a href="http://peltiertech.com/WordPress/excel-chart-with-horizontal-bands/"title="Excel Chart With Horizontal Bands" >Excel Chart With Horizontal Bands</a> this morning. A user on <a href="http://www.excelforum.com/newreply.php?do=postreply&amp;t=784332" rel="nofollow" title="Excel Forum - Graph Help" >Excel Forum</a> wanted a way to present soil analysis data, where the typical values for each element tested were very different, and the cutoffs between different ranges of results (i.e., low, medium, high) were not only different, but also not proportional. A single set of bands wouldn&#8217;t work, but we can used stacked columns to generate staggered bands.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart5.png" alt="Excel chart with irregular horizontal bands" /></p>
<p>Two blocks of data are shown below. In the range A1:G6, I&#8217;ve entered results and qualitative values for five elements in the soil sample. I made up some of the ranges in the table, and I&#8217;ve already adjusted the maximum values in column G so that the &#8220;Good&#8221; range is roughly aligned across the chart.</p>
<p><span id="more-3314"></span>I skipped a few rows, and put normalized values into A10:G15. I normalized by dividing by the value in the High column, and I also adjusted the values in Low through High so they show the normalized width of each step. This makes the sum of the values from Very Low to High equal to 1, and relates the new results value to a fraction of the High value.</p>
<p>While I was at it, I combined the element name and result, so the result will appear in the chart labels.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_data.png" alt="Sample results and qualitative value ranges" /></p>
<p>The formulas in the first row of this normalized table, which are filled down through all rows of the table, are:</p>
<p style="padding-left: 60px;">A11: <tt class="tt">=A2&amp;" ("&amp;TEXT(B2,"0.00")&amp;")"<br />
</tt>B11: <tt class="tt">=B2/$G2<br />
</tt>C11: <tt class="tt">=C2/$G2<br />
</tt>D11: <tt class="tt">=(D2-C2)/$G2<br />
</tt>E11: <tt class="tt">=(E2-D2)/$G2<br />
</tt>F11: <tt class="tt">=(F2-E2)/$G2<br />
</tt>G11: <tt class="tt">=(G2-F2)/$G2</tt></p>
<p>Once you enter the formula in D11, you can fill it into E11:G11.</p>
<p>Now the fun begins. Select this normalized data range and create a stacked column chart. In Excel 2003 and earlier, in step 2 of the Chart Wizard, select the Series in Columns option. In Excel 2007 and later, you just have to let Excel make the chart wrong, then on the Chart Tools &gt; Design tab, click Switch Rows and Columns.</p>
<p>This produces the chart below. I&#8217;ve already color coded the Very Low through High series to have light fills that will indicate these ranges in the final chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart1.png" alt="Excel chart with irregular horizontal bands - Step 1" /></p>
<p>The next thing is to format the Result series, moving it to the secondary axis, as shown below.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart2.png" alt="Excel chart with irregular horizontal bands - Step 2" /></p>
<p>Now delete the secondary vertical axis on the right of the chart, so all data uses the primary axis. At the same time, change the scale of the primary vertical axis so its maximum is 1.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart3.png" alt="Excel chart with irregular horizontal bands - Step 3" /></p>
<p>Format the primary vertical axis to hide it and its labels (i.e., no line, no axis ticks, no axis tick labels in the dialog).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart4.png" alt="Excel chart with irregular horizontal bands - Step 4" /></p>
<p>Finally, Format one of the Very Low to High series (it doesn&#8217;t matter which one because they will all follow), reducing its gap width to zero.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-07/ExcelForum_784332_chart5.png" alt="Excel chart with irregular horizontal bands - Finished" />
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/excel-chart-with-irregular-horizontal-bands/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Text Labels on a Vertical Column Chart in Excel</title>
		<link>http://peltiertech.com/WordPress/text-labels-on-vertical-axis-in-excel-column-chart/</link>
		<comments>http://peltiertech.com/WordPress/text-labels-on-vertical-axis-in-excel-column-chart/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 07:00:47 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Axis Labels]]></category>
		<category><![CDATA[Combination Charts]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3248</guid>
		<description><![CDATA[When analyzing survey results, for example, there may be a numerical scale that has associated text labels. This may be a scale of 1 to 5 where 1 means &#8220;Completely Dissatisfied&#8221; and 5 means &#8220;Completely Satisfied&#8221;, with other labels in between. The data can be plotted by value, but it&#8217;s not obvious how to place [...]]]></description>
			<content:encoded><![CDATA[<p>When analyzing survey results, for example, there may be a numerical scale that has associated text labels. This may be a scale of 1 to 5 where 1 means &#8220;Completely Dissatisfied&#8221; and 5 means &#8220;Completely Satisfied&#8221;, with other labels in between. The data can be plotted by value, but it&#8217;s not obvious how to place the text labels on the chart in place of the numerical labels on the vertical axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col08.png" alt="Text Labels on a Vertical Column Chart" /></p>
<p>There are several ways to accomplish this task. In this tutorial I&#8217;ll show how to use a combination bar-column chart, in which the columns show the survey results and the bars provide the text labels for the horizontal axis. The steps are essentially the same in Excel 2007 and in Excel 2003. I&#8217;ll show the charts from Excel 2007, and the different dialogs for both where applicable.</p>
<p><span id="more-3248"></span>Let&#8217;s assume the following dummy survey results.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/SurveyColData.png" alt="Data for column chart" /></p>
<p>Plot the responses for each question (the first two columns of the data) in a clustered column chart, and use the Error column as <a href="http://peltiertech.com/WordPress/custom-error-bars-in-excel-charts/"title="Custom Error Bars in Excel Charts" >custom error bar values</a>.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col01.png" alt="Col Chart (Step 1)" /></p>
<p>So far so good. Note that I&#8217;ve violated the first rule of column chart value axis scales, which is that <strong>The Axis Scale Must Include Zero</strong>. However, the minimum possible score here is 1, and we&#8217;ll be using text labels. In our chart, fixing the scale at 1 to 5 makes sense.</p>
<p>Here is the data for the text labels. Rating 1 may stand for &#8220;Totally Lame&#8221; and Rating 5 for &#8220;Totally Awesome&#8221;. I chose the Dummy values of 2 just so the data would show up in the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/SurveyLabels.png" alt="Data for text labels" /></p>
<p>Copy this table above, select the chart, and use Paste Special to add the data to the chart using the settings below (the Excel 2007 dialog is very much like this Excel 2003 dialog).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/ChartPasteSpecial.png" alt="Chart Paste Special Dialog" /></p>
<p>We now have two sets of columns in the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col02.png" alt="Col Chart (Step 2)" /></p>
<p>Right click on the new series, choose &#8220;Change Chart Type&#8221; (&#8220;Chart Type&#8221; in 2003), and select the clustered bar style.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col03.png" alt="Bar Chart (Step 3)" /></p>
<p>There are no Rating labels because there  is no secondary vertical axis, so we have to add this axis by hand. On the Excel 2007 Chart Tools &gt; Layout tab, click Axes, then Secondary Horizontal Axis, then Show Left to Right Axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/ChartLayoutAxesCol2007.png" alt="Chart Tools - Layout Tab - Axes - Excel 2007" /></p>
<p>In Excel 2003 go to the Chart menu, choose Chart Options, and check the Category (X) Axis checkmark.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/ChartOptionsAxesCol2003.png" alt="Chart Options - Axes - Excel 2003" /></p>
<p>Now the chart has four axes.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col04.png" alt="Col Chart (Step 4)" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">We want the Rating labels at the left side of the chart, and we&#8217;ll place the numerical axis at the right before we hide it. In turn, select the bottom and top vertical axes.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">In the Excel 2007 Format Axis dialog, the bottom axis will be set so the vertical axis crosses at the automatic setting, and the top axis so the vertical axis crosses at the maximum category. Switch the settings of the top and bottom axes.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/AxisCrossesAtCol2007.png" alt="Format Axis Dialog - Axis Crosses At - Excel 2007" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">In the Excel 2003 Format Axis dialog, the maximum category checkbox checked for the top axis and unchecked for the bottom axis. Change the setting for the top and bottom axes.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/AxisCrossesAt2003.png" alt="Format Axis Dialog - Axis Crosses At - Excel 2003" /></p>
<p>Now we have the axes where we want them.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col05.png" alt="Col Chart (Step 5)" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">Hide the dummy series by setting its fill color to no fill.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col06.png" alt="Col Chart (Step 6)" /></p>
<p>Hide the top and right axes by selecting &#8220;None&#8221; for axis tick marks and tick labels, and &#8220;No Line&#8221; for the axis line itself.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col07.png" alt="Col Chart (Step 7)" /></p>
<p>In Excel 2007 (not in Excel 2003) the Rating labels may have been squished. Select the plot area, and drag its left edge inwards to make room for the labels.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col07a.png" alt="Col Chart (Step 7a)" /></p>
<p>The Rating labels are still not properly aligned, but this is easy to fix.</p>
<p>Format the vertical axis, and change the Position Axis setting of the horizontal axis from &#8220;Between Tick Marks&#8221; to &#8220;On Tick Marks&#8221;.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/PositionAxisCol2007.png" alt="Format Axis Dialog - Position Axis - Excel 2007" /></p>
<p>In the Excel 2003 Format Axis dialog, uncheck the &#8220;Value Axis Crosses Between Categories&#8221; checkbox.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/PositionAxis2003.png" alt="Format Axis Dialog - Position Axis - Excel 2003" /></p>
<p>Finally we have our chart with text labels along the survey response (vertical) axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col08.png" alt="Column Chart with Value Axis Text Labels" /></p>
<p>See <a href="http://peltiertech.com/WordPress/text-labels-on-horizontal-axis-in-excel-bar-chart"title="Text Labels on a Horizontal Bar Chart in Excel" >Text Labels on a Horizontal Bar Chart in Excel</a> to see how to get the text labels onto the horizontal axis of a bar chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar08.png" alt="Text Labels on a Horizontal Bar Chart" /></p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/text-labels-on-vertical-axis-in-excel-column-chart/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Text Labels on a Horizontal Bar Chart in Excel</title>
		<link>http://peltiertech.com/WordPress/text-labels-on-horizontal-axis-in-excel-bar-chart/</link>
		<comments>http://peltiertech.com/WordPress/text-labels-on-horizontal-axis-in-excel-bar-chart/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 07:00:27 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Axis Labels]]></category>
		<category><![CDATA[Combination Charts]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3247</guid>
		<description><![CDATA[When analyzing survey results, for example, there may be a numerical scale that has associated text labels. This may be a scale of 1 to 5 where 1 means &#8220;Completely Dissatisfied&#8221; and 5 means &#8220;Completely Satisfied&#8221;, with other labels in between. The data can be plotted by value, but it&#8217;s not obvious how to place [...]]]></description>
			<content:encoded><![CDATA[<p>When analyzing survey results, for example, there may be a numerical scale that has associated text labels. This may be a scale of 1 to 5 where 1 means &#8220;Completely Dissatisfied&#8221; and 5 means &#8220;Completely Satisfied&#8221;, with other labels in between. The data can be plotted by value, but it&#8217;s not obvious how to place the text labels on the chart in place of the numerical labels on the horizontal axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar08.png" alt="Text Labels on a Horizontal Bar Chart" /></p>
<p>There are several ways to accomplish this task. In this tutorial I&#8217;ll show how to use a combination bar-column chart, in which the bars show the survey results and the columns provide the text labels for the horizontal axis. The steps are essentially the same in Excel 2007 and in Excel 2003. I&#8217;ll show the charts from Excel 2007, and the different dialogs for both where applicable.</p>
<p><span id="more-3247"></span>Let&#8217;s assume the following dummy survey results. I&#8217;ve sorted the list in reverse order to work around the phenomenon described in <a href="http://peltiertech.com/WordPress/bar-chart-categories-backwards/"title="Why Are My Excel Bar Chart Categories Backwards?" >Why Are My Excel Bar Chart Categories Backwards?</a></p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/SurveyBarData.png" alt="Data for bar chart" /></p>
<p>Plot the responses for each question (the first two columns of the data) in a clustered bar chart, and use the Error column as <a href="http://peltiertech.com/WordPress/custom-error-bars-in-excel-charts/"title="Custom Error Bars in Excel Charts" >custom error bar values</a>.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar01.png" alt="Bar Chart (Step 1)" /></p>
<p>So far so good, except that the end cap of the Question 3 upper error bar is apparently hidden by the plot area border (it appears properly in 2003). Note that I&#8217;ve violated the first rule of bar chart value axis scales, which is that <strong>The Axis Scale Must Include Zero</strong>. However, the minimum possible score here is 1, and we&#8217;ll be using text labels. In our chart, fixing the scale at 1 to 5 makes sense.</p>
<p>Here is the data for the text labels. Rating 1 may stand for &#8220;Totally Lame&#8221; and Rating 5 for &#8220;Totally Awesome&#8221;. I chose the Dummy values of 2 just so the data would show up in the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/SurveyLabels.png" alt="Data for text labels" /></p>
<p>Copy this table above, select the chart, and use Paste Special to add the data to the chart using the settings below (the Excel 2007 dialog is very much like this Excel 2003 dialog).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/ChartPasteSpecial.png" alt="Chart Paste Special Dialog" /></p>
<p>We now have two sets of bars in the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar02.png" alt="Bar Chart (Step 2)" /></p>
<p>Right click on the new series, choose &#8220;Change Chart Type&#8221; (&#8220;Chart Type&#8221; in 2003), and select the clustered column style.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar03.png" alt="Bar Chart (Step 3)" /></p>
<p>In Excel 2003 the chart has a Ratings labels at the top of the chart, because it has secondary horizontal axis. Excel 2007 has no Ratings labels or secondary horizontal axis, so we have to add the axis by hand. On the Excel 2007 Chart Tools &gt; Layout tab, click Axes, then Secondary Horizontal Axis, then Show Left to Right Axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/ChartLayoutAxesBar2007.png" alt="Chart Tools - Layout Tab - Axes - Excel 2007" /></p>
<p>Now the chart has four axes.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar04.png" alt="Bar Chart (Step 4)" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">We want the Rating labels at the bottom of the chart, and we&#8217;ll place the numerical axis at the top before we hide it. In turn, select the left and right vertical axes.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">In the Excel 2007 Format Axis dialog, the left axis will be set so the horizontal axis crosses at the automatic setting, and the right axis so the horizontal axis crosses at the maximum category. Switch the settings of the left and right axes.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/AxisCrossesAtBar2007.png" alt="Format Axis Dialog - Axis Crosses At - Excel 2007" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">In the Excel 2003 Format Axis dialog, the maximum category checkbox checked for the right axis and unchecked for the left axis. Change the setting for each vertical axis.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/AxisCrossesAt2003.png" alt="Format Axis Dialog - Axis Crosses At - Excel 2003" /></p>
<p>Now we have the axes where we want them.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar05.png" alt="Bar Chart (Step 5)" /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;">Hide the dummy series by setting its fill color to no fill.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar06.png" alt="Bar Chart (Step 6)" /></p>
<p>Hide the top and right axes by selecting &#8220;None&#8221; for axis tick marks and tick labels, and &#8220;No Line&#8221; for the axis line itself.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar07.png" alt="Bar Chart (Step 7)" /></p>
<p>The Rating labels are not properly aligned, but this is easy to fix.</p>
<p>Format the horizontal axis, and in Excel 2007 change the Position Axis setting of the vertical axis from &#8220;Between Tick Marks&#8221; to &#8220;On Tick Marks&#8221;.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/PositionAxisBar2007.png" alt="Format Axis Dialog - Position Axis - Excel 2007" /></p>
<p>In the Excel 2003 Format Axis dialog, uncheck the &#8220;Value Axis Crosses Between Categories&#8221; checkbox.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/PositionAxis2003.png" alt="Format Axis Dialog - Position Axis - Excel 2003" /></p>
<p>Finally we have our chart with text labels along the survey response (horizontal) axis.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Bar08.png" alt="Bar Chart with Value Axis Text Labels" /></p>
<p>I noted before that the error bar cap is not obscured in Excel 2003, and here&#8217;s proof.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2003Bar08.png" alt="Bar Chart with Value Axis Text Labels" /></p>
<p>See <a href="http://peltiertech.com/WordPress/text-labels-on-vertical-axis-in-excel-column-chart"title="Text Labels on a Vertical Column Chart in Excel" >Text Labels on a Vertical Column Chart in Excel</a> to see how to get the text labels onto the vertical axis of a column chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/TextLabel2007Col08.png" alt="Text Labels on a Vertical Column Chart" /></p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/text-labels-on-horizontal-axis-in-excel-bar-chart/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Invert if Negative in Excel 2007</title>
		<link>http://peltiertech.com/WordPress/invert-if-negative-excel-2007/</link>
		<comments>http://peltiertech.com/WordPress/invert-if-negative-excel-2007/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 07:00:29 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Excel 2007]]></category>
		<category><![CDATA[invert if negative]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3242</guid>
		<description><![CDATA[In Invert Excel Chart Format if Negative I showed the technique that allows you to select which colors for positive and negative points in a column or bar chart. This technique works in Excel versions up to and including Excel 2003, but doesn&#8217;t work in Excel 2007. Up until now I thought you couldn&#8217;t get [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://peltiertech.com/Excel/ChartsHowTo/InvertIfNegative.html" rel="nofollow" title="Invert Excel Chart Format if Negative" >Invert Excel Chart Format if Negative</a> I showed the technique that allows you to select which colors for positive and negative points in a column or bar chart. This technique works in Excel versions up to and including Excel 2003, but doesn&#8217;t work in Excel 2007. Up until now I thought you couldn&#8217;t get two colors of your own choosing in Excel 2007 unless you used two series, or colored each point manually or programmatically based on its value.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invert04.png" alt="Column Chart with Invert if Negative Setting" /></p>
<p>Well, I was wrong. Invert if Negative can be used with any two arbitrary colors in Excel 2007. You just need to know the trick.</p>
<p><span id="more-3242"></span>In my <a href="http://peltiertech.com/WordPress/area-chart-invert-if-negative/"title="Area Chart – Invert if Negative" >Area Chart – Invert if Negative</a> post, I went through a convoluted protocol to color an area chart differently for positive and negative areas. In a comment under that post, alert reader <strong>Vincent</strong> wrote the following, speaking of column and bar charts:</p>
<blockquote><p>I have been looking for an option in Excel 2007 to do the invert if negative option just like I did in 2003. On every website it states that it cannot be done unless you use two series. I couldn’t.</p>
<p>Then I found this:<br />
 <a href="http://www.hichert.com/de/community/foren?func=view&amp;catid=6&amp;id=150"rel="nofollow" >http://www.hichert.com/de/community/foren?func=view&amp;catid=6&amp;id=150</a></p>
<p>It works! And I like to share this with all of you looking for this solution!</p>
</blockquote>
<p>The protocol uses Excel 2007&#8242;s gradient fill formatting of the bars, with an unusual and nonintuitive gradient definition. This tutorial is a reworking of the technique described by <a href="http://http://www.istudio.si/" rel="nofollow" >Andrej Lapajne</a> in the citation above.</p>
<h2>The Chart</h2>
<p>Let&#8217;s start with a simple column chart using arbitrary positive and negative values. Never mind for this exercise the category labels located in the negative bars.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invert01.png" alt="Column Chart without Invert if Negative Setting" /></p>
<h2>Invert if Negative in Excel 2007 Dialog</h2>
<p>We can invoke Invert if Negative using the checkbox in the Fill panel of the Format Data Series dialog in Excel 2007.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invertdlg01.png" alt="Excel 2007 Dialog Showing Invert if Negative Setting" /></p>
<p>What we get is the same as the initial Invert if Negative chart in Excel 2003: the positive bars stay the same, the negative bars are filled with white. Excel 2007 adds the border, otherwise the bars would not be visible. The technique that adds a second color in Excel 2003 fails in Excel 2007.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invert02.png" alt="Column Chart with Invert if Negative Setting" /></p>
<h2>Gradient Fill Formats</h2>
<p>In general, applying a gradient fill pattern in a chart adds that special kind of chart junk that attracts attention while obscuring the data. However, this technique requires the gradient feature, though by the end there will be no gradient, just two colors of bars.</p>
<p>Let&#8217;s make a simple gradient, defined by two &#8220;stops&#8221;, that is, the colors at the two endpoints. Select the Gradient Fill option, then set Stop 1 at position 0% to show the first color, green for positive.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invertdlg02.png" alt="Excel 2007 Dialog Showing Simple Gradient Step 1" /></p>
<p>Set Stop 2 at position 100% with the second color, red for negative.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invertdlg03.png" alt="Excel 2007 Dialog Showing Simple Gradient Step 2" /></p>
<p>What we get is the default gradient, changing gradually from green to red. Invert if Negative has been checked, so the positive and negative bars show the gradient in opposite directions.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invert03.png" alt="Column Chart with Simple Gradient and Invert if Negative Setting" /></p>
<h2>The Magical Gradient</h2>
<p>I have to admit that I do not understand why this magical gradient works. If I did, I probably wouldn&#8217;t call it magical. Mr. Lapajne is either a genius or a madman, or perhaps he swiped the gradient from another genius or madman like I&#8217;ve swiped it from him. In any case, the gradient requires four stops, described below:</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invertgradient.png" alt="Gradient Settings for Invert if Negative" /></p>
<p>Where do the 1% and 99% stops come from? I don&#8217;t know, and it must have taken a madman or someone with finely honed obsessive-compulsive disorder to have determined them. For &#8220;fun&#8221;, I experimented with a wide variety of similar and different settings, and I would never have found the correct ones, even by accident.</p>
<p>The result is just what we hoped for, green bars for positive values, red for negative values.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2010-12/invert04.png" alt="Column Chart with Funky Gradient and Invert if Negative Setting" /></p>
<h2>Why Haven&#8217;t I Been Writing?</h2>
<p>Good question. I&#8217;ve been busy and distracted.</p>
<p>Last week I had the honor of addressing the 5th annual <a href="http://www.kluwerfinancieelmanagement.nl/excelexperienceday/" rel="nofollow" title="Excel Experience Day" >Excel Experience Day</a>, sponsored by Dutch publishing and information services provider <a href="http://home.kluwer.nl/kluwer/portal_klnl/over_kluwer" rel="nofollow" title="Kluwer" >Kluwer</a>. In the morning I spoke about making effective visualizations in Excel, dispensing with the usual tedious &#8220;Do this &#8211; Don&#8217;t do that&#8221; approach in favor of a discussion of human visual and cognitive systems. Knowing a bit about these systems makes it easier to understand the rules for effective visual presentations. In the afternoon I led a couple plenary sessions that dealt more specifically with what to do in Excel, following on my earlier discussion of human cognition, and getting into the rules. The day after Excel Experience Day was <strong>Excel Experts Day</strong>, where I split a day of hands-on training with my colleague and fellow Microsoft Excel MVP <a href="http://www.jkp-ads.com/" rel="nofollow" title="Jan Karel Pieterse - Application Development Services" >Jan Karel Pieterse</a>, who has graced the Excel world with such useful, in fact, indispensable utilities as the <a href="http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.asp" rel="nofollow" title="Name Manage Utility" >Name Manager</a> and <a href="http://www.jkp-ads.com/downloadscript.asp?filename=autosafe.zip" rel="nofollow" title="AutoSafe Utility" >AutoSafe</a>. I had nothing but positive experiences in Holland and in all of my interactions with the Dutch people, despite having only a working knowledge of English and no ability to speak Dutch.</p>
<p>Over the past few months I have not spent my customary hour a day on my blog. It dawned on me recently that this hour has been spent practicing guitar, which I&#8217;m still not very good at, but which is still a lot of fun. I&#8217;m going to have to find another hour somewhere so I can do both. I&#8217;d sacrifice an hour of sleep, but already I&#8217;m not getting enough of that.</p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/invert-if-negative-excel-2007/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

