# [SOLVED] Excel 2003 - Can a value of #N/A from a VLOOKUP be trapped in an IF statemen



## Dragoen (Apr 10, 2009)

I am using a VLOOKUP function and have a situation where the lookup_value column of the table_array may be blank on purpose. Currently the VLOOKUP displays #N/A in the programmed cell since there is no lookup_value. Is there a way to wrap this VLOOKUP function with an IF statement or some other code, to trap for the unknown and return a blank for example? I've tried using isnull - IF(isnull(vlookup(J76,S76:T87,2,false)...)) but couldn't get that to work.

TIA


----------



## macropod (Apr 11, 2008)

*Re: Excel 2003 - Can a value of #N/A from a VLOOKUP be trapped in an IF statement*

Hi Dragoen,

Try using ISERROR instead -
IF(ISERROR(VLOOKUP(J76,S76:T87,2,false)),"",VLOOKUP(J76,S76:T87,2,false))


----------



## Dragoen (Apr 10, 2009)

*Re: Excel 2003 - Can a value of #N/A from a VLOOKUP be trapped in an IF statement*

Thanks macropod,

That did the trick. I was hoping you had a quick fix for that one! :4-bounce:


----------

