Link to home
Start Free TrialLog in
Avatar of Tocogroup
TocogroupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I test for a cell that contains a #N/A result from an Excel formula ?

Hi All,

I have a VLOOKUP formula in cell B6 which returns a value of #N/A. How can I test that cell (in another cell) for such an error ?

I've tried..

=IF(B6="#N/A",.........

but that doesn't work. How would I also test for this in VBA ?

Thanks in anticipation
Toco
ASKER CERTIFIED SOLUTION
Avatar of [ fanpages ]
[ fanpages ]

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can use the function ISNA()

And in VBA you can use application.worksheetfunction.isna()

There are also functions such as ISERROR or IFERROR for handling error results.
You can start something like this


=IFERROR(B2,

so

=IFERROR(B2, "ERROR FOUND")

Open in new window


This would work for any error, not just "#N/A"
Avatar of Tocogroup

ASKER

Thanks everyone for your quick responses.

fp, as you were first out of the blocks I'll award you the points.
Thanks again
Toco