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 Mar 12th, 2002, 04:24 PM   #1
andonny
Board Regular
 
Join Date: Mar 2002
Posts: 217
Default

Hi,
I just came accross another problem and I am hoping for help.

I have many multiple items in column A(sheet1) from various suppliers. Just
as an example: One of the items could have been purchased from four
different suppliers (maybe three or five or only two suppliers). I have no
problems to sumif the qty and total values of each item in sheet2 as a
unique item. The problem I have is to list the various suppliers on the same
row where the unique items are. I am dealing here with 40000 rows of data.
Example sheet1:
.................qty.............value........supplier
Apple........30.............3500.......company1
Apple........50.............4000......company2
Apple........60............7000........company3
Apple........70...........2000........company4
Apple........70...........2000.........company2
Pear...........150.........6000........smith
Pear...........90...........7000.........vista
Pear...........30...........7000.........a company
Pear...........20...........2000.........vista

Example sheet2:
......................qty.............value..........supplier1.............s
upplier2...............supplier3...................supplier4
Pear.............521............20100...........smith...............vista...
...................a company
Apple...........450............15700..........company1.......company2.......
......company3....................company4
etc.

You help would be very much appreciated. This looks like a difficult
one to me.
Andonny

andonny is offline   Reply With Quote
Old Mar 13th, 2002, 02:17 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Hi Andonny,

You never cease to come up with beautiful questions.

First of all you need Longre's morefunc.xll, which contains a UDF called UNIQUEVALUES that I use in what follows:

I'll assume that A1:D10 in sheet Data houses the sample data you provided:

{"item","qty","value","supplier ";
"Apple",30,3500,"company1";
"Apple",50,4000,"company2";
"Apple",60,7000,"company3";
"Apple",70,2000,"company4";
"Apple",70,2000,"company2";
"Pear",150,6000,"smith";
"Pear",90,7000,"vista";
"Pear",30,7000,"a company";
"Pear",20,2000,"vista"}

More importantly, I'll also assume that your data is sorted on the "item'column, a prerequisite for the below system of formulas to operate correctly.

On sheet X --not a very imaginative name, I know:

In B1:J1 enter:

{"Start","End","qty","value",1,2,3,4,5}

Create a unique list of items (e.g., using Advanced Filter) in column A from A2 on.

With respect to the sample you provided, in A2:A3 we get:

{"Apple";"Pear"}

In B2 enter:

=MATCH(A2,Data!A:A,0)

In C2 enter:

=MATCH(A2,Data!A:A)

Select B2:C2 and copy down till row 3.

In D2 enter:

=SUMIF(OFFSET(Data!$A$1,$B2-1,0,$C2-$B2+1,1),$A2,OFFSET(Data!$A$1,$B2-1,1,$C2-$B2+1,1))

In E2 enter:

=SUMIF(OFFSET(Data!$A$1,$B2-1,0,$C2-$B2+1,1),$A2,OFFSET(Data!$A$1,$B2-1,2,$C2-$B2+1,1))

Yes, you said you know how to do this part, but I couldn't resist to take up that too.

Now the thing you asked for:

In F2 enter:

=IF($C2-$B2+1>F$1,INDEX(UNIQUEVALUES(OFFSET(Data!$A$1,$B2-1,3,$C2-$B2+1,1)),F$1),"")

Copy this across till J2.

Select D2:J2 and copy it till row 3.

The data processing area, A1:J3, in X will now look like this:

{"","Start","End","qty","value",1,2,3,4,5;
"Apple",2,6,280,18500,"company4","company3","company2","company1","";
"Pear",7,10,290,22000,"vista","smith","a company","",""}

You can get morefunc at:

http://perso/wanadoo.fr/longre/excel/downloads/

Aladin

Quote:
On 2002-03-12 15:24, andonny wrote:
Hi,
I just came accross another problem and I am hoping for help.

I have many multiple items in column A(sheet1) from various suppliers. Just
as an example: One of the items could have been purchased from four
different suppliers (maybe three or five or only two suppliers). I have no
problems to sumif the qty and total values of each item in sheet2 as a
unique item. The problem I have is to list the various suppliers on the same
row where the unique items are. I am dealing here with 40000 rows of data.
Example sheet1:
.................qty.............value........supplier
Apple........30.............3500.......company1
Apple........50.............4000......company2
Apple........60............7000........company3
Apple........70...........2000........company4
Apple........70...........2000.........company2
Pear...........150.........6000........smith
Pear...........90...........7000.........vista
Pear...........30...........7000.........a company
Pear...........20...........2000.........vista

Example sheet2:
......................qty.............value..........supplier1.............s
upplier2...............supplier3...................supplier4
Pear.............521............20100...........smith...............vista...
...................a company
Apple...........450............15700..........company1.......company2.......
......company3....................company4
etc.

You help would be very much appreciated. This looks like a difficult
one to me.
Andonny

Aladin Akyurek 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 07:06 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