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 15th, 2002, 07:17 AM   #1
rcranley
New Member
 
Join Date: Mar 2002
Posts: 1
Default


I have an Excel sheet with a large list of names. Some of the names are repeated as the list shows members of different user groups in my organisation, and of course a person can be a member of more than 1 user group.

I want to build a small search facility at the top of the sheet, in which when a name is selected from a drop down list, it shows how many lists they are in and a dynamically created drop down list with the names of the groups.

Example:-

Intranet Users Internet Users Admin Users
Joe Bloggs Joe bloggs Joe Bloggs
Mary Smith John Doe John Doe
John Doe Jim Beam
Jim Beam

Etc.

I have the 'how many' part working but can't get the new drop down list to work.
e.g.
Running the query on 'Mary Smith' would result in 1 and on 'Jim Beam' would result in 2 etc.

But I also want a drop down list that would contain 'Intranet Users' only for Mary Smith but 'Intranet Users, Internet Users, Admin Users' for John Doe.

Can you help me, please??

Thanking you in advance

rcranley is offline   Reply With Quote
Old Mar 15th, 2002, 02:53 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-15 06:17, rcranley wrote:

I have an Excel sheet with a large list of names. Some of the names are repeated as the list shows members of different user groups in my organisation, and of course a person can be a member of more than 1 user group.

I want to build a small search facility at the top of the sheet, in which when a name is selected from a drop down list, it shows how many lists they are in and a dynamically created drop down list with the names of the groups.

Example:-

Intranet Users Internet Users Admin Users
Joe Bloggs Joe bloggs Joe Bloggs
Mary Smith John Doe John Doe
John Doe Jim Beam
Jim Beam

Etc.

I have the 'how many' part working but can't get the new drop down list to work.
e.g.
Running the query on 'Mary Smith' would result in 1 and on 'Jim Beam' would result in 2 etc.

But I also want a drop down list that would contain 'Intranet Users' only for Mary Smith but 'Intranet Users, Internet Users, Admin Users' for John Doe.

Can you help me, please??

Thanking you in advance
Make a 1-column list of registered users in a worksheet named Admin from A1 on:

{"Registered Users";"Joe Bloggs";"Mary Smith";"John Doe";"Jim Beam";"aky"}

Activate A2.
Activate Insert|Name|Define.
Enter USERS as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Admin!$A$2,0,0,COUNTA(Admin!$A:$A)-1,1)

Click OK.

I'll asume that the relevant data is in a worksheet named Data.
Lets say that A1:C5 in Data houses the sample data you provided:

{"Intranet Users","Internet Users","Admin Users";
"Joe Bloggs","Joe bloggs","Joe Bloggs";
"Mary Smith","John Doe","John Doe";
"John Doe","Jim Beam","";
"Jim Beam","",""}

Note 1. "" stand for an empty cell.

In E1 enter: User Groups [ just a label ]

In E2 enter: =IF(ISNUMBER(MATCH(Query!$A$3,$A$2:$A$5,0)),$A$1,"")

In E3 enter: =IF(ISNUMBER(MATCH(Query!$A$3,$B$2:$B$5,0)),$B$1,"")

In E4 enter: =IF(ISNUMBER(MATCH(Query!$A$3,$C$2:$C$5,0)),$C$1,"")

Note 2. The formulas from E2 on are checking one by one whether a given user is a member in a given group. Thus, a separate formula per group given the layout of your data.

In column F from F2 on enter the following sets of labels:

{"Groups";"LocList";"SortList";"NoDupsList"}

In G1 enter:

=COUNTA($E$1:$E$10)-1

Note 3. Adjust the range $E$1:$E$10 to suit the number of user groups that you have.

In G2 enter:

="$E$2:"&"$E"&$G$1+1

In G3 enter:

="$H$2:"&"$H$"&COUNTA(H:H)+1

In G4 enter:

="$I$2:"&"$I$"&COUNTA(I:I)+1

In G5 enter:

="$J$2:"&"$J$"&COUNTA(I:I)+1

In H2 enter and copy down till 10th row:

=IF(LEN(E2),SUMPRODUCT((E2>INDIRECT($G$2))+0)+1,"")

Note 4. The number 10 is the assumed number of user groups, which you must adjust to suit.

In I2 enter:

=IF(LEN(H2)=0,"None",IF(ISNUMBER(MATCH(ROW()-ROW($H$2)+1,INDIRECT($G$3),0)),INDEX(INDIRECT($G$2),MATCH(ROW()-ROW($H$2)+1,INDIRECT($G$3),0)),0))

In I3 enter and copy down till the 10th row:

=IF(ISNUMBER(MATCH(ROW()-ROW($H$2)+1,INDIRECT($G$3),0)),INDEX(INDIRECT($G$2),MATCH(ROW()-ROW($H$2)+1,INDIRECT($G$3),0)),0)

In J2 array-enter and copy down till the 10th row:

=IF(ROW()-ROW(INDIRECT($G$5))+1>ROWS(INDIRECT($G$4))-COUNTIF(INDIRECT($G$4),0),"",INDIRECT(ADDRESS(SMALL((IF(INDIRECT($G$4)<>0,ROW(INDIRECT($G$4)),ROW()+ROWS(INDIRECT($G$4)))),ROW()-ROW(INDIRECT($G$5))+1),COLUMN(INDIRECT($G$4)))))

Note 5. You need to hit control+shift+enter at the same time, not just enter, to array-enter a formula.

Activate J2.
Activate Insert|Name|Define.
Enter GROUPS as name in the Names in the Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$J$2,0,0,COUNTIF(Data!$J$2:$J$10,"*?*"),1)

Click OK.

Now we are in the main worksheet to which I will refer as Query.

In Query:

In A2:C2 enter the following labels:

{"User","# Groups","Groups"}

Activate A3.
Activate the option Data|Validation.
Choose 'List' for Allow.
Enter as 'Source':

=USERS

Click OK.

In B3 enter:

=COUNTIF(Data!A2:C5,A3)

Activate C3.
Activate the option Data|Validation.
Choose 'List' for Allow.
Enter as 'Source':

=GROUPS

Click OK.

Aladin

PS. If interested in a WB that uses the above system of formulas, just drop me a line.
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 05:43 AM.


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