error.type

  • Thread starter Thread starter Scott Butler
  • Start date Start date
S

Scott Butler

Can anyone help?
I'm using the following function in an effort to stop #N/A
appearing in cells:
=IF(ERROR.TYPE(VLOOKUP(G3,UserDetails,2,FALSE))=7,"",IF
(ISBLANK(G3),"",VLOOKUP(G3,UserDetails,2,FALSE)))

Heres the problem if the first if statment is true, true
is returned and the cell remains blank. However if the
statment is false i.e. no error, #N/A not false is
returned and #N/A displyed in the cell.

I'm using excel 97 SR2
 
...
...
I'm using the following function in an effort to stop #N/A
appearing in cells:
=IF(ERROR.TYPE(VLOOKUP(G3,UserDetails,2,FALSE))=7,"",IF
(ISBLANK(G3),"",VLOOKUP(G3,UserDetails,2,FALSE)))
...

Don't use ERROR.TYPE for this. Use ISNA.

=IF(ISNA(VLOOKUP(G3,UserDetails,2,0)),"",
VLOOKUP(G3,UserDetails,2,0))

You don't need the ISBLANK test at all unless "" is a leftmost column entry in
UserDetails, in which case it's poor design that all other columns in that row
aren't also "" or blank.
 
Thank you makes much more sense
-----Original Message-----
...
...
...

Don't use ERROR.TYPE for this. Use ISNA.

=IF(ISNA(VLOOKUP(G3,UserDetails,2,0)),"",
VLOOKUP(G3,UserDetails,2,0))

You don't need the ISBLANK test at all unless "" is a leftmost column entry in
UserDetails, in which case it's poor design that all other columns in that row
aren't also "" or blank.
 
Back
Top