ISNA – Test if cell is #N/A – Excel, VBA, & Google Sheets
Written by
Reviewed by
Download the example workbook
This tutorial demonstrates how to use the ISNA Function in Excel and Google Sheets to test if a cell results in #N/A.
How to use the ISNA Function
The ISNA Function checks if a calculation results in any error, except the #N/A error.
=ISNA(A2)
ISERROR, ISERR, and ISNA
There are two other error checking “is” functions:
- The ISERROR Function returns TRUE for all errors.
- The ISERR Function returns TRUE for all errors except #N/A errors.
The different “is error” functions exist so you can decide what to do about potentially valid #N/A errors.
IFNA Function
Instead of the ISNA Function, you can also use the IFNA Function to do something if an error is detected (instead of simply returning TRUE / FALSE).
Other Logical Functions
Excel / Google Sheets contain many other logical functions to perform other logical tests. Here is a list:
IF / IS Functions |
---|
iferror |
iserror |
isna |
iserr |
isblank |
isnumber |
istext |
isnontext |
isformula |
islogical |
isref |
iseven |
isodd |
ISNA in Google Sheets
The ISNA Function works exactly the same in Google Sheets as in Excel:
ISNA Examples in VBA
You can also use the ISNA function in VBA. Type:
application.worksheetfunction.isna(value)
On the sheet below
Executing the following VBA code
Range("A2") = Application.WorksheetFunction.IsNA(Range("A1"))
Range("B2") = Application.WorksheetFunction.IsNA(Range("B1"))
will return TRUE for cell A1, which is #N/A, and false for cell B2 which is 5
For the function arguments (value, etc.), you can either enter them directly into the function, or define variables to use instead.