I'm using VLOOKUP to search for results in another worksheet. What I need is 0 returned if the search fails. Currently I'm getting #N/A and that's causing my other formulas to fail.
Any suggestions???
TIA
I'm using VLOOKUP to search for results in another worksheet. What I need is 0 returned if the search fails. Currently I'm getting #N/A and that's causing my other formulas to fail.
Any suggestions???
TIA
Last edited by Tanasi; 03-27-2009 at 12:04 PM.
A couple...
=IF(ISNA(VLOOKUP(....)),0,VLOOKUP(....))
or assuming results of VLOOKUP when found are numeric then another alternative:
=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(...)))
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
In the first suggestion simply replace the references to VLOOKUP(...) with your own VLOOKUP, ie:
=IF(ISNA(VLOOKUP(C1,'Import-A'!A:H,3,0)),0,VLOOKUP(C1,'Import-A'!A:H,3,0))
Note: given you're pulling Column C you need not reference A:H you could just reference A:C thereby reducing dependencies... you could use INDEX/MATCH to reduce further but that's for another day.
=--existing formula
assumes results either numeric or logical (boolean true / false)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks