stuck with VLOOKUP

  • Thread starter Thread starter yimcw
  • Start date Start date
Y

yimcw

i am new user. i use VLOOkUP to match same items from 1 wksht with th
other. "=VLOOKUP($H12,SLOW,2,FALSE)" if item of sht1 of cell H1
matches item in another sht with its range NAMED "SLOW" it should sho
the value under the colume "2", in this case is "1", if not it shoul
show "0", but when there is no match it show "#NA" instead.

plshelp me. :confused:

thank
 
1. If you have the morefunc.xll add-in...

=IF(ISNA(SETV(VLOOKUP($H12,SLOW,2,0))),0,GETV())

2. If you add the V() function to your workbook...

=IF(ISNA(V(VLOOKUP($H12,SLOW,2,0))),0,V())

Public Function V(Optional vrnt As Variant) As Variant
'
' Stephen Dunn
' 2002-09-12
'
Static vrntV As Variant
If Not IsMissing(vrnt) Then vrntV = vrnt
V = vrntV
End Function

To add this to your workbook:

Activate Tools|Macro|Visual Basic Editor;
Activate Insert|Module;
Copy the UDF above and paste it in the pane entitled "...(code)".
Activate File|Close and Return to Microsoft Excel.


3. When Microsoft considers extending lookup functions with an optional
ReturnValue as proposed eons ago...

=VLOOKUP($H12,SLOW,2,0,0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top