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 22nd, 2002, 12:38 PM   #1
JimH
Board Regular
 
Join Date: Apr 2002
Posts: 64
Default

I'm trying to use Vlookup to find a part number in an inventory workbook and put the associated cost of that part in another workbook. The problem is that the particular part number that I'm looking for could be located in either of two different worksheets in the inventory workbook. I have each separate vlookup formula working fine, but I don't know how to link them together so that when the first vlookup formula can't find the part number in the first worksheet, it goes to the second.
JimH is offline   Reply With Quote
Old Apr 22nd, 2002, 01:31 PM   #2
Ricky Morris
Board Regular
 
Join Date: Mar 2002
Posts: 363
Default

Quote:
On 2002-04-22 11:38, JimH wrote:
I'm trying to use Vlookup to find a part number in an inventory workbook and put the associated cost of that part in another workbook. The problem is that the particular part number that I'm looking for could be located in either of two different worksheets in the inventory workbook. I have each separate vlookup formula working fine, but I don't know how to link them together so that when the first vlookup formula can't find the part number in the first worksheet, it goes to the second.
Assuming you have the vlookup formula based on the first sheet in cell A1 and the formula based on the second sheet in A2, try the following:

=IF(ISERROR(A1),A2,A1)

_________________
It's never too late to learn something new.

Ricky

[ This Message was edited by: Ricky Morris on 2002-04-22 12:32 ]
Ricky Morris is offline   Reply With Quote
Old Apr 22nd, 2002, 01:51 PM   #3
croweld89
New Member
 
Join Date: Mar 2002
Posts: 34
Default

Two Solutions

Solution #1 Since you already have both vlookup formulas working you could hide both columns and place and if statement in view.
For example,

(hide) (hide)
Column A Column B Column C
Vlookup 1 Vlookup 2 IF STMT

Modify your formulas to the following:
Col A =if(isna(vlookup 1,0,vlookup 1)
Col B =if(isna(vlookup 2,0,vlookup 2)
Col C =if(A1>0,A1,B1)

Warning: This will only work if your part numbers are numeric only, and will also cause a problem if the part has any chance of being on both pages.

Solution #2
Since vlookup takes the first solution found, you could just sum the two formulas...

=vlookup 1 + vlookup 2

Hope this points you in the right direction
-Dave
croweld89 is offline   Reply With Quote
Old Apr 23rd, 2002, 09:28 AM   #4
JimH
Board Regular
 
Join Date: Apr 2002
Posts: 64
Default

I still can't get this to work. The following two formulas work fine independently. When the first formula can't find the part number in the Item worksheet and returns #N/A, I need it to go to the Floor Stock worksheet (second formula) to look for the part number.

=VLOOKUP(B6,'[Wisard Inventory.xls]Item'!$G$4:$BJ$347,56,FALSE)

=VLOOKUP(B6,'[Wisard Inventory.xls]Floor Stock'!$E$2:$M$124,9,FALSE)

JimH is offline   Reply With Quote
Old Apr 23rd, 2002, 09:32 AM   #5
AJ
Board Regular
 
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
Default

Try this - don't know if it'll work but worth a go...

=IF(ISERROR(VLOOKUP(B6,'[Wisard Inventory.xls]Item'!$G$4:$BJ$347,56,FALSE)),VLOOKUP(B6,'[Wisard Inventory.xls]Floor Stock'!$E$2:$M$124,9,FALSE),VLOOKUP(B6,'[Wisard Inventory.xls]Item'!$G$4:$BJ$347,56,FALSE))
AJ is offline   Reply With Quote
Old Apr 23rd, 2002, 10:21 AM   #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 08:28, JimH wrote:
I still can't get this to work. The following two formulas work fine independently. When the first formula can't find the part number in the Item worksheet and returns #N/A, I need it to go to the Floor Stock worksheet (second formula) to look for the part number.

=VLOOKUP(B6,'[Wisard Inventory.xls]Item'!$G$4:$BJ$347,56,FALSE)

=VLOOKUP(B6,'[Wisard Inventory.xls]Floor Stock'!$E$2:$M$124,9,FALSE)
Where exactly do you have this formula?
Aladin Akyurek is offline   Reply With Quote
Old Apr 23rd, 2002, 01:05 PM   #7
JimH
Board Regular
 
Join Date: Apr 2002
Posts: 64
Default

The vlookup formula resides in a spreadsheet named Part List Template which is separate from the Wisard Inventory spreadsheet. The first vlookup works fine until I try to combine it with the second.
JimH is offline   Reply With Quote
Old Apr 23rd, 2002, 01:08 PM   #8
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:05, JimH wrote:
The vlookup formula resides in a spreadsheet named Part List Template which is separate from the Wisard Inventory spreadsheet. The first vlookup works fine until I try to combine it with the second.
In which cell in Part List Template?
Aladin Akyurek is offline   Reply With Quote
Old Apr 24th, 2002, 11:12 AM   #9
JimH
Board Regular
 
Join Date: Apr 2002
Posts: 64
Default

Column I in the Part List Template.
JimH is offline   Reply With Quote
Old Apr 24th, 2002, 12:14 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-24 10:12, JimH wrote:
Column I in the Part List Template.
Jim,

=IF(COUNTIF('[Wisard Inventory.xls]Item'!$G$4:$G$347,B6),VLOOKUP(B6,'[Wisard Inventory.xls]Item'!$G$4:$BJ$347,56,0),VLOOKUP(B6,'[Wisard Inventory.xls]Floor Stock'!$E$2:$M$124,9,0))

should work. You'll get #N/A when B6 is not found in both lookup tables. Note also that I substituted 0 for FALSE because it's same thing for VLOOKUP.

Aladin
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 04:44 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