MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 7th, 2002, 03:28 PM   #1
eekbat
New Member
 
Join Date: Apr 2002
Posts: 2
Default

I'm not sure how to do this

I want to treat all data from may 1999 as one pieces of data, all from june 1999 as another etc. Currently I have all that data listed by day and i'm loking for an elegant way to clump it together so that i can simply report data by month

hope this is clear?

thanks
eekbat is offline   Reply With Quote
Old Apr 7th, 2002, 03:38 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-07 14:28, eekbat wrote:
I'm not sure how to do this

I want to treat all data from may 1999 as one pieces of data, all from june 1999 as another etc. Currently I have all that data listed by day and i'm loking for an elegant way to clump it together so that i can simply report data by month

hope this is clear?

thanks
It's not clear what you exactly want to do.

Do you want to total something or what? If so, you need to tell preferably by means of a small sample how your data look like & what kind of summary by month you want to have.
Aladin Akyurek is offline   Reply With Quote
Old Apr 7th, 2002, 05:35 PM   #3
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

As a quickie solution, you can insert another column. Suppose your dates are in Column B and you inserted Column A as the new column. In A1, you put a new heading called Month. In A2, you could type

=MONTH(B2)

Copy that down. Now, use Data-Subtotals. You'll want to *at each break in* Month, then do totals on whatever column you're trying to group by. Hit OK. You'll see a #1, #2, and #3 to the left of your column headings. Click on #2 to see the totals for each month.
__________________
~Anne Troy
Anne Troy is offline   Reply With Quote
Old Apr 7th, 2002, 07:32 PM   #4
eekbat
New Member
 
Join Date: Apr 2002
Posts: 2
Default

Bleh

Monday mornings, sorry for not providing more detail

Ok, i'll explain it a bit better

I have a huge list of data such as

17/09/1999 Smith
18/09/1999 Brown
20/09/1999 Willis
22/09/1999 Jones

Now this is far too much info to list for my reports. I simply want to have a field that adds up all the columns that have a data entry for for a month/year and give a single number ie

Sept 1999 4
October 1999 5

Dreamboat was on the right lines i think, but i need to make ths a pretty 'dumb' sheet, in so far as the person that will be using it needs to just be able to paste the data in to it and be able to see the results on a front page.

If I can get the data from day/month/year to just month/year i'm prety sure i can suss it out from there

Thanks for the help
(note im using day/month/year notation)
eekbat is offline   Reply With Quote
Old Apr 7th, 2002, 10:31 PM   #5
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Eek: I just recorded this macro in a matter of seconds. It takes your worksheet and copies it to a different name. Then it grabs the date column (in this instance, I used column A), and formats it to show only the month, then it sorts the column, runs subtotals on the amount column, and goes to the subtotals view (#2) as I explained previously. I've assigned it a shortcut key of Ctrl-Shift-G (for "go").

Hope it helps:

Sub EekbatMacro()
'
' EekbatMacro Macro
' Macro recorded 04/08/2002 by Dreamboat
'
' Keyboard Shortcut: Ctrl+Shift+G
'
Sheets("OldSheetName").Select
Sheets("OldSheetName").Copy Before:=Sheets(1)
Sheets("OldSheetName (2)").Select
Sheets("OldSheetName (2)").Name = "NewSheetName"
Columns("A:A").Select
Selection.NumberFormat = "mmmm"
Range("A1").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(2), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ActiveSheet.Outline.ShowLevels RowLevels:=2
Columns("A:A").ColumnWidth = 19
End Sub




Oh yeah. Somebody can probably shorten the code. And I also widened column A so the month names could be completely seen.
_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-07 21:32 ]
Anne Troy is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes