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

Wow, thanks Franz, that worked great. Now a follow-up question: I am having
the same problem using INDEX and MATCH....here is what I have:


=IF(INDEX(Sheet2!$B$2:$B$9000,MATCH(1,(Sheet1!$A$2 :$A$9000=Sheet2!$A2)*(Sheet1!$E$2:$E$9000=Sheet2!$ E2),0))
<
INDEX(Sheet1!$B$2:$B$9000,MATCH(1,(Sheet2!$A$2:$A$ 9000=Sheet1!$A2)*(Sheet2!$E$2:$E$9000=Sheet1!$E2), 0)),
INDEX(Sheet2!$B$2:$B$9000,MATCH(1,(Sheet1!$A$2:$A$ 9000=Sheet2!$A2)*(Sheet1!$E$2:$E$9000=Sheet2!$E2), 0)), "")


I am trying to see if the value in sheet1 and sheet2 that are respective to
their identifiers (in columns A and E) are equal. If they are equal, i dont
show anything, but if they are different, I want to show the value in Sheet2.
Is this formula way over complicated? Also, can i use indirect on this
formula to get rid of the #N/A references?


Thanks in advance!



"Franz Verga" wrote:

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