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 16th, 2002, 11:05 AM   #1
Alexander
New Member
 
Join Date: Apr 2002
Posts: 45
Default

If I have a value in one file (A1) that needs to match to a value in another file which is in two columns (A1:B1), how do I get a return in column C. Example:
File 1
A
Cat
Dog
Pig
Horse

File 2
A B
Cat Meow
Frog Croak
Dog Woof
Chick Peep
Horse Neigh
Duck Quack
Pig Oink

File 1 should now be:
A B
Cat Meow
Dog Woof
Horse Neigh
Pig Oink


[ This Message was edited by: Alexander on 2002-04-16 10:15 ]
Alexander is offline   Reply With Quote
Old Apr 16th, 2002, 11:11 AM   #2
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default



What problem are you having with Vlookup?
What result do you get?

Could you show your formula?

If the information is not sorted and you want an exact match, add the 4th parameter
- False.



See Help for Syntax.
Dave Patton is offline   Reply With Quote
Old Apr 16th, 2002, 11:18 AM   #3
Alexander
New Member
 
Join Date: Apr 2002
Posts: 45
Default

Is there a way I can send you a copy of the files so that you may look at it and tell me how to write the formula? My email is bettillee@msn.com.
Alexander is offline   Reply With Quote
Old Apr 16th, 2002, 11:31 AM   #4
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Quote:
On 2002-04-16 10:05, Alexander wrote:
If I have a value in one file (A1) that needs to match to a value in another file which is in two columns (A1:B1), how do I get a return in column C. Example:
File 1
A
Cat
Dog
Pig
Horse

File 2
A B
Cat Meow
Frog Croak
Dog Woof
Chick Peep
Horse Neigh
Duck Quack
Pig Oink

File 1 should now be:
A B
Cat Meow
Dog Woof
Horse Neigh
Pig Oink


[ This Message was edited by: Alexander on 2002-04-16 10:15 ]
Assuming file 1 and 2 are worksheets

In B1 of file 1 enter
=VLOOKUP(A1,file2!$A$1:$B$7,2,1)
Brian from Maui is offline   Reply With Quote
Old Apr 16th, 2002, 11:36 AM   #5
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,512
Default

Hi there. Brian's explanation looks like it will work for you. If not, or if you're having difficulty understanding the vlookup formula, you can check this out:

http://www.thewordexpert.com/excel.h...DreadedVlookup

Hope it helps!
__________________
~Anne Troy
Anne Troy is online now   Reply With Quote
Old Apr 16th, 2002, 11:44 AM   #6
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default



or try Brian's formula
revised slightly

In B1 of file 1 enter
=VLOOKUP(A1,file2!$A$1:$B$7,2,0)
Dave Patton is offline   Reply With Quote
Old Apr 16th, 2002, 12:00 PM   #7
Alexander
New Member
 
Join Date: Apr 2002
Posts: 45
Default

This works fine, except file 1 has 2000 lines and file 2 will vary, from 100 to 1000. It is not matching correctly.
Alexander is offline   Reply With Quote
Old Apr 16th, 2002, 12:12 PM   #8
Alexander
New Member
 
Join Date: Apr 2002
Posts: 45
Default

Never mind. I was wrong. It works great and thank you all!
Alexander is offline   Reply With Quote
Old Apr 16th, 2002, 12:17 PM   #9
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Quote:
On 2002-04-16 11:00, Alexander wrote:
This works fine, except file 1 has 2000 lines and file 2 will vary, from 100 to 1000. It is not matching correctly.
If column A in file 2 has data that is repeated, it will match the first data that is repeated. Not sure what you mean by file 2 will vary, but you can name the range in file 2 i.e =vlookup(a1,range name,2,0)
Brian from Maui 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 03:21 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