Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Pivot Table: Totals for "Last 12 months" and "Preceding 12 months"

I have a Pivot Table which shows revenues for each month in a rolling
24-month period. (That is, the 24 months are not two calendar years,
but start any month and end 24 months later). I need to add:
subtotals for the last 12 months, and the 12-months prior to the last
12 months.

Apr -2001 $2,471,802
May-2001 $2,637,046
...
...
...
Feb-2002 $2,323,360
Mar-2002 $1,328,335

Last 12Month ????????
Prec 12Month ????????

How do I do this with VBA in the Pivot Table itself? Or will I have to
do this in Excel, after the Pivot has been calculated?

Thank you!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Pivot Table: Totals for "Last 12 months" and "Preceding 12 m

Thank you, Jim, for your response and advice. Do I understand you
correctly to mean:

Step 1. In Source Data create two columns for Current 12 month and
Prior 12 month totals.
Step 2. Then any month (=row) that I pick will have a corresponding 12
month and 24 month total.

??


Jim Thomlinson wrote:
You need to add a flag to your Source Data that will indicate Current 12 or
Prior 12 based on the year and month. That will allow you to divide your
periods for aggregation. Then add that to your pivot table... Let me know if
that does not make sense.
--
HTH...

Jim Thomlinson


" wrote:

I have a Pivot Table which shows revenues for each month in a rolling
24-month period. (That is, the 24 months are not two calendar years,
but start any month and end 24 months later). I need to add:
subtotals for the last 12 months, and the 12-months prior to the last
12 months.

Apr -2001 $2,471,802
May-2001 $2,637,046
...
...
...
Feb-2002 $2,323,360
Mar-2002 $1,328,335

Last 12Month ????????
Prec 12Month ????????

How do I do this with VBA in the Pivot Table itself? Or will I have to
do this in Excel, after the Pivot has been calculated?

Thank you!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Pivot Table: Totals for "Last 12 months" and "Preceding 12 m

Not really... Just add a single extra column. Each cell will contain either
the words "Current" or "Prior" based on the date in that row. So it will look
something like this...

Date Amount flag
1-Nov-05 100 Prior
1-Dec-05 200 Prior
1-Jan-06 300 Prior
1-Feb-06 400 Current
1-Mar-06 500 Current

Now you have a field that you can add to your pivot and aggregate by...

flag Date Total
Current 1-Feb-06 400
1-Mar-06 500
Current Total 900
Prior 1-Nov-05 100
1-Dec-05 200
1-Jan-06 300
Prior Total 600
Grand Total 1500

--
HTH...

Jim Thomlinson


" wrote:

Thank you, Jim, for your response and advice. Do I understand you
correctly to mean:

Step 1. In Source Data create two columns for Current 12 month and
Prior 12 month totals.
Step 2. Then any month (=row) that I pick will have a corresponding 12
month and 24 month total.

??


Jim Thomlinson wrote:
You need to add a flag to your Source Data that will indicate Current 12 or
Prior 12 based on the year and month. That will allow you to divide your
periods for aggregation. Then add that to your pivot table... Let me know if
that does not make sense.
--
HTH...

Jim Thomlinson


" wrote:

I have a Pivot Table which shows revenues for each month in a rolling
24-month period. (That is, the 24 months are not two calendar years,
but start any month and end 24 months later). I need to add:
subtotals for the last 12 months, and the 12-months prior to the last
12 months.

Apr -2001 $2,471,802
May-2001 $2,637,046
...
...
...
Feb-2002 $2,323,360
Mar-2002 $1,328,335

Last 12Month ????????
Prec 12Month ????????

How do I do this with VBA in the Pivot Table itself? Or will I have to
do this in Excel, after the Pivot has been calculated?

Thank you!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Pivot Table: Totals for "Last 12 months" and "Preceding 12 m

Jim,
Appreciate your follow-up, and your suggestion turned out to be just
what was needed.
A big 'thank you'.
kannan

Jim Thomlinson wrote:
Not really... Just add a single extra column. Each cell will contain either
the words "Current" or "Prior" based on the date in that row. So it will look
something like this...

Date Amount flag
1-Nov-05 100 Prior
1-Dec-05 200 Prior
1-Jan-06 300 Prior
1-Feb-06 400 Current
1-Mar-06 500 Current

Now you have a field that you can add to your pivot and aggregate by...

flag Date Total
Current 1-Feb-06 400
1-Mar-06 500
Current Total 900
Prior 1-Nov-05 100
1-Dec-05 200
1-Jan-06 300
Prior Total 600
Grand Total 1500

--
HTH...

Jim Thomlinson


" wrote:

Thank you, Jim, for your response and advice. Do I understand you
correctly to mean:

Step 1. In Source Data create two columns for Current 12 month and
Prior 12 month totals.
Step 2. Then any month (=row) that I pick will have a corresponding 12
month and 24 month total.

??


Jim Thomlinson wrote:
You need to add a flag to your Source Data that will indicate Current 12 or
Prior 12 based on the year and month. That will allow you to divide your
periods for aggregation. Then add that to your pivot table... Let me know if
that does not make sense.
--
HTH...

Jim Thomlinson


" wrote:

I have a Pivot Table which shows revenues for each month in a rolling
24-month period. (That is, the 24 months are not two calendar years,
but start any month and end 24 months later). I need to add:
subtotals for the last 12 months, and the 12-months prior to the last
12 months.

Apr -2001 $2,471,802
May-2001 $2,637,046
...
...
...
Feb-2002 $2,323,360
Mar-2002 $1,328,335

Last 12Month ????????
Prec 12Month ????????

How do I do this with VBA in the Pivot Table itself? Or will I have to
do this in Excel, after the Pivot has been calculated?

Thank you!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99[_2_] Excel Discussion (Misc queries) 2 January 2nd 10 03:25 PM
Sorting a text strings but omitting preceding "A" or "The" Pablo Excel Worksheet Functions 2 December 15th 09 10:10 PM
Pivot Table Report Filter - "OR" instead of "AND" Multiple Filters tommcbrny Excel Discussion (Misc queries) 1 October 29th 09 03:08 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Pivot table "Group and Show Details" vs. "SubTotals" pgchop Excel Programming 0 February 1st 06 07:29 AM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"