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 May 11th, 2002, 06:20 AM   #1
dmdorado
New Member
 
Join Date: May 2002
Posts: 2
Default

I have a list which I have subtotaled. I now want to work exclusively with the subtotal lines. How do I delete the data and keep just the subtotal lines? I've tried copy, paste special values, sort and copy over the subotals, but there must be an easier way...AND I have another important issue that presents a challenge...

In each of the lines there is data I want included in the new subtoal lines.

I am subtotalling by an id number for each line. All of the items for each id number (ROW) will be the same except the dollar amounts. Like this...

Smith ID2334 100 200 Act Blue
Smith ID2334 300 600 Act Blue
Jones ID1254 222 333 DED Green
Jones ID1254 444 666 DED Green

Now when I subtotal by ID # I get this:
Smith ID2334 100 200 Act Blue
Smith ID2334 300 600 Act Blue
ID2334TOTAL 400 800 (BOLD)
Jones ID1254 222 333 DED Green
Jones ID1254 444 666 DED Green
ID2334TOTAL 666 999 (BOLD)

But what I want is:

Smith ID2334 100 200 Act Blue
Smith ID2334 300 600 Act Blue
Smith ID2334TOTAL 400 800 Act Blue
Jones ID1254 222 333 DED Green
Jones ID1254 444 666 DED Green
Jones ID1254TOTAL 666 999 Act Blue


Then I just want those total lines left so I can do additional calculations with those line items.

So I'm just left with a list of the subtotals that included the other data elements

Like this:
Smith ID2334TOTAL 400 800 Act Blue
Jones ID1254TOTAL 666 999 Act Blue

Excecpt for the fact it doesn't keep the other data elements, this is what the outline view looks like, but I don't know how to keep just that.

I usually go in and copy down the data into the subtotal line..but I have 47,000 lines and not 20 hours to do this.


Is this possible?



Thanks!!!!
dmdorado is offline   Reply With Quote
Old May 11th, 2002, 06:27 AM   #2
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Sure it's easily possible...
If you know VBA I'll send you a macro which you will need to edit.
If not then mail me your sheet.
excel_create@earthlink.net
Tom
Tom Schreiner is offline   Reply With Quote
Old May 11th, 2002, 06:29 AM   #3
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

If you do mail the sheet, please zip it up.
I have a 28k connect...
Thanks,
Tom
Tom Schreiner is offline   Reply With Quote
Old May 11th, 2002, 06:32 AM   #4
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Looks like an ideal job for pivot tables
__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old May 11th, 2002, 06:35 AM   #5
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Give some details Chris...
I don't know how to use pivot tables?
Does the poster know how to use pivot tables?
Tom

DM, I'm off to get some shut-eye.
Chris is more experienced with Excel than I.
Maybe the pivot table solution is better.
If you cannot find a solution, mail the sheet.
Tom

[ This Message was edited by: TsTom on 2002-05-11 05:41 ]
Tom Schreiner is offline   Reply With Quote
Old May 11th, 2002, 07:28 AM   #6
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

well,

assuming you have data like :

Name Region Code Amount
Mary North1 ABC1 21,000
Jack South3 ABB7 18,500
Mary North1 ABC1 50,000
John North2 ABC1 10,000
John North2 ABC1 30,000
Mary North1 ABC1 15,000
Mary North1 ABC1 21,000
Jack South3 ABB7 18,500
Mary North1 ABC1 50,000
John North2 ABC1 10,000
John North2 ABC1 30,000
Mary North1 ABC1 15,000
Mary North1 ABC1 21,000
Jack South3 ABB7 18,500
Mary North1 ABC1 50,000
John North2 ABC1 10,000
John North2 ABC1 30,000
Mary North1 ABC1 15,000
Jack South3 ABB7 45,000
Jack North1 AAA3 50,000
Jack North1 AAA3 50,000
A pivot table can arrange the unique info in many different ways. One example would be as follows :

Name Region Code Amount
Mary North1 ABC1 258,000
John North2 ABC2 130,000
Jack South3 ABB7 100,000
Jack North1 AAA3 100,000

which is a quikcer way of subtotalling unique values and perhaps more manageable than a collapsed list of subtotals, which is why I'm suggesting it in this case.

Explaining how to set them up is fiddly - the help files do this much better, and from memory I think I used the tutorial in excel which was very good.

An indication as to their flexibility is that with a single drag of the mouse, moving "region" from the left to the top within the set up results in something like this :

Name Code _North1__North2__South3
Mary ABC1 258,000
John ABC2 000,000 130,000
Jack ABB7 000,000 000,000 100,000
Jack AAA3 100,000

(apologies for the 0s, it doesn't align very well, but thsi should give you the jist of it)

Tom, your VBA suggestion is a good one : my knowledge of VBA is just about total zero, hence me posting something different at the same time as you posted

Also potentially viable is data consolidation, or even advanced filter and copying unique values to perform some maths, maybe even DSUM formula too.... but off the top of my head, I'd suggest looking into pivots

Hope this helps
Chris

edit : before someone jumps on my use of the word "quicker", as there's always *someone*, I mean in relation to copying paste special values as the poster is doing.....

good VBA code, which I suspect is what Tom has, will do it in a second or two, which is even quicker than my quicker.

[ This Message was edited by: Chris Davison on 2002-05-11 06:38 ]
Chris Davison 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