View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Brad[_10_] Brad[_10_] is offline
external usenet poster
 
Posts: 27
Default Need help with VLOOKUP

In the worksheet function use IsError and evaluate the
result.

=IF(ISERROR(VLOOKUP(B13,Rmain!
$A$1:$B$2000,2,FALSE)),"None",VLOOKUP(B13,Sheet2!
$A$1:$B$2000,2,FALSE))

If it's any of the Excel error values #DIV/0 or #N/A,
IsError() returns true.

HTH
-Brad

-----Original Message-----
I want to use VLOOKUP in a few cells. The VLOOKUP

function is dependant
on the left adjacent cells. But those cells can also be

empty. If they
are, VLOOKUP returns the value #N/A. I want to suppress

that result.

I was thinking of using an IF statement like this:

ActiveCell.FormulaR1C1 =
"=IF(RC[-1]="""","""",=VLOOKUP(B13,rmain!$A$1:$B$2000,2))"


But when I add this I get the following message:

"Runtime error 1004:
Application-define or object-defined error"

What am i doing wrong?


---
Message posted from http://www.ExcelForum.com/

.