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 23rd, 2002, 01:31 PM   #1
robt
New Member
 
Join Date: Apr 2002
Posts: 8
Default

Hi all

I have two lists of information. Most of the lists contain the same names of people, but not all. I've used =OR(EXACT( etc and this tells me whether each name can be found anywhere within the other list with a simple true or false answer. The problem is that if it is true, i want excel to take some data from a cell next to the persons name and place it into the cell next to the same name on the other list. Does this make any sense?
robt is offline   Reply With Quote
Old Apr 23rd, 2002, 01:45 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-23 12:31, robt wrote:
Hi all

I have two lists of information. Most of the lists contain the same names of people, but not all. I've used =OR(EXACT( etc and this tells me whether each name can be found anywhere within the other list with a simple true or false answer. The problem is that if it is true, i want excel to take some data from a cell next to the persons name and place it into the cell next to the same name on the other list. Does this make any sense?
Does this make any sense?

Yes, it does. But, We got here a city map without street names on it .

Lets say that the list1 is in A2:B10, where A2:A10 holds the names, and list2 in D4:D10 also holds a set of names:

In E4 enter: =VLOOKUP(D4,$A$2:$B$10,2)

would seem to do what you're asking.

If not, give the exact ranges of the lists along with expected results.

Aladin

Aladin Akyurek is offline   Reply With Quote
Old Apr 23rd, 2002, 01:55 PM   #3
robt
New Member
 
Join Date: Apr 2002
Posts: 8
Default

Heres more info

sheet 1 contains a list of names with the firstname in A1:A202, the surname in B1:B202
and a unique ten digit personal id number in C1:C202

sheet 2 is identical to the first but there are no numbers listed in column C and only 98 names are listed, but are all present somewhere within the first sheet. I need excel to find the people in the first list and put their id number in column C, sheet 2

i.e find this persons id number from this sheet and place it next to his name in the other
robt is offline   Reply With Quote
Old Apr 23rd, 2002, 02:06 PM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-23 12:55, robt wrote:
Heres more info

sheet 1 contains a list of names with the firstname in A1:A202, the surname in B1:B202
and a unique ten digit personal id number in C1:C202

sheet 2 is identical to the first but there are no numbers listed in column C and only 98 names are listed, but are all present somewhere within the first sheet. I need excel to find the people in the first list and put their id number in column C, sheet 2

i.e find this persons id number from this sheet and place it next to his name in the other
Does column C in sheet2 house first names or surnames?
Aladin Akyurek is offline   Reply With Quote
Old Apr 23rd, 2002, 03:55 PM   #5
robt
New Member
 
Join Date: Apr 2002
Posts: 8
Default


Column C in sheet 2 does not contain any data. The firstnames and surnames are in columns A and B as in sheet 1. It's the personal ID number in Column C of sheet one that needs to go in column C of sheet two
robt is offline   Reply With Quote
Old Apr 23rd, 2002, 04:16 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-23 14:55, robt wrote:

Column C in sheet 2 does not contain any data. The firstnames and surnames are in columns A and B as in sheet 1. It's the personal ID number in Column C of sheet one that needs to go in column C of sheet two
OK, Rob, the last question was unnecessary. Upon close reading I see that column A and B in Sheet2 must have first names and surnames.

Since you have Id's, there must/can be duplicate first names and/or surnames.

In C1 in Sheet2 enter:

=INDEX(Sheet1!$C$1:$C$202,SUMPRODUCT(MATCH(A1&"-@-"&B1,Sheet1!$A$1:$A$202&"-@-"&Sheet1!$B$1:$B$202,0)))

Copy this down as far as needed.

Aladin


[ This Message was edited by: Aladin Akyurek on 2002-04-23 15:18 ]

[ This Message was edited by: aladin akyurek on 2002-04-23 15:53 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 23rd, 2002, 04:45 PM   #7
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-04-23 12:55, robt wrote:
Heres more info

sheet 1 contains a list of names with the firstname in A1:A202, the surname in B1:B202
and a unique ten digit personal id number in C1:C202

sheet 2 is identical to the first but there are no numbers listed in column C and only 98 names are listed, but are all present somewhere within the first sheet. I need excel to find the people in the first list and put their id number in column C, sheet 2

i.e find this persons id number from this sheet and place it next to his name in the other
Hi robt:
One of the ways you can do this is by adding temporary column D to sheet1, and add the following formula in cell D2

=A2&B2
and then drag it down to row 202
Now back in sheet2 , add the following formula in cell C2

=INDEX(Sheet1!$A$1:$D$202,MATCH(A2&B2,Sheet1!$D$1:$D$202),3)
and then drag it to the cell corresponding with the last name listed in sheet2

then highlite the cells in column C and then EDIT|COPY ... and then EDIT|PASTE_SPECIAL|VALUES to convert the formulas to static values

Now you may delete the column D that was added in sheet1.

HTH



_________________
Yogi Anand

Edit: Deleted inactive website from hardcoded signature

[ This Message was edited by: Yogi Anand on 2003-01-19 14:04 ]
Yogi Anand is offline   Reply With Quote
Old Apr 23rd, 2002, 04:49 PM   #8
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi Aladin:
Sorry, I did not see your last post until after I posted mine. Mine requires adding a temporary column in Sheet1, while yours does without any invasive surgery. So yours is abetter solution.

Regards!
Yogi Anand
Yogi Anand is offline   Reply With Quote
Old Apr 23rd, 2002, 06:20 PM   #9
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi Prof Aladin:
I am back again ... this time with a question -- oopse! I mean a set of questions:

Here is the formula that you suggested above:

=INDEX(Sheet1!$C$1:$C$202,SUMPRODUCT(MATCH(A1&"-@-"&B1,Sheet1!$A$1:$A$202&"-@-"&Sheet1!$B$1:$B$202,0)))


And here is my formula that I have modified to alleviate the need for adding a temporary column in sheet1:

'{=INDEX(Sheet1!$A$2:$C$202,(MATCH(A2&B2,Sheet1!$A$2:$A$202&Sheet1!$B$2:$B$202,0)),3)}

Obviously this is an array formula so I have intentionally shown it with the curly brackets.

On examination, it is obvious that the two formulas are substantially identical -- except that with the use of the SUMPRODUCT function, your formula does not need to be entered as an array formula (CTRL+SHIFT+ENTER).

Question 1:
Why the use of the SUMPRODUCT function ... its only argument is a MATCH function, which granted, has its own arguments

Question 2:
The use of the SUMPRODUCT function in this case obviously works ... But Why?, and How?

Question 3:
Under what other circumstances can a SUMPRODUCT function be used where its usage may not be obvious?

Thanks ... awaiting your insightful explanation

Regards!

Yogi Anand
Yogi Anand 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 09: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