<?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; Pivot Tables</title>
	<atom:link href="http://peltiertech.com/WordPress/category/pivot-tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Tue, 31 Aug 2010 07:00:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Referencing Pivot Table Ranges in VBA</title>
		<link>http://peltiertech.com/WordPress/referencing-pivot-table-ranges-in-vba/</link>
		<comments>http://peltiertech.com/WordPress/referencing-pivot-table-ranges-in-vba/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 06:00:30 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2310</guid>
		<description><![CDATA[I&#8217;ve posted several examples of manipulating pivot tables with VBA, for example, Dynamic Chart using Pivot Table and VBA and Update Regular Chart when Pivot Table Updates. These examples included specific procedures, and the emphasis was on the results of the manipulation.
I thought it would be helpful to show some of the mechanics of programming [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve posted several examples of manipulating pivot tables with VBA, for example, <a href="http://peltiertech.com/WordPress/dynamic-chart-using-pivot-table-and-vba/"title="Dynamic Chart using Pivot Table and VBA | PTS Blog" >Dynamic Chart using Pivot Table and VBA</a> and <a href="http://peltiertech.com/WordPress/update-regular-chart-when-pivot-table-updates/"title="Update Regular Chart when Pivot Table Updates | PTS Blog" >Update Regular Chart when Pivot Table Updates</a>. These examples included specific procedures, and the emphasis was on the results of the manipulation.</p>
<p>I thought it would be helpful to show some of the mechanics of programming with pivot tables. One important part of this is referencing the various ranges within a pivot table by their special VBA range names (which are actually properties of the Pivot Table object).</p>
<p>I&#8217;ll illustrate these special ranges using this simple pivot table, which comes from an example formerly available on the Microsoft web site (I can no longer locate it).</p>
<p align="center"><img src="/images/2009-08/PivotTable.png" alt="Pivot Table" /></p>
<p><span id="more-2310"></span>In VBA, you can reference a pivot table using this code in a procedure:</p>
<p><tt class="tt">Dim pt As PivotTable<br />
 Set pt = ActiveSheet.PivotTables(1)</tt></p>
<p>I&#8217;ve highlighted the various ranges using the indicated VBA commands.</p>
<p><strong><em>TableRange1</em></strong></p>
<p><tt class="tt">pt.TableRange1.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTTableRange1.png" alt="Pivot Table - Table Range 1" /></p>
<p><strong><em>TableRange2</em></strong></p>
<p><tt class="tt">pt.TableRange2.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTTableRange2.png" alt="Pivot Table - Table Range 2" /></p>
<p><strong><em>RowRange</em></strong></p>
<p><tt class="tt">pt.RowRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTRowRange.png" alt="Pivot Table - Row Range" /></p>
<p><strong><em>ColumnRange</em></strong></p>
<p><tt class="tt">pt.ColumnRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTColumnRange.png" alt="Pivot Table - Column Range" /></p>
<p><strong><em>DataLabelRange</em></strong></p>
<p><tt class="tt">pt.DataLabelRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTDataLabelRange.png" alt="Pivot Table - Data Label Range" /></p>
<p><strong><em>DataBodyRange</em></strong></p>
<p><tt class="tt">pt.DataBodyRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTDataBodyRange.png" alt="Pivot Table - Data Body Range" /></p>
<p><strong><em>PageRange</em></strong></p>
<p><tt class="tt">pt.PageRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPageRange.png" alt="Pivot Table - Page Range" /></p>
<p><strong><em>Pivot Field LabelRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").LabelRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsLabelRange.png" alt="Pivot Table - Pivot Field Label Range" /></p>
<p><strong><em>PivotField DataRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").DataRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsDataRange.png" alt="Pivot Table - Pivot Field Data Range" /></p>
<p><strong><em>Pivot Item LabelRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").PivotItems("2004").LabelRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsPI2004LabelRange.png" alt="Pivot Table - Pivot Item Label Range" /></p>
<p><strong><em>Pivot Item DataRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").PivotItems("2004").DataRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsPI2004DataRange.png" alt="Pivot Table - Pivot Item Data Range" /></p>
<p><tt class="tt">pt.PivotFields("Order Date").PivotItems("Feb").DataRange.Select</tt></p>
<p align="center"><img src="/images/2009-08//PTPFdatePIfebDataRange.png" alt="" /></p>
<p><strong><em>Pivot Field LabelRange</em></strong></p>
<p>The next few examples show the same ranges as above, after pivoting the table&#8217;s Years field from the columns area to the rows area.</p>
<p><tt class="tt">pt.PivotFields("Years").LabelRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsDataRangeA.png" alt="Pivot Table - Pivot Field Data Range" /></p>
<p><strong><em>Pivot Item LabelRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").PivotItems("2004").LabelRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsPI2004LabelRangeA.png" alt="Pivot Table - Pivot Item Label Range" /></p>
<p><strong><em>Pivot Item DataRange</em></strong></p>
<p><tt class="tt">pt.PivotFields("Years").PivotItems("2004").DataRange.Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyearsPI2004DataRangeA.png" alt="Pivot Table - Pivot Field Data Range" /></p>
<p><strong><em>Complex Range</em></strong></p>
<p>If a particular range isn&#8217;t specifically defined with a VBA property, you can use VBA range-extending properties <tt class="tt">EntireColumn</tt> and <tt class="tt">EntireRow</tt> and range operators <tt class="tt">Union</tt> and <tt class="tt">Intersect</tt> to define the range. For example:</p>
<p><tt class="tt">Intersect(pt.PivotFields("Years").Pivotitems("2004").DataRange.EntireRow, pt.PivotFields("Order Date").DataRange).Select</tt></p>
<p align="center"><img src="/images/2009-08/PTPFyrsPI2003entirerowINTPForderdatedatarange.png" alt="Pivot Table - Complex Data Range" /></p>
<p>Peltier Technical Services, Inc., Copyright © 2010.<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=2474005" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/pnp468_01.jpg" ALT="Create Excel dashboards quickly with Plug-N-Play reports." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=2474005" width="0" height="0" border="0"></p>



Bookmark and share this entry:


	<a rel="nofollow"  href="http://twitter.com/home?status=Referencing%20Pivot%20Table%20Ranges%20in%20VBA%20-%20http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F" title="Twitter"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;bodytext=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul" title="Digg"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;t=Referencing%20Pivot%20Table%20Ranges%20in%20VBA" title="Facebook"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;source=Peltier+Tech+Blog+Peltier+Tech+Excel+Charts+and+Programming+Blog&amp;summary=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul" title="LinkedIn"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;notes=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul" title="del.icio.us"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F" title="Technorati"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA" title="StumbleUpon"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;annotation=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul" title="Google Bookmarks"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA" title="Reddit"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;t=Referencing%20Pivot%20Table%20Ranges%20in%20VBA" title="MySpace"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F" title="Slashdot"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;submitHeadline=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;submitSummary=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Freferencing-pivot-table-ranges-in-vba%2F&amp;t=Referencing%20Pivot%20Table%20Ranges%20in%20VBA&amp;s=I%27ve%20posted%20several%20examples%20of%20manipulating%20pivot%20tables%20with%20VBA%2C%20for%20example%2C%20Dynamic%20Chart%20using%20Pivot%20Table%20and%20VBA%20and%20Update%20Regular%20Chart%20when%20Pivot%20Table%20Updates.%20These%20examples%20included%20specific%20procedures%2C%20and%20the%20emphasis%20was%20on%20the%20resul" title="Tumblr"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/referencing-pivot-table-ranges-in-vba/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
		<item>
		<title>Explore Your Data With Pivot Tables</title>
		<link>http://peltiertech.com/WordPress/explore-your-data-with-pivot-tables/</link>
		<comments>http://peltiertech.com/WordPress/explore-your-data-with-pivot-tables/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 11:00:16 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Pivot Tables]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=896</guid>
		<description><![CDATA[Pivot tables are one of Excel&#8217;s most outstanding features. They allow fast dynamic and interactive analysis of data from the workbook or from any number of external sources. Pivot charts go hand in hand with pivot tables in showing the data visually. I am not a staunch fan of pivot charts: they allow only a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Pivot tables</strong> are one of Excel&#8217;s most outstanding features. They allow fast dynamic and interactive analysis of data from the workbook or from any number of external sources. Pivot charts go hand in hand with pivot tables in showing the data visually. I am not a staunch fan of pivot charts: they allow only a limited selection of chart types, and their formatting possibilities are not as extensive as those of regular charts. however, for a quick look into a new data set, they are hard to beat. Later when I know what I want to show, I make custom regular charts, with data often derived from pivot tables.</p>
<p>In <a href="http://chandoo.org/wp/2008/09/18/excel-charting-problem-how-to-show-market-share-in-2-different-periods/" rel="nofollow" title="Visualization Challenge - How to show market share changes?" >Visualization Challenge &#8211; How to show market share changes?</a> our colleague <strong>Chandoo</strong> presented the following data and challenged his readers to display it meaningfully. The data shows market share for two brands and five competing retailers, at two times. The challenge was to show the trends over time. I took on this challenge in <a href="http://peltiertech.com/WordPress/2008/11/10/challenge-show-market-share-changes/"title="Challenge - Show Market Share Changes" >Challenge &#8211; Show Market Share Changes</a>. While working on this challenge, I realized that the data made for a good example of the power of pivot tables for fast and detailed analysis.<span id="more-896"></span></p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">Pivot Table Data</h2>
<p>I&#8217;ve rearranged Chandoo&#8217;s sample data into the form required for an effective pivot table. There are no blank rows or columns, the first row has headers (field names), and there is one row (record) per observation.</p>
<p><img title="Pivot Table Data" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_data.png" alt="Pivot Table Data" /></p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">Pivot Tables and Charts</h2>
<p>To create a pivot table, select all of the data or a single cell within the data (Excel will try to use the contiguous range surrounding the selected cell), and from the Data menu or the Insert tab in 2007, choose Pivot Table. To include a pivot chart, you can choose the appropriate option in the dialogs, or you can select the pivot table and insert a chart, or (and this can be dangerous) you can select an existing chart, edit the source data, click in the Data Range entry box, and click in the pivot table. This last operation is dangerous, because it converts the chart into a pivot chart, and pivot charts cannot be reverted to regular charts. Of course, it is possible to create <a href="http://peltiertech.com/WordPress/2008/06/13/regular-charts-from-pivot-tables/"title="Regular Charts from Pivot Tables" >Regular Charts from Pivot Tables</a>.</p>
<p>The pivot chart is joined to the pivot table at the hip. Any changes to the pivot table are reflected in the pivot chart, and vice versa. For clarity, I have hidden the pivot buttons from these pivot charts. They are redundant since the pivot table and chart are so close together, and they consume valuable chart real estate.</p>
<p>This first arrangement shows each competitor as a different color series. This is fine, but there is too much spacial separation between the two times to allow a good assessment of the trends.</p>
<p><img title="Pivot Table - Time and Brand vs. Comp" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_timebrand_comp.png" alt="Pivot Table - Time and Brand vs. Comp" /></p>
<p>This is easy to fix with a pivot table. You can click and drag the gray field buttons around to change the arrangement instantly. So I dragged the time field inside the product field. The times are closer, but the trends are still not so easy to discern.</p>
<p><img title="Pivot Table - Brand and Time vs. Comp" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_brandtime_comp.png" alt="Pivot Table - Brand and Time vs. Comp" /></p>
<p>Okay, maybe the competitors shouldn&#8217;t rank their own series. I dragged the competitor field down to the rows area and the product field up to the columns area. Hmm, the times are again too far apart.</p>
<p><img title="Pivot Table - Time and Comp vs. Brand" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_timecomp_brand.png" alt="Pivot Table - Time and Comp vs. Brand" /></p>
<p>Click, drag. Okay, the times are pretty close now, but the comparison between brands is given more emphasis.</p>
<p><img title="Pivot Table - Comp and Time vs. Brand" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_comptime_brand.png" alt="Pivot Table - Comp and Time vs. Brand" /></p>
<p>So if we swap the time and product fields, we put the data for the two corresponding time periods next to each other. This view compares the competitors for each brand&#8230;</p>
<p><img title="Pivot Table - Brand and Comp vs. Time" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_brandcomp_time.png" alt="Pivot Table - Brand and Comp vs. Time" /></p>
<p>&#8230; while this view compares the two brands for each competitor.</p>
<p><img title="Pivot Table - Comp and Brand vs. Time" src="http://peltiertech.com/WordPress/wp-content/img200811/pt_col_compbrand_time.png" alt="Pivot Table - Comp and Brand vs. Time" /></p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">The Ultimate Chart</h2>
<p>This analysis gave me just enough insight to know how I should build the chart I answered Chandoo&#8217;s challenge with. It was not a pivot chart, nor was it based directly on a pivot table, but it utilized the insights from the analysis above. I created a panel chart with each competitor in its own vertical panel, and with lines connecting the data.</p>
<p><img title="compound panel chart" src="http://peltiertech.com/WordPress/wp-content/img200811/compoundpanel.png" alt="compound panel chart" /></p>
<p>I&#8217;ll show the particular data arrangement and protocol I used to create this chart in an upcoming post. Stay tuned.</p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">More About Pivot Tables</h2>
<p>For more about pivot tables, check out these web pages, mostly from my site:</p>
<ul style="margin-left: 24px;">
<li><a href="http://peltiertech.com/Excel/Pivots/pivotstart.htm" rel="nofollow" >Pivot Tables and Pivot Charts</a> <em>(on the PTS web site)</em><br />
 Originally contributed by fellow Excel MVP Debra Dalgleish. <br />
 Check out Debra’s <a href="http://www.contextures.com/tiptech.html" rel="nofollow"  target="_blank">Excel Tips page</a> and <a href="http://www.contextures.com/xlfaqPivot.html" rel="nofollow" >Pivot Table and Pivot Chart FAQs</a>.<br />
 &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivottables.htm" rel="nofollow" >Introduction to Pivot Tables in Excel</a><br />
 &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotcharts.htm" rel="nofollow" >Working with Pivot Charts in Excel</a><br />
 &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotvba.htm" rel="nofollow" >Pivot Table Programming</a><br />
 &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotlinks.htm" rel="nofollow" >Pivot Table and Pivot Chart Links</a></li>
<li><a href="http://peltiertech.com/WordPress/category/pivot-tables/"title="Pivot Tables" >Pivot Tables</a> <em>(related posts on this blog)</em></li>
<li><a href="http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=553" rel="nofollow" >Pivot Tables, Pivot Charts, and Real Charts</a> <em>(TechTrax Article)</em></li>
<li><a href="http://peltiertech.com/Excel/xlbooks.html#PTAnalysis" rel="nofollow" >Books on Excel Pivot Tables</a><br />
 &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=1590596293%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Excel-Pivot-Tables-Recipe-Book/dp/1590596293%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|1590596293" >Excel Pivot Tables Recipe Book: A Problem-Solution Approach</a> by Debra Dalgleish<br />
 &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=1590598903%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Beginning-PivotTables-Excel-2007-Professional/dp/1590598903%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|1590598903" >Beginning PivotTables in Excel 2007: From Novice to Professional</a> by Debra Dalgleish<br />
 &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=0789736012%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Crunching-Microsoft-Office-Business-Solutions/dp/0789736012%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|0789736012" >Pivot Table Data Crunching for Microsoft Office Excel 2007</a> by Bill Jelen and Michael Alexander</li>
</ul>
<p style="text-align: center;"><a href="http://www.amazon.com/gp/product/1590598903?ie=UTF8&amp;tag=peltiertechni-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598903" rel="nofollow" title="Debra Dalgleish - Beginning PivotTables in Excel 2007" ><img src="https://images-na.ssl-images-amazon.com/images/I/51rdoQwD2mL._SL160_.jpg" border="0" alt="" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=peltiertechni-20&amp;l=as2&amp;o=1&amp;a=1590598903" border="0" alt="" width="1" height="1" /> <a href="http://www.amazon.com/gp/product/1590599209?ie=UTF8&amp;tag=peltiertechni-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590599209" rel="nofollow" title="Debra Dalgleish - Excel 2007 PivotTables Recipes" ><img src="https://images-na.ssl-images-amazon.com/images/I/51BM1q1td6L._SL160_.jpg" border="0" alt="" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=peltiertechni-20&amp;l=as2&amp;o=1&amp;a=1590599209" border="0" alt="" width="1" height="1" /> <a href="http://www.amazon.com/gp/product/0789736012?ie=UTF8&amp;tag=peltiertechni-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0789736012" rel="nofollow" title="Bill Jelen and Mike Alexander - Pivot Table Data Crunching for Microsoft Office Excel 2007" ><img src="https://images-na.ssl-images-amazon.com/images/I/41HrW-SLOcL._SL160_.jpg" border="0" alt="" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=peltiertechni-20&amp;l=as2&amp;o=1&amp;a=0789736012" border="0" alt="" width="1" height="1" /></p>



Bookmark and share this entry:


	<a rel="nofollow"  href="http://twitter.com/home?status=Explore%20Your%20Data%20With%20Pivot%20Tables%20-%20http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F" title="Twitter"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;bodytext=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually." title="Digg"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;t=Explore%20Your%20Data%20With%20Pivot%20Tables" title="Facebook"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;source=Peltier+Tech+Blog+Peltier+Tech+Excel+Charts+and+Programming+Blog&amp;summary=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually." title="LinkedIn"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;notes=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually." title="del.icio.us"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F" title="Technorati"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables" title="StumbleUpon"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;annotation=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually." title="Google Bookmarks"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;title=Explore%20Your%20Data%20With%20Pivot%20Tables" title="Reddit"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;t=Explore%20Your%20Data%20With%20Pivot%20Tables" title="MySpace"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F" title="Slashdot"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;submitHeadline=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;submitSummary=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually.&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fexplore-your-data-with-pivot-tables%2F&amp;t=Explore%20Your%20Data%20With%20Pivot%20Tables&amp;s=Pivot%20tables%20are%20one%20of%20Excel%27s%20most%20outstanding%20features.%20They%20allow%20fast%20dynamic%20and%20interactive%20analysis%20of%20data%20from%20the%20workbook%20or%20from%20any%20number%20of%20external%20sources.%20Pivot%20charts%20go%20hand%20in%20hand%20with%20pivot%20tables%20in%20showing%20the%20data%20visually." title="Tumblr"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/explore-your-data-with-pivot-tables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Regular Charts from Pivot Tables</title>
		<link>http://peltiertech.com/WordPress/regular-charts-from-pivot-tables/</link>
		<comments>http://peltiertech.com/WordPress/regular-charts-from-pivot-tables/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 10:30:49 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[pivot chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=115</guid>
		<description><![CDATA[Sometimes it&#8217;s desirable to make a regular chart from a pivot table, but Excel makes it difficult. If your active cell is in a pivot table, inserting a chart automatically inserts a pivot chart. Defining a source data range that intersects a pivot table automatically converts the chart into a pivot table. And once a [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s desirable to make a regular chart from a pivot table, but Excel makes it difficult. If your active cell is in a pivot table, inserting a chart automatically inserts a pivot chart. Defining a source data range that intersects a pivot table automatically converts the chart into a pivot table. And once a chart becomes a pivot chart, it cannot be converted back into a regular chart.</p>
<p>In a moment I&#8217;ll show how to make a regular chart from a pivot table&#8217;s data. But first let&#8217;s review some of the strengths and weaknesses of pivot charts.</p>
<p>Pivot charts have some advantages over regular charts:</p>
<ul>
<li>Pivot charts are dynamic</li>
<li>Pivot charts are interactive</li>
<li>Pivot charts can be pivoted</li>
</ul>
<p><span id="more-115"></span>However, the same infrastructure that conveys these advantages also results in some shortcomings:</p>
<ul>
<li>Some chart types (XY) are not available to pivot charts</li>
<li>The date scale axis is not available in pivot charts</li>
<li>All data from the pivot table must be included in the pivot chart</li>
<li>Data from outside the pivot table cannot be included in the pivot chart</li>
<li>Pivot chart formatting options are limited</li>
<li>Pivot chart formatting may be lost when the pivot table is changed</li>
</ul>
<p>Microsoft hosts a number of decent Pivot Table examples. I will use one of them for this tutorial. Go to the Microsoft example <a href="http://office.microsoft.com/en-gb/excel/HA010346331033.aspx" rel="nofollow" >25 easy PivotTable reports</a>, which has a link to <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5E720455-FD3F-47BB-96BF-94819AA214C4&amp;displaylang=en" rel="nofollow" >Excel 2002 Sample: PivotTable Reports</a>. From this page you can download a self-extracting executable named <tt class="tt">Reports.exe</tt>, which contains four workbooks. The top few records of the <tt class="tt">Source Data</tt> worksheet of the <tt class="tt">SampleSalespersonReports.xls</tt> workbook looks like this:</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_sourcedata.png" alt="Pivot Table Source Data" /></p>
<p>To create a pivot table, select one cell within this data range, and choose <tt class="tt">Pivot Table and Pivot Chart Report</tt> from the Data menu. To keep things uncomplicated, place the pivot table onto a new worksheet. Drag the <tt class="tt">Order Date</tt> field to the rows area, the <tt class="tt">Country</tt> field to the Columns area, and the <tt class="tt">Order Amount</tt> field to the Data area. Group the <tt class="tt">Order Date</tt> field by month and year as described in <a href="http://peltiertech.com/WordPress/2008/06/11/grouping-by-date-in-a-pivot-table/">Grouping by Date in a Pivot Table</a>. The resulting pivot table looks like this:</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_bydatecountry.png" alt="Pivot Chart by Date and by Country" /></p>
<p>To make a pivot chart, select any part of the pivot table and insert a chart. In Excel 2003 and earlier, by default the pivot table is created on its own chart sheet. I always move the pivot chart to the same worksheet as the pivot table, so I select a blank cell that isn&#8217;t touching the pivot table, and insert a chart without specifying any data. I then select the chart, invoke the Source Data command, and click in the pivot table, which instantly turns the chart into a pivot chart associated permanently with this pivot table.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PCht_bydatecountry.png" alt="Pivot Chart by Date and by Country" /></p>
<p>The pivot chart is linked to the pivot table, so any changes to the pivot table are reflected in the chart. In fact, the same dragging around of field buttons to pivot the table can also be accomplished in the chart, and the pivot table keeps up. A regular chart is not dynamic in this way. You could write VBA procedures that detect a pivot table change and adjust the chart&#8217;s series data accordingly, but that&#8217;s probably beyond the scope of any blog post.</p>
<p>However, a pivot chart doesn&#8217;t let you add data from outside the pivot table. You cannot change the size of the plot area or the position of the legend, chart title, or axis titles (other than deleting them). So you decide you want a regular chart.</p>
<p>Making a regular chart is actually easier than you think, as long as you are careful about setting the chart series data. You cannot set the overall source data range for the chart. You have to start with a blank chart, and add your data one series at a time.</p>
<p>Here is the protocol for creating a regular chart similar to the pivot chart above, using the pivot table&#8217;s data.</p>
<ol>
<li>Select a blank cell which is not touching the pivot table.</li>
<li>Insert a chart. In Excel 2003, select a chart type in step 1 of the Chart Wizard, and click Finish. In Excel 2007, simply select a chart type.</li>
<li>Right click the chart, choose Source Data or Select Data. In Excel 2003, click on the Series tab.</li>
<li>Click the Add button to add a new series.</li>
<li>Click in the Series Name box, and then select the cell with the series name (e.g., the country label UK).</li>
<li>Click in the Values, Y Values, or Series Values box, then select the range containing the Y values (the Order Amount data under the UK label(.</li>
<li>In Excel 2003, click in the Category (X) Axis Labels or X Values box, then select the range containing the category labels; In Excel 2007, click Edit under Horizontal (Category) Axis Labels, then select the range containing these labels. In both cases, this is the two-column range between the Years and Order Date field buttons at the top and the Grand Total label at the bottom.</li>
<li>Repeat steps 4 through 7 as required for all series, including data inside and outside the pivot table.</li>
</ol>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_bydatecountry.png" alt="Regular Chart by Date and by Country" /></p>
<p>If I have other data for a country not included in the pivot table, I can simply add it to a regular chart per the protocol above. A pivot chart allows no outside data.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_bydatecountry3.png" alt="Regular Chart by Date and by Country" /></p>
<p>If I want an XY chart, I can create a regular XY chart using the protocol above. A pivot chart cannot use the XY chart type, not can it use a date-scale axis in a line chart.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_XYcountries.png" alt="Regular XY Chart comparing Countries" /></p>



Bookmark and share this entry:


	<a rel="nofollow"  href="http://twitter.com/home?status=Regular%20Charts%20from%20Pivot%20Tables%20-%20http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F" title="Twitter"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables&amp;bodytext=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta" title="Digg"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;t=Regular%20Charts%20from%20Pivot%20Tables" title="Facebook"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables&amp;source=Peltier+Tech+Blog+Peltier+Tech+Excel+Charts+and+Programming+Blog&amp;summary=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta" title="LinkedIn"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables&amp;notes=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta" title="del.icio.us"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F" title="Technorati"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables" title="StumbleUpon"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables&amp;annotation=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta" title="Google Bookmarks"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;title=Regular%20Charts%20from%20Pivot%20Tables" title="Reddit"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;t=Regular%20Charts%20from%20Pivot%20Tables" title="MySpace"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=Regular%20Charts%20from%20Pivot%20Tables&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F" title="Slashdot"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;submitHeadline=Regular%20Charts%20from%20Pivot%20Tables&amp;submitSummary=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fregular-charts-from-pivot-tables%2F&amp;t=Regular%20Charts%20from%20Pivot%20Tables&amp;s=Sometimes%20it%27s%20desirable%20to%20make%20a%20regular%20chart%20from%20a%20pivot%20table%2C%20but%20Excel%20makes%20it%20difficult.%20If%20your%20active%20cell%20is%20in%20a%20pivot%20table%2C%20inserting%20a%20chart%20automatically%20inserts%20a%20pivot%20chart.%20Defining%20a%20source%20data%20range%20that%20intersects%20a%20pivot%20ta" title="Tumblr"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/regular-charts-from-pivot-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Grouping by Date in a Pivot Table</title>
		<link>http://peltiertech.com/WordPress/grouping-by-date-in-a-pivot-table/</link>
		<comments>http://peltiertech.com/WordPress/grouping-by-date-in-a-pivot-table/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 04:20:47 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[group data]]></category>
		<category><![CDATA[pivot chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=113</guid>
		<description><![CDATA[You can add flexibility to your data analysis by grouping variables. For example, you may have daily sales figures that fluctuate greatly in value, some days having no sales at all, some days with small values, and some with large values. A plot of this data is very noisy, and it&#8217;s hard to see any [...]]]></description>
			<content:encoded><![CDATA[<p>You can add flexibility to your data analysis by grouping variables. For example, you may have daily sales figures that fluctuate greatly in value, some days having no sales at all, some days with small values, and some with large values. A plot of this data is very noisy, and it&#8217;s hard to see any patterns.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_bydate.png" alt="Plot by Date" /></p>
<p>In a pivot table, you can group dates by various measures ranging from seconds to years, to get a clearer view of the data. Plotting by month will smooth out the noise of a daily plot.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_bydate_grp1.png" alt="Plot by Month" /></p>
<p>You can combine groupings, for example, to compare monthly sales by year.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/Cht_bydate_grp2.png" alt="Plot by Month by Year" /></p>
<p><span id="more-113"></span></p>
<blockquote><p>These plots are regular charts which use pivot table data as their source. This technique will be covered in a (near) future post. The charts below are the corresponding pivot charts.</p>
</blockquote>
<p>Microsoft hosts a number of decent Pivot Table examples. I will use one of them for this tutorial. Go to the Microsoft example <a href="http://office.microsoft.com/en-gb/excel/HA010346331033.aspx" rel="nofollow" >25 easy PivotTable reports</a>, which has a link to <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5E720455-FD3F-47BB-96BF-94819AA214C4&amp;displaylang=en" rel="nofollow" >Excel 2002 Sample: PivotTable Reports</a>. From this page you can download a self-extracting executable named <tt class="tt">Reports.exe</tt>, which contains four workbooks. The top few records of the <tt class="tt">Source Data</tt> worksheet of the <tt class="tt">SampleSalespersonReports.xls</tt> workbook looks like this:</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_sourcedata.png" alt="Pivot Table Source Data" /></p>
<p>To create a pivot table, select one cell within this data range, and choose <tt class="tt">Pivot Table and Pivot Chart Report</tt> from the Data menu. To keep things uncomplicated, place the pivot table onto a new worksheet. Drag the <tt class="tt">Order Date</tt> field to the rows area and the <tt class="tt">Order Amount</tt> field to the Data area. The top few rows of the pivot table looks like this:</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_bydate.png" alt="Pivot Table by Date" /></p>
<p>Click in this pivot table and click the chart wizard button. The resulting pivot chart looks like this when it is relocated to the worksheet:</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PCht_bydate.png" alt="Pivot Chart by Date" /></p>
<p>To group the dates, right click anywhere in the date field range, choose <tt class="tt">Group and Show Detail</tt>, then choose <tt class="tt">Group</tt>.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/GroupMenus.png" alt="Group Context Menus" /></p>
<p>To group by any time period, select that period in the dialog. To group by weeks, select <tt class="tt">Days</tt>, and change Number of Days to 7. To group by month, choose <tt class="tt">Months</tt>; note that this grouping will combine data for each month regardless of year. In this example, group by both <tt class="tt">Months</tt> and <tt class="tt">Years</tt>.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/GroupDialog.png" alt="Group Dialog" /></p>
<p>The Order Date column of the pivot table is split into a Years and a Months column.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_bydate_grp1.png" alt="Pivot Table by Month" /></p>
<p>With the new grouping of months and years, the pivot chart changes to plot months and years along the category axis.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PCht_bydate_grp1.png" alt="Pivot Chart by Month" /></p>
<p>Click on the Years field button, and drag it to the columns area, where the Total label is located. This splits the data into three yearly columns, each showing monthly totals for the respective year.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PT_bydate_grp2.png" alt="Pivot Table by Month and by Year" /></p>
<p>The pivot chart now shows one series of monthly sales for each year.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200806/PCht_bydate_grp2.png" alt="Pivot Chart by Month by Year" /></p>
<p>The dynamic nature of this pivot chart illustrates one of the benefits of pivot charts: the chart continues to display the data no matter how the table is pivoted. This makes pivot charts indispensable during the early stages of data exploration. The pivot chart&#8217;s relative inflexibility when it comes to formatting and handling of arbitrary (non-pivot-related) data, make pivot charts a liability during later stages of data presentation.</p>
<p>In an upcoming blog entry, I&#8217;ll describe how to create regular charts like those in the beginning of this article using data from a pivot table.</p>
<p>For more about pivot tables, check out these pages on my web site:</p>
<ul>
<li><a href="http://peltiertech.com/Excel/Pivots/pivotstart.htm" rel="nofollow" ><strong>Pivot Tables and Pivot Charts</strong></a><br />
 &nbsp; &nbsp; Contributed by fellow Excel MVP Debra Dalgleish. Check out Debra&#8217;s <a href="http://www.contextures.com/tiptech.html" rel="nofollow"  target="_blank">Excel Tips page</a><br />
 &nbsp; &nbsp; &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivottables.htm" rel="nofollow" >Introduction to Pivot Tables in Excel</a><br />
 &nbsp; &nbsp; &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotcharts.htm" rel="nofollow" >Working with Pivot Charts in Excel</a><br />
 &nbsp; &nbsp; &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotvba.htm" rel="nofollow" >Pivot Table Programming</a><br />
 &nbsp; &nbsp; &#8211; <a href="http://peltiertech.com/Excel/Pivots/pivotlinks.htm" rel="nofollow" >Pivot Table and Pivot Chart Links</a></li>
<li><a href="http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=553" rel="nofollow" >Pivot Tables, Pivot Charts, and Real Charts</a> <em>(TechTrax Article)</em></li>
<li><a href="http://peltiertech.com/Excel/xlbooks.html#PTAnalysis" rel="nofollow" >Books on Excel Pivot Tables</a><br />
 &nbsp; &nbsp; &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=1590596293%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Excel-Pivot-Tables-Recipe-Book/dp/1590596293%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|1590596293" >Excel Pivot Tables Recipe Book: A Problem-Solution Approach</a> by Debra Dalgleish<br />
 &nbsp; &nbsp; &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=1590598903%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Beginning-PivotTables-Excel-2007-Professional/dp/1590598903%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|1590598903" >Beginning PivotTables in Excel 2007: From Novice to Professional</a> by Debra Dalgleish<br />
 &nbsp; &nbsp; &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=0789734354%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Pivot-Table-Crunching-Business-Solutions/dp/0789734354%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|0789734354" >Pivot Table Data Crunching</a> by Bill Jelen and Michael Alexander<br />
 &nbsp; &nbsp; &#8211; <a href="http://www.amazon.com/gp/redirect.html%3FASIN=0789736012%26tag=peltiertechni-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/Crunching-Microsoft-Office-Business-Solutions/dp/0789736012%253FSubscriptionId=02E5W5871AJF7PMMMS82" rel="nofollow" name="evtst|a|0789736012" >Pivot Table Data Crunching for Microsoft Office Excel 2007</a> by Bill Jelen and Michael Alexander<br />
&nbsp;</li>
</ul>



Bookmark and share this entry:


	<a rel="nofollow"  href="http://twitter.com/home?status=Grouping%20by%20Date%20in%20a%20Pivot%20Table%20-%20http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F" title="Twitter"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;bodytext=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t" title="Digg"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;t=Grouping%20by%20Date%20in%20a%20Pivot%20Table" title="Facebook"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;source=Peltier+Tech+Blog+Peltier+Tech+Excel+Charts+and+Programming+Blog&amp;summary=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t" title="LinkedIn"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;notes=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t" title="del.icio.us"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F" title="Technorati"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table" title="StumbleUpon"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;annotation=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t" title="Google Bookmarks"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;title=Grouping%20by%20Date%20in%20a%20Pivot%20Table" title="Reddit"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;t=Grouping%20by%20Date%20in%20a%20Pivot%20Table" title="MySpace"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F" title="Slashdot"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;submitHeadline=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;submitSummary=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fgrouping-by-date-in-a-pivot-table%2F&amp;t=Grouping%20by%20Date%20in%20a%20Pivot%20Table&amp;s=You%20can%20add%20flexibility%20to%20your%20data%20analysis%20by%20grouping%20variables.%20For%20example%2C%20you%20may%20have%20daily%20sales%20figures%20that%20fluctuate%20greatly%20in%20value%2C%20some%20days%20having%20no%20sales%20at%20all%2C%20some%20days%20with%20small%20values%2C%20and%20some%20with%20large%20values.%20A%20plot%20of%20t" title="Tumblr"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/grouping-by-date-in-a-pivot-table/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Using Pivot Table Data for a Chart with a Dual Category Axis</title>
		<link>http://peltiertech.com/WordPress/using-pivot-table-data-for-a-chart-with-a-dual-category-axis/</link>
		<comments>http://peltiertech.com/WordPress/using-pivot-table-data-for-a-chart-with-a-dual-category-axis/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 15:53:42 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[pareto]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=60</guid>
		<description><![CDATA[Tony commented on the previous post, Chart with a Dual Category Axis, asking whether I&#8217;d use a pareto chart for this data. I commented that it almost was a pareto chart, since at least within each category the data is sorted from high to low. Then I got to thinking, if I put my data [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.supportanalytics.com/blog" rel="nofollow" >Tony</a> commented on the previous post, <a href="http://peltiertech.com/WordPress/chart-with-a-dual-category-axis/">Chart with a Dual Category Axis</a>, asking whether I&#8217;d use a pareto chart for this data. I commented that it almost was a pareto chart, since at least within each category the data is sorted from high to low. Then I got to thinking, if I put my data into a table, and use a pivot table to sort both the main category and sub category by number of defects, I would essentially have a pareto chart.</p>
<blockquote><p>A <a href="http://en.wikipedia.org/wiki/Pareto_chart" rel="nofollow" >pareto</a> <a href="http://www.spcforexcel.com/paretodiagram.htm" rel="nofollow" >chart</a> is a column or bar chart that lists items in decreasing order of their occurrence. A pareto chart may include a line chart series showing the cumulative occurrence of the items. The left-most items are most prevalent, so if your pareto chart shows instances of failure modes, you start fixing the left-most failure modes first.</p>
</blockquote>
<p><span id="more-60"></span>Here is my data table. The main category data from the first column is duplicated in the second for reasons which will become clear when you try to use the category in two places in the pivot table.</p>
<p>&nbsp;</p>
<table style="font-family: Arial, sans-serif; font-size=10pt;" border="1" cellspacing="0" cellpadding="2" align="center" bgcolor="#ffffff" bordercolor="#c0c0c0">
<tbody>
<tr>
<td width="28" align="center" bgcolor="#cccccc"></td>
<td width="128" align="center" bgcolor="#cccccc"><strong>A</strong></td>
<td width="96" align="center" bgcolor="#cccccc"><strong>B</strong></td>
<td width="128" align="center" bgcolor="#cccccc"><strong>C</strong></td>
<td width="64" align="center" bgcolor="#cccccc"><strong>D</strong></td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>1</strong></td>
<td align="left"><strong>Main Category</strong></td>
<td align="left"><strong>Category</strong></td>
<td align="left"><strong>Sub Category</strong></td>
<td align="left"><strong>Defects</strong></td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>2</strong></td>
<td align="left">Mechanical</td>
<td align="left">Mechanical</td>
<td align="left">Gear</td>
<td align="right">11</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>3</strong></td>
<td align="left">Mechanical</td>
<td align="left">Mechanical</td>
<td align="left">Bearing</td>
<td align="right">8</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>4</strong></td>
<td align="left">Mechanical</td>
<td align="left">Mechanical</td>
<td align="left">Motor</td>
<td align="right">3</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>5</strong></td>
<td align="left">Electrical</td>
<td align="left">Electrical</td>
<td align="left">Switch</td>
<td align="right">19</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>6</strong></td>
<td align="left">Electrical</td>
<td align="left">Electrical</td>
<td align="left">Plug</td>
<td align="right">12</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>7</strong></td>
<td align="left">Electrical</td>
<td align="left">Electrical</td>
<td align="left">Cord</td>
<td align="right">11</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>8</strong></td>
<td align="left">Electrical</td>
<td align="left">Electrical</td>
<td align="left">Fuse</td>
<td align="right">3</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>9</strong></td>
<td align="left">Electrical</td>
<td align="left">Electrical</td>
<td align="left">Bulb</td>
<td align="right">2</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>10</strong></td>
<td align="left">Hydraulic</td>
<td align="left">Hydraulic</td>
<td align="left">Pump</td>
<td align="right">4</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>11</strong></td>
<td align="left">Hydraulic</td>
<td align="left">Hydraulic</td>
<td align="left">Leak</td>
<td align="right">3</td>
</tr>
<tr>
<td align="center" bgcolor="#cccccc"><strong>12</strong></td>
<td align="left">Hydraulic</td>
<td align="left">Hydraulic</td>
<td align="left">Seals</td>
<td align="right">1</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Select the data and insert a pivot table. Put the Main Category and Sub Category fields into the rows area, the Category field into the columns area, and the Defects field (Sum of Defects) into the data area.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><img style="border: 0pt none;" src="http://peltiertech.com/WordPress/wp-content/img200804/PivotTableForDualCategoryAxis.png" alt="Pivot Table" width="419" height="222" /></p>
<p>This data arrangement looks very much like what I set up manually in the last post. Now you can either make a pivot chart from the data:</p>
<p style="text-align: center;"><img style="border: 0pt none;" src="http://peltiertech.com/WordPress/wp-content/img200804/PvtCht1DualCatColumn.png" alt="Dual Category Axis Pivot Chart" width="568" height="357" /></p>
<p>which is somewhat inflexible in its formatting. I personally would like to remove some of the white space all around the chart and delete the legend. You can clean it up somewhat by hiding the pivot chart field buttons:</p>
<p style="text-align: center;"><img style="border: 0pt none;" src="http://peltiertech.com/WordPress/wp-content/img200804/PvtCht2DualCatColumn.png" alt="Pivot Chart with Dual Category Axis" width="568" height="289" /></p>
<p>I still like to make a regular chart from my pivot data, as long as the pivot table isn&#8217;t going to change its shape too much. To do this, you have to select a blank cell distant from the pivot table when you insert the chart. Then you need to add each series individually and select its data, in Classic Excel either in step 2 of the Chart Wizard or in the Source Data dialog (use the Series tab in both cases), or in Excel 2007 using the Select Data command.</p>
<p style="text-align: center;"><img style="border: 0pt none;" src="http://peltiertech.com/WordPress/wp-content/img200804/PvtTblDualCatColumn.png" alt="Regular Dual Cat Axis Chart from Pivot Table Data" width="512" height="289" /></p>
<p>The advantage of the regular chart is that you have full control over all formatting, and over the data used in the chart. The disadvantage is that if the pivot data changes and the pivot table is refreshed or repivoted, the pivot table may cover a different range, and the chart will plot the original range. If the data changes a lot, you will have to (a) update the chart source data links manually, (b) design some clever dynamic range definitions so the links automatically keep pointing to the correct range, or (c) write a VBA procedure to update the chart&#8217;s links. This last option is pretty tricky to set up, but saves lots of time and frustration in the long run.</p>
<p><strong><em>Second in a series</em></strong></p>
<ul>
<li><a href="http://peltiertech.com/WordPress/chart-with-a-dual-category-axis/">Chart with a Dual Category Axis</a></li>
<li>Using Pivot Table Data for a Chart with a Dual Category Axis</li>
<li><a href="http://peltiertech.com/WordPress/dynamic-chart-using-pivot-table-and-range-names/">Dynamic Chart using Pivot Table and Range Names</a></li>
<li><a href="http://peltiertech.com/WordPress/dynamic-chart-using-pivot-table-and-vba/">Dynamic Chart using Pivot Table and VBA</a></li>
</ul>



Bookmark and share this entry:


	<a rel="nofollow"  href="http://twitter.com/home?status=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis%20-%20http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F" title="Twitter"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;bodytext=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20" title="Digg"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;t=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis" title="Facebook"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;source=Peltier+Tech+Blog+Peltier+Tech+Excel+Charts+and+Programming+Blog&amp;summary=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20" title="LinkedIn"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;notes=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20" title="del.icio.us"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F" title="Technorati"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis" title="StumbleUpon"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;annotation=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20" title="Google Bookmarks"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis" title="Reddit"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;t=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis" title="MySpace"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://slashdot.org/bookmark.pl?title=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;url=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F" title="Slashdot"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;submitHeadline=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;submitSummary=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fpeltiertech.com%2FWordPress%2Fusing-pivot-table-data-for-a-chart-with-a-dual-category-axis%2F&amp;t=Using%20Pivot%20Table%20Data%20for%20a%20Chart%20with%20a%20Dual%20Category%20Axis&amp;s=Tony%20commented%20on%20the%20previous%20post%2C%20Chart%20with%20a%20Dual%20Category%20Axis%2C%20asking%20whether%20I%27d%20use%20a%20pareto%20chart%20for%20this%20data.%20I%20commented%20that%20it%20almost%20was%20a%20pareto%20chart%2C%20since%20at%20least%20within%20each%20category%20the%20data%20is%20sorted%20from%20high%20to%20low.%20Then%20I%20" title="Tumblr"><img src="http://peltiertech.com/WordPress/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/using-pivot-table-data-for-a-chart-with-a-dual-category-axis/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
