Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default sum for each month

hi, everyone:

I have two columns, column A and Column B. Column A is the date in
format of mm/dd/yyyy. Column B is the cost corresponding to each date.
How to get the sum of cost for each month in pivot table? I would also
like to know the count of dates for each month.

I appreciate your help!

Jorge

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default sum for each month

Since Col_A contains dates
Try this:

Right-Click on the Date column of the Pivot Table
Select "Group and Show Detail"
.........Check: Months
.........Click [OK]
That will group all of the dates by Month and reflect their respective totals.

If you want item counts by Month, too.
Right-Click on the Pivot Table an check: Pivot Table Wizard
Click the [Layout] button
Drag the Cost field into the DATA area of the Pivot Table, again
Double-click it and set the formula to Count
Click [Finish]

Does that help?
***********
Regards,
Ron

XL2003, WinXP


" wrote:

hi, everyone:

I have two columns, column A and Column B. Column A is the date in
format of mm/dd/yyyy. Column B is the cost corresponding to each date.
How to get the sum of cost for each month in pivot table? I would also
like to know the count of dates for each month.

I appreciate your help!

Jorge


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default sum for each month

Ron:

Thanks for your help! However, I do not want the months to be combined
if they belong to different years. How to prevent this?

Jorge




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default sum for each month

When you are setting the Grouping.....

Hold down the [Ctrl] key while you select Months AND Years.

The pivot table will then group Months by Years.

Does that help?
***********
Regards,
Ron

XL2003, WinXP


" wrote:

Ron:

Thanks for your help! However, I do not want the months to be combined
if they belong to different years. How to prevent this?

Jorge





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default sum for each month

Ron:

Thank you so much. It works.

One more question. I will use the data from the pivot table to plot a
chart. From the excel, insert/chart/next/series/add/name (I put
Series1 as the name) /Value. How to make this VALUE part as a dynamic
range to reflect any newly added monthly cost? The reason is like
this: I will add in new months/years to my original data input area. I
have a code to update the PivotTable AUTOMATICALLY. Once I have a new
month, the pivot table will show this new month. Since the data source
of my chart is from the privot table, therefore, I need a dynamic
range for the Chart which needs to reflect this newly added month's
cost.

Please advise!

Thanks,

Jorge



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default sum for each month

Insert a column with =Year(date_column)
Make pivot table dragging first Year, then Date in the heading (row of
column)
Then use Ron's trick (which I had forgotten!)

best wishes

--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

wrote in message
ps.com...
Ron:

Thanks for your help! However, I do not want the months to be combined
if they belong to different years. How to prevent this?

Jorge






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default sum for each month


A quick-and-dirty way would be to insert a new B column
In B1 enter =MONTH(A1) and copy down
Your pivot table would then use these values (you could generate text like
Jan, Feb... but this would give a sorting problem)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

wrote in message
ups.com...
hi, everyone:

I have two columns, column A and Column B. Column A is the date in
format of mm/dd/yyyy. Column B is the cost corresponding to each date.
How to get the sum of cost for each month in pivot table? I would also
like to know the count of dates for each month.

I appreciate your help!

Jorge



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
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
copy worksheet from previous month and rename to current month Dan E. Excel Programming 4 December 8th 05 09:40 PM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 02:12 PM.

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

About Us

"It's about Microsoft Excel"