<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Grouping Dates in Pivot Tables</title>
	<atom:link href="http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/</link>
	<description>Fresh Excel Tips, Tricks, Charts, Tutorials, Downloads, Dashboards and Visualization Showcase for your Inspiration and Productivity</description>
	<lastBuildDate>Fri, 19 Mar 2010 05:15:49 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Monica</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-97984</link>
		<dc:creator>Monica</dc:creator>
		<pubDate>Thu, 18 Mar 2010 21:43:51 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-97984</guid>
		<description>I need it for 3 years, not just one single year.</description>
		<content:encoded><![CDATA[<p>I need it for 3 years, not just one single year.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monica</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-97983</link>
		<dc:creator>Monica</dc:creator>
		<pubDate>Thu, 18 Mar 2010 21:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-97983</guid>
		<description>How do you do this with a fiscal year, say from December to November? It seems to only allow for calendar years.</description>
		<content:encoded><![CDATA[<p>How do you do this with a fiscal year, say from December to November? It seems to only allow for calendar years.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Profit &#38; Loss Reporting using Microsoft Excel - Accounting &#38; Excel - Part 1 of 6 &#124; Pointy Haired Dilbert: Learn Excel Online - Chandoo.org</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-95288</link>
		<dc:creator>Profit &#38; Loss Reporting using Microsoft Excel - Accounting &#38; Excel - Part 1 of 6 &#124; Pointy Haired Dilbert: Learn Excel Online - Chandoo.org</dc:creator>
		<pubDate>Wed, 24 Feb 2010 22:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-95288</guid>
		<description>[...] This gives you flexibility to group data by quarterly / Six Monthly / Yearly for reporting. [learn more about grouping dates in pivot reports] [...]</description>
		<content:encoded><![CDATA[<p>[...] This gives you flexibility to group data by quarterly / Six Monthly / Yearly for reporting. [learn more about grouping dates in pivot reports] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandoo</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-86015</link>
		<dc:creator>Chandoo</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-86015</guid>
		<description>@Pam.. you can select both Month and Year in group criteria to have this corrected.</description>
		<content:encoded><![CDATA[<p>@Pam.. you can select both Month and Year in group criteria to have this corrected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pam</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-86010</link>
		<dc:creator>Pam</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-86010</guid>
		<description>Hi.  I am trying to chart expenses per month that range from Sept 08 to October 09.  When I group by month in the pivot table it only gives 12 months (Jan- Dec) and groups the Sept 08 and Sept 09 data together.  Is there a way to group by month (Sept-08 through Oct-09) that will allow me to use greater than 12 months?</description>
		<content:encoded><![CDATA[<p>Hi.  I am trying to chart expenses per month that range from Sept 08 to October 09.  When I group by month in the pivot table it only gives 12 months (Jan- Dec) and groups the Sept 08 and Sept 09 data together.  Is there a way to group by month (Sept-08 through Oct-09) that will allow me to use greater than 12 months?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lohhw3</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-85724</link>
		<dc:creator>lohhw3</dc:creator>
		<pubDate>Fri, 20 Nov 2009 14:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-85724</guid>
		<description>thanks chandoo!

am glad it&#039;s not a weird problem that i&#039;m facing ;)</description>
		<content:encoded><![CDATA[<p>thanks chandoo!</p>
<p>am glad it&#8217;s not a weird problem that i&#8217;m facing <img src='http://chandoo.org/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandoo</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-85683</link>
		<dc:creator>Chandoo</dc:creator>
		<pubDate>Fri, 20 Nov 2009 07:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-85683</guid>
		<description>@Ed.. this is exactly why I love to blog. Everyday I meet great hacks and excel users like you. Thanks for sharing the macro with us. 

@Marion: You can group non-dates by selecting the values you want to group and selecting &quot;group&quot; option. Excel will create a new group with the selected values. It is a bit painful but better than mentally grouping the values.

@Lohhw3: This seems like a bug (or feature) in pivot tables. Once you make a group in one pivot, the group persists in other pivots. A simpler solution could be to make a duplicate data table and use it in pivot.</description>
		<content:encoded><![CDATA[<p>@Ed.. this is exactly why I love to blog. Everyday I meet great hacks and excel users like you. Thanks for sharing the macro with us. </p>
<p>@Marion: You can group non-dates by selecting the values you want to group and selecting &#8220;group&#8221; option. Excel will create a new group with the selected values. It is a bit painful but better than mentally grouping the values.</p>
<p>@Lohhw3: This seems like a bug (or feature) in pivot tables. Once you make a group in one pivot, the group persists in other pivots. A simpler solution could be to make a duplicate data table and use it in pivot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lohhw3</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-85669</link>
		<dc:creator>lohhw3</dc:creator>
		<pubDate>Fri, 20 Nov 2009 01:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-85669</guid>
		<description>hi chandoo,

this post is just what i need to feedback a bug/problem in PivotTable (Excel 2007).

I&#039;ve created a new sheet for pivottable with date grouped into month/year.

BUT, i needed to create a new pivottable sheet (from the same source table) with NO date grouping. However, this new pivottable will not show the full, ungrouped dates. It stumbled me for some time until i figured out that the 1st pivottable has date grouping!

is there a solution to this?

thanks!</description>
		<content:encoded><![CDATA[<p>hi chandoo,</p>
<p>this post is just what i need to feedback a bug/problem in PivotTable (Excel 2007).</p>
<p>I&#8217;ve created a new sheet for pivottable with date grouped into month/year.</p>
<p>BUT, i needed to create a new pivottable sheet (from the same source table) with NO date grouping. However, this new pivottable will not show the full, ungrouped dates. It stumbled me for some time until i figured out that the 1st pivottable has date grouping!</p>
<p>is there a solution to this?</p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marion</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-85562</link>
		<dc:creator>Marion</dc:creator>
		<pubDate>Thu, 19 Nov 2009 02:10:10 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-85562</guid>
		<description>Is there a way to group on non-date values?  For example, I have expenses from various companies that I need to compare.  I have normalized the data, and then I pivot - so that the categories and line items are the rows, and I have a column for each company.  However, it&#039;s a terrible waste of real-estate - the categories take up too much room.  It would be great if they could be grouped.... 

Suggestions?</description>
		<content:encoded><![CDATA[<p>Is there a way to group on non-date values?  For example, I have expenses from various companies that I need to compare.  I have normalized the data, and then I pivot &#8211; so that the categories and line items are the rows, and I have a column for each company.  However, it&#8217;s a terrible waste of real-estate &#8211; the categories take up too much room.  It would be great if they could be grouped&#8230;. </p>
<p>Suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Ferrero</title>
		<link>http://chandoo.org/wp/2009/11/17/group-dates-in-pivot-tables/#comment-85466</link>
		<dc:creator>Ed Ferrero</dc:creator>
		<pubDate>Wed, 18 Nov 2009 01:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://chandoo.org/wp/?p=2405#comment-85466</guid>
		<description>One frustration with Excel&#039;s date grouping is that Quarters are for calendar years only. In my world Quarter 1 starts in July.

Here&#039;s a bit of code to add to the ThisWorkbook module. This works by changing the captions of quarterly groups from &#039;Qtr 1&#039; to &#039;Q3&#039;. It runs after the pivot table update event, because updating the pivot table will change quarter captions back to the defaults.

&#039;=================================================
Option Explicit
&#039; IsUpdated is a global variable that lets us know
&#039; if the Pivot Table Update event has been triggered by the user
&#039; or by our code in this module
Private IsUpdated As Boolean

Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target 
As PivotTable)
If Not IsUpdated Then
  If SetFiscalQtr(Target) Then
    Application.StatusBar = &quot;Fiscal Year Quarters Set&quot;
    IsUpdated = False
  End If
End If
End Sub

Private Function SetFiscalQtr(pt As PivotTable) As Boolean
&#039; Function to set Quarters From Excel default to fiscal year
&#039; i.e. Q1 = Jul, Aug, Sep etc.
If FieldExists(pt, &quot;Quarters&quot;) Then
  IsUpdated = True
  With pt.PivotFields(&quot;Quarters&quot;)
    &#039; could check to see if we have already
    &#039; renamed the quarters, or just error and keep
    &#039; going
    On Error Resume Next
    .PivotItems(&quot;Qtr3&quot;).Caption = &quot;Q1&quot;
    .PivotItems(&quot;Qtr4&quot;).Caption = &quot;Q2&quot;
    .PivotItems(&quot;Qtr1&quot;).Caption = &quot;Q3&quot;
    .PivotItems(&quot;Qtr2&quot;).Caption = &quot;Q4&quot;
    .AutoSort xlAscending, &quot;Quarters&quot;
    &#039; turn error checking back on
    On Error GoTo 0
  End With
  SetFiscalQtr = True
Else
  SetFiscalQtr = False
End If
End Function

Private Function FieldExists(pt As PivotTable, strField As String) As 
Boolean
&#039; checks if strField is a Pivot Field in the Pivot Table pt
&#039; true if field exists
Dim fld As PivotField

FieldExists = False
For Each fld In pt.PivotFields
  If fld.Name = strField Then
    FieldExists = True
    Exit Function
  End If
Next
End Function


Cheers,

Ed</description>
		<content:encoded><![CDATA[<p>One frustration with Excel&#8217;s date grouping is that Quarters are for calendar years only. In my world Quarter 1 starts in July.</p>
<p>Here&#8217;s a bit of code to add to the ThisWorkbook module. This works by changing the captions of quarterly groups from &#8216;Qtr 1&#8242; to &#8216;Q3&#8242;. It runs after the pivot table update event, because updating the pivot table will change quarter captions back to the defaults.</p>
<p>&#8216;=================================================<br />
Option Explicit<br />
&#8216; IsUpdated is a global variable that lets us know<br />
&#8216; if the Pivot Table Update event has been triggered by the user<br />
&#8216; or by our code in this module<br />
Private IsUpdated As Boolean</p>
<p>Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target<br />
As PivotTable)<br />
If Not IsUpdated Then<br />
  If SetFiscalQtr(Target) Then<br />
    Application.StatusBar = &#8220;Fiscal Year Quarters Set&#8221;<br />
    IsUpdated = False<br />
  End If<br />
End If<br />
End Sub</p>
<p>Private Function SetFiscalQtr(pt As PivotTable) As Boolean<br />
&#8216; Function to set Quarters From Excel default to fiscal year<br />
&#8216; i.e. Q1 = Jul, Aug, Sep etc.<br />
If FieldExists(pt, &#8220;Quarters&#8221;) Then<br />
  IsUpdated = True<br />
  With pt.PivotFields(&#8221;Quarters&#8221;)<br />
    &#8216; could check to see if we have already<br />
    &#8216; renamed the quarters, or just error and keep<br />
    &#8216; going<br />
    On Error Resume Next<br />
    .PivotItems(&#8221;Qtr3&#8243;).Caption = &#8220;Q1&#8243;<br />
    .PivotItems(&#8221;Qtr4&#8243;).Caption = &#8220;Q2&#8243;<br />
    .PivotItems(&#8221;Qtr1&#8243;).Caption = &#8220;Q3&#8243;<br />
    .PivotItems(&#8221;Qtr2&#8243;).Caption = &#8220;Q4&#8243;<br />
    .AutoSort xlAscending, &#8220;Quarters&#8221;<br />
    &#8216; turn error checking back on<br />
    On Error GoTo 0<br />
  End With<br />
  SetFiscalQtr = True<br />
Else<br />
  SetFiscalQtr = False<br />
End If<br />
End Function</p>
<p>Private Function FieldExists(pt As PivotTable, strField As String) As<br />
Boolean<br />
&#8216; checks if strField is a Pivot Field in the Pivot Table pt<br />
&#8216; true if field exists<br />
Dim fld As PivotField</p>
<p>FieldExists = False<br />
For Each fld In pt.PivotFields<br />
  If fld.Name = strField Then<br />
    FieldExists = True<br />
    Exit Function<br />
  End If<br />
Next<br />
End Function</p>
<p>Cheers,</p>
<p>Ed</p>
]]></content:encoded>
	</item>
</channel>
</rss>
