View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Franz Verga
 
Posts: n/a
Default VLOOKUP - returning the searched for value if it does not exist

Nel post
*njuneardave* ha scritto:

I am searching for a value from one table to another (the value is
located in
Column A in Sheet2 and column H in Sheet1). The formula seen below
is what I
have been using (in Sheet3)

=IF(ISNA(VLOOKUP(Sheet2!A2,Sheet1!$H$2:$H$9000,1,F ALSE)),IF(BTypesInputTable!A2
= "","",BTypesInputTable!A2),"")


the IF statement will convert a null value to a blank space instead
of a
zero. But, if the value that im searching for is deleted in Sheet2,
i get an #N/A. Shouldnt this formula just skip a deleted row and go
to the next? (the row is completely deleted....it is not a blank row)



Such a beaviour is due because the value you are looking for is not in the
same sheet af the formula. To skip the problem you can use the INDIRECT
function:

=IF(ISNA(VLOOKUP(INDIRECT("Sheet2!A2"),Sheet1!$H$2 :$H$9000,1,FALSE)),IF(BTypesInputTable!A2=
"","",BTypesInputTable!A2),"")



--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy