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 12th, 2002, 11:16 AM   #1
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

I have an excel spreadsheet that contains a sheet with a list of items with each item assigned a category and value. In that spreadsheet I have another sheet that does uses VLOOKUP formulas to find the associated category and value when I enter the item name.

Is there a way to have the VLOOKUP formula inserted ONLY when I insert a value?

One more question. Is there I way I can export this data into an MS ACCESS database and have the VLOOKUP formula in a query page? At first my sheet works fine, but it is taking longer and longer to calculate, as I now have close to 1400 items. Can the two be linked so that one is updated, the other is updated as well?

THANKS!

[ This Message was edited by: Cosmos75 on 2002-04-12 14:50 ]
Cosmos75 is offline   Reply With Quote
Old Apr 12th, 2002, 12:23 PM   #2
croweld89
New Member
 
Join Date: Mar 2002
Posts: 34
Default

My suggestion to autofill vlookup formulas would be to go ahead and populate the specific area with the following formula:

=if(isna( your vlookup formula ),""( your vlookup formula ))

The formulas will remain blank until you add the reference data.

Hope this works for you

-Dave
croweld89 is offline   Reply With Quote
Old Apr 12th, 2002, 12:43 PM   #3
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

Thanks, croweld89. Will try it out.

Would that be faster than using VBA? Is there anything I can put in the sheet code, by right-clicking the sheet and choosing View Code?
Cosmos75 is offline   Reply With Quote
Old Apr 12th, 2002, 12:48 PM   #4
Big Blue
Board Regular
 
Join Date: Mar 2002
Location: Ontario
Posts: 52
Default

Great idea - will use this myself. I'm sure Cosmos deosn't need my help, but for any newbies, I think there should be a comma after the double quotes in the if stmt.
Big Blue is offline   Reply With Quote
Old Apr 12th, 2002, 12:57 PM   #5
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

croweld89, Here's what I've used in my spreadsheet which is somewhat like yours.

=IF(A1="","",IF(ISERROR(VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE)),"",IF(VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE)="","",VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE))))
Cosmos75 is offline   Reply With Quote
Old Apr 13th, 2002, 05:21 PM   #6
daleyman
Board Regular
 
Join Date: Mar 2002
Location: London, UK
Posts: 167
Default

yeah that's cool, but i think you maybe got carried away with the nesting. your deepest level nest is not required, as if the vlookup returns "" then it does any way, you do not need:

if(FormulaX="","",FormulaX)
__________________

<table style="background-color:#0e54be" cellspacing="1" cellpadding="2"><td style="background-color:#ceffff;font-family:arial;color:#072c63;font-size:8pt;">***DALEY** :P**</td></table>
daleyman is offline   Reply With Quote
Old Apr 13th, 2002, 05:29 PM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-12 11:57, Cosmos75 wrote:
croweld89, Here's what I've used in my spreadsheet which is somewhat like yours.

=IF(A1="","",IF(ISERROR(VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE)),"",IF(VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE)="","",VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,FALSE))))
This formula is too costly. You can shorten this to:

=IF(AND(A1="",COUNTIF('Master List'!$A$5:$A$4004,A1)),VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,0),"")

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 13th, 2002, 11:03 PM   #8
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

Aladin,

Why the COUNTIF('Master List'$A$5:$A$4004,A1)?
Cosmos75 is offline   Reply With Quote
Old Apr 13th, 2002, 11:20 PM   #9
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-13 22:03, Cosmos75 wrote:
Aladin,

Why the COUNTIF('Master List'$A$5:$A$4004,A1)?
The COUNTIF is part of the IF test condition. If it is <> 0 then true and do the vlookup, else false and return "".

Very nice job. BTW, I think Aladin has a slight typo

Change
=IF(AND(A1="",...

to

=IF(AND(A1<>"",...

Regards,
Jay
Jay Petrulis is offline   Reply With Quote
Old Apr 14th, 2002, 02:33 AM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-13 22:03, Cosmos75 wrote:
Aladin,

Why the COUNTIF('Master List'$A$5:$A$4004,A1)?
It checks whether A1 itself exist in Master List before VLOOKUP attempts to fetch the value associated with it. Doing this check with COUNTIF is more efficient than doing it with VLOOKUP with ISNA (or ISERROR). BTW, as Jay noted, the AND part has a typo:

A1="" should be A1<>""

If the range $A$5:$A$4004 does not contain ant blanks, we can further shorten the formula to:

=IF(COUNTIF('Master List'!$A$5:$A$4004,A1),VLOOKUP($A1,'Master List'!$A$5:$B$4004,2,0),"")

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 11:25 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