To check whether a cell does not contain an Excel error, use =NOT(ISERROR(A2)), replacing A2 with the cell you want to test. It returns TRUE when the value is not an error and FALSE when it is an error, making it useful in logical tests, quality checks, and formulas that need to treat errors differently from valid results.
The basic formula and what it returns
Assume A2 contains the value or formula result you want to inspect. Enter this formula in another cell:
=NOT(ISERROR(A2))
If A2 contains 25, text such as Ready, or a blank cell, the result is TRUE. If A2 contains an error such as #N/A or #DIV/0!, the result is FALSE. The formula does not change A2 or repair the error; it reports whether the value being tested is an error.
Here, ISERROR checks the value and returns TRUE for an error or FALSE for a non-error. NOT reverses that logical result. In other words, the test asks whether ISERROR is false. A result of TRUE therefore means “not an error,” not necessarily “correct,” “complete,” or “usable.” A text entry that is misspelled, a number outside an expected range, or an empty cell still passes this particular test.
To see the opposite result—the formula reports TRUE when the cell is an error—assume the value to test is in A2:
=ISERROR(A2)
That version can be clearer when the next step is to flag errors for review. Choose the polarity that makes the rest of your formula easier to read.
How ISERROR handles Excel errors
ISERROR recognizes Excel error values, including familiar errors such as #DIV/0!, #N/A, #NAME?, #NUM!, #REF!, and #VALUE!. It also detects errors produced by newer Excel features, such as a spilled-array problem. The error can be typed or returned by a formula: the test cares about the resulting value, not how it got there.
For example, a cell containing a lookup formula might currently show #N/A because no match was found. The not-an-error test returns FALSE for that result. If the lookup later finds a match, the result changes to TRUE. This makes the test responsive to recalculation and changes in the source data.
ISERROR does not identify why a calculation failed. Its answer is simply a logical TRUE or FALSE. If you need to distinguish a missing lookup result from a divide-by-zero problem, use a more specific test or handle the error at the formula that creates it. A broad error test is convenient when all errors should receive the same treatment; it is less informative when different errors require different actions.
Examples for status checks and readable results
A TRUE or FALSE result is useful for filtering, counting, or building another formula, but a worksheet may be easier to read with words. Assume A2 contains a value, a formula result, or an error:
=IF(NOT(ISERROR(A2)),"OK","Error")
This returns OK for any non-error value and Error for any error. A blank A2 also produces OK, because a blank is not an error. If blanks should have a separate status, add a blank check as a separate condition rather than assuming the error test will detect missing information.
You can also return the original value when it is valid and show a message when it is an error. Assume A2 is the source cell and the formula is entered somewhere else:
=IF(NOT(ISERROR(A2)),A2,"Check input")
For an ordinary number such as 25, this returns 25; for an error value, it returns Check input. This can make a report cleaner, but it can also hide useful diagnostic detail. Keep the original calculation available if someone needs to investigate the cause.
For a calculation that can fail, IFERROR is often more direct. Assume A2 contains a numerator and B2 contains a denominator, with 10 in A2 and 2 in B2:
=IFERROR(A2/B2,"Check inputs")
The result is 5. If B2 is zero, the division would produce #DIV/0!, so the formula displays Check inputs instead. IFERROR handles errors from the expression inside it; it does not tell you whether the result was an error unless you arrange for the output to show that distinction.
Choosing between ISERROR, IFERROR, and ISERR
These functions solve related but different problems. Use NOT with ISERROR when you need a logical test that is TRUE for any non-error value. Use IFERROR when you want to replace an error result with a fallback value or message. Use ISERROR alone when you want a TRUE result specifically to mark an error.
ISERR is a narrower test: it detects errors except #N/A. That difference matters in lookup work, where #N/A often means “no match.” If you test A2 and want TRUE only when it is not one of the errors ISERR recognizes, the following formula does that:
=NOT(ISERR(A2))
Because ISERR does not classify #N/A as an error for its test, this formula returns TRUE for #N/A. That may be appropriate when a missing match is an acceptable outcome, but it is not equivalent to checking for every Excel error. For the broad meaning of “not an error,” use NOT with ISERROR.
There is also a more specific check for #N/A. Assume A2 contains the value or result to inspect:
=ISNA(A2)
This returns TRUE for #N/A and FALSE for other values, including other error types. A specific test is useful when the response to a missing match should differ from the response to a broken reference or invalid calculation.
Common pitfalls and how to avoid them
- Confusing valid with correct: A text value, blank, or unexpected number is not an Excel error, so the basic test returns TRUE. Add checks for the conditions your data actually requires.
- Hiding errors too early: Replacing every error with an empty string or a generic message can make a report look tidy while concealing a broken formula. During analysis, it may be better to keep the original error visible or use a specific message.
- Testing the wrong cell: If A2 contains a formula that refers to another cell, test A2 to check its displayed result. Testing the source cell instead answers a different question.
- Expecting formatting to remove an error: Number formats and cell colors change how a value appears, not whether it is an error. A cell displaying an error remains an error for ISERROR.
- Assuming a blank is an error: A truly empty cell is not an error. Nor is text that looks like an error, such as the characters #N/A stored as ordinary text.
- Using the narrow test by accident: NOT with ISERR treats #N/A differently from NOT with ISERROR. Use the latter when all error types should count as errors.
One practical way to debug a complicated result is to put the test in a temporary neighboring cell. If it returns FALSE, the tested value is an error; inspect the original formula and its inputs. If it returns TRUE but the result is still unsuitable, the problem is likely a data-quality or business-rule issue rather than an Excel error.
Where to use the test in a workbook
The logical result can drive an IF formula, a filter, or a summary. For example, a column of TRUE and FALSE results can be filtered to show rows with errors, or counted to estimate how many records need attention. If you use the test as part of a larger formula, keep the cell reference aligned with the row so it checks each record as intended.
In Microsoft 365 Excel for Windows, enter the formula in a cell and press Enter. To apply it down a column, use the fill handle or copy and paste it into the other rows; relative references such as A2 adjust as the formula moves. On Mac, the formula works the same way, although some keyboard shortcuts and interface details differ. Excel for the web also supports these longstanding functions.
In some regional settings, Excel uses semicolons rather than commas to separate function arguments. The examples here use commas, as in a standard English-language installation. If Excel rejects a formula despite its logic being correct, your regional list-separator setting may require a different separator. The function names and the basic NOT-and-ISERROR approach remain the same.
Frequently Asked Questions
What formula returns TRUE if a cell is not an error?
Assuming the cell to check is A2, use =NOT(ISERROR(A2)). It returns TRUE for any non-error value and FALSE for an Excel error.
Does ISERROR catch #N/A?
Yes. ISERROR treats #N/A as an error, so NOT with ISERROR returns FALSE when the tested cell contains #N/A. ISERR is different because it excludes #N/A from the errors it detects.
How do I show text instead of an error?
Use IFERROR around the calculation or reference and provide a fallback message. For instance, the division example above displays Check inputs if the calculation produces an error. Choose a message that is useful to the person reading the sheet.
Does the not-an-error formula consider a blank cell valid?
Yes. A blank is not an error, so the test returns TRUE. If your definition of valid also requires a value, combine the error check with a separate blank or content check.
Can this formula tell me what caused the error?
No. It only reports whether the value is an error. To find the cause, inspect the formula and its references, or use a specific test such as ISNA when you need to identify a particular error type.
Related
- Microsoft Excel Solver Add-In: Setup and How It Works
- Microsoft Excel Shortcut Keys: Essential Commands
- Microsoft Excel Scenario Manager: Setup, Uses, and Limits
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- XLOOKUP Spill Error: Why It Happens and How to Fix ItAn XLOOKUP spill error usually means Excel cannot place all the results returned by the formula into the…
- Excel Page Breaks: Why There Are Too Many and How to FixIf Excel says there are too many page breaks, the worksheet has reached its page-break capacity, or its…
- VLOOKUP #VALUE! Error: Causes and FixesA VLOOKUP formula returns #VALUE! most often when its column index argument is less than 1, or when…
- Excel Error Messages: What They Mean and How to Fix ThemExcel error messages are codes such as #DIV/0!, #VALUE!, and #REF! that show a formula could not return…
- Excel Find Not Working? Fix Search and Find SettingsIf Excel Find is not working, press Ctrl+F, open Options, and check the search scope and Look in…
- Outlook 365 Not Working Today? Check Status and FixesOutlook 365 may be affected by a Microsoft service incident, but I can’t verify live outage conditions from…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.