VLOOKUP formula inserted ONLY (dynamically) when I insert a

Cosmos75

Active Member
Joined
Feb 28, 2002
Messages
359
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
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
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))))
 
Upvote 0
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)
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,196
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top