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 3rd, 2002, 09:42 AM   #1
bhmcpfs
Board Regular
 
Join Date: Apr 2002
Posts: 88
Default

I have an imported .txt file with ~10,000 rows of data. In column B, there are group headings (e.g. red, blue, black) Under each group heading is a variable number of rows containing data. I would like to get the group headings at the end of each row (in column Z). Can I do this? I've tried several variations of an IF worksheet function, with little success. I can get the first row beneath the heading correct, but since my reference varies, I'm not knowledgable enough to get further. Any assistance would be helpful. Sorry for the long post.
bhmcpfs is offline   Reply With Quote
Old Apr 3rd, 2002, 09:58 AM   #2
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Quote:
On 2002-04-03 08:42, bhmcpfs wrote:
I have an imported .txt file with ~10,000 rows of data. In column B, there are group headings (e.g. red, blue, black) Under each group heading is a variable number of rows containing data. I would like to get the group headings at the end of each row (in column Z). Can I do this? I've tried several variations of an IF worksheet function, with little success. I can get the first row beneath the heading correct, but since my reference varies, I'm not knowledgable enough to get further. Any assistance would be helpful. Sorry for the long post.
Can you be more specific and give the exact starcture of your data?
Eli
eliW is offline   Reply With Quote
Old Apr 3rd, 2002, 11:12 AM   #3
bhmcpfs
Board Regular
 
Join Date: Apr 2002
Posts: 88
Default

Row 1 are headers I've inserted, B2 contains 'Red', B3:B10 contains text (part descriptions), B11 contains 'Blue', B12:B40 contains text (as in B3:B10), B41 contains 'Black', B42:B48 contains text, etc. I'd like to have 'Red' in Z3:Z10, 'Blue' in Z12:Z40, and 'Black' in Z42:Z48. Hope this helps better explain my situation. Let me know if you need more... Thanks in advance for your time.
bhmcpfs is offline   Reply With Quote
Old Apr 3rd, 2002, 11:27 AM   #4
bhmcpfs
Board Regular
 
Join Date: Apr 2002
Posts: 88
Default

If it helps, I have ~80 unique group headings I'd like to move. I started to work on a nested IF statement, but gave up quickly. Of significance, though is that the headings differ from the rest of the data in column B in that the first seven characters of the headings are '888_999', where the data is all alphabetic.
bhmcpfs is offline   Reply With Quote
Old Apr 3rd, 2002, 01:20 PM   #5
daleyman
Board Regular
 
Join Date: Mar 2002
Location: London, UK
Posts: 167
Default

in that case is not too difficult...

Assumption I am making is that list starts at row 1...

Firstly, in cell Z1 put:

=B1

then, in cell Z2 put:

=IF(LEFT(B2,7)="888_999",B2,Z1)

then, use the fill the equation down the list (you can use the fill button on the bottom right hand corner of the selected cell Z2 for this, so long as the values in column Y are unbroken).

As with all large sets of data, I recommend you copy the column to values when you are done.

hope this works.
daleyman is offline   Reply With Quote
Old Apr 3rd, 2002, 01:22 PM   #6
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Ok I'v got it
daleyman is right
Eli





[ This Message was edited by: eliW on 2002-04-03 12:34 ]
eliW is offline   Reply With Quote
Old Apr 3rd, 2002, 01:29 PM   #7
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

HI,

in cell Z2, try this :

=IF(MID(B2,1,7)="888_999",B2,Z1)

this brings in the headings....

if you want them blank, then try this :

=IF(MID(B2,1,7)="888_999","",IF(MID(B1,1,7)="888_999",B1,Z1))

edit ........ and copy down to row 10,000 +

_________________
Hope this helps,
Chris


[ This Message was edited by: Chris Davison on 2002-04-03 12:30 ]
Chris Davison is offline   Reply With Quote
Old Apr 3rd, 2002, 01:52 PM   #8
bhmcpfs
Board Regular
 
Join Date: Apr 2002
Posts: 88
Default

This only works for the first heading. My problem is that the heading changes every x rows. I want the formula to work down the data, until it encounters another heading. I'm given column A and B. I want to get C to look like this:
[A] [B] [C]
200 250 RED
004 PART 1 200 250 RED
200 350 BLUE
469 PART 2 200 350 BLUE
162 PART 3 200 350 BLUE
105 PART 4 200 350 BLUE
300 071 *BLACK
520 PART 22 300 071 *BLACK
281 PART 43 300 071 *BLACK
350 PART 999 300 071 *BLACK
081 PART 111 300 071 *BLACK
bhmcpfs is offline   Reply With Quote
Old Apr 3rd, 2002, 01:59 PM   #9
bhmcpfs
Board Regular
 
Join Date: Apr 2002
Posts: 88
Default

Sorry guys, that came out looking like cr*p. I've used commas to separate columns this time. Hope it works better. A1 is blank, B1 is '200 250 RED', A3 is blank, etc.
[A],[B],[C]
,200 250 RED,
004, PART 1, 200 250 RED
,200 350 BLUE
469, PART 2, 200 350 BLUE
162, PART 3, 200 350 BLUE
105, PART 4, 200 350 BLUE
,300 071 *BLACK,
520, PART 22, 300 071 *BLACK
281, PART 43, 300 071 *BLACK
350, PART 99, 300 071 *BLACK
081, PART 11, 300 071 *BLACK
bhmcpfs is offline   Reply With Quote
Old Apr 3rd, 2002, 02:57 PM   #10
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Quote:
On 2002-04-03 12:59, bhmcpfs wrote:
Sorry guys, that came out looking like cr*p. I've used commas to separate columns this time. Hope it works better. A1 is blank, B1 is '200 250 RED', A3 is blank, etc.
[A],[B],[C]
,200 250 RED,
004, PART 1, 200 250 RED
,200 350 BLUE
469, PART 2, 200 350 BLUE
162, PART 3, 200 350 BLUE
105, PART 4, 200 350 BLUE
,300 071 *BLACK,
520, PART 22, 300 071 *BLACK
281, PART 43, 300 071 *BLACK
350, PART 99, 300 071 *BLACK
081, PART 11, 300 071 *BLACK
1) Copy B1 to Z1
2) In Z2 put the formula:
=IF(AND(CODE(B2)>47,CODE(B2)<58),B2,Z1)
3) copy this formula all the way to your last row
Eli
eliW 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 12:27 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