Start Free Trial
← Back to Blog

Handling and Blanking Out Excel Errors

This is how to immediately fix Excel errors. Errors in Excel can disrupt your data analysis and make your spreadsheets look unprofessional. Fortunately, Excel provides functions to handle these errors gracefully. Two key functions for managing errors are IFERROR and NA. This article will explain how to use these functions to manage errors effectively and ensure your spreadsheets are both accurate and user-friendly.

Understanding Excel Errors

Excel errors can occur for various reasons, including:

Handling these errors properly ensures your spreadsheets function as intended and provides meaningful results.

1. Using IFERROR

The IFERROR function allows you to manage errors in formulas by providing an alternative value or action when an error occurs.

Syntax:

=IFERROR(value,value_if_error)

Example: Handling Division by Zero

Imagine you have a formula that divides one number by another:

=A2/B2

If B2 is zero, this will result in a #DIV/0! error. To handle this error and display a custom message instead:

=IFERROR(A2/B2,"Division by zero error")

If B2 is zero, the formula will return "Division by zero error" instead of #DIV/0!.

Example: Using IFERROR with Lookup Functions

When using lookup functions like VLOOKUP, you might encounter the #N/A error if the lookup value is not found. To handle this:

=IFERROR(VLOOKUP(D2,A:B,2,FALSE),"Value not found")

If the lookup fails, the formula returns "Value not found" instead of #N/A.

Use Case:

2. Using NA

The NA function returns the #N/A error, which indicates that a value is not available. This function is often used in data analysis to handle cases where data might be missing or not applicable.

Syntax:

=NA()

Example: Marking Missing Data

In a dataset, you might want to mark missing data points explicitly:

=IF(ISBLANK(A2),NA(),A2)

If A2 is blank, this formula returns #N/A. Otherwise, it returns the value in A2.

Example: Handling Missing Data in Charts

When creating charts, #N/A values are ignored, which can be useful for leaving gaps in the chart rather than displaying errors. For instance, in a time series chart, you might use:

=IF(A2="",NA(),A2)

This ensures that gaps in the data do not distort the chart’s appearance.

Use Case:

Best Practices for Handling Errors

  1. Use IFERROR for User-Friendly Messages: Customize error messages to make it clear why a formula failed and provide guidance on how to fix it.
  2. Use NA to Mark Missing Data: Utilize #N/A to indicate missing or not applicable data, especially in charts to maintain visual clarity.
  3. Combine with Other Functions: You can combine IFERROR with other functions for more complex error handling. For example, use IFERROR within nested formulas to manage multiple error scenarios.
  4. Validate Inputs: Ensure that your data inputs are valid before performing calculations to minimize errors.
  5. Test Formulas: Regularly test and review your formulas to ensure they handle errors as expected and provide accurate results.

Effectively managing errors in Excel with functions like IFERROR and NA helps keep your spreadsheets accurate and user-friendly. By customizing error messages and marking missing data, you can ensure that your formulas provide meaningful results and enhance the overall usability of your spreadsheets. Whether you're handling calculations, lookups, or charting, mastering these functions will improve your Excel skills and data management.

Frequently Asked Questions

What is the IFERROR function in Excel and when should you use it? IFERROR checks a formula for errors and returns an alternative value instead of displaying the error. Use it any time a formula might produce an error that would confuse a reader or break a spreadsheet, such as division by zero, failed lookups, or invalid references.

What is the difference between IFERROR and NA in Excel? IFERROR suppresses errors and replaces them with a custom message or value you choose. NA deliberately inserts a not available error to flag missing or inapplicable data. One hides errors from the reader while the other intentionally marks gaps in your data for analytical purposes.

How do you stop VLOOKUP from showing an error when a value is not found? Wrap the VLOOKUP inside IFERROR and specify what to display when the lookup fails. For example =IFERROR(VLOOKUP(D2,A:B,2,FALSE),"Value not found") returns the text Value not found instead of the NA error when the lookup value does not exist in the range.

Why would you intentionally use the NA function in Excel? NA is useful for marking missing data points in datasets and charts. When creating charts Excel ignores NA values and leaves a gap rather than plotting a zero or an error which keeps your visualization accurate and clean.

What are the most common Excel errors and what causes them? The most common errors are DIV/0 from dividing by zero, NA from a missing lookup value, VALUE from the wrong type of data in a formula, REF from a deleted or invalid cell reference, and NAME from a misspelled function name. Understanding what triggers each error makes them much faster to diagnose and fix.

What is the best practice for handling errors in Excel formulas? Use IFERROR to display meaningful messages that explain why a formula failed rather than leaving cryptic error codes. Validate your input data before running calculations, combine IFERROR with nested formulas for complex scenarios, and test formulas regularly to confirm they handle edge cases correctly.

Learn more about Excel here

How to make a project progress dashboard in Excel

All Excel formatting options explained

10 Tips for Creating Dashboards in Excel and Google Sheets

10 Excel Functions Every User Should Know

Top Excel Interview Questions

The Best Excel Tricks

The Excel Dictionary of Functions

How to Create Excel Charts

Comparing Versions of Excel

📁 Get All Templates Free →

Opens in Google Drive — view and download for free

Ready to try Updoot free?

GPS time tracking, scheduling, HR, payroll, CRM, and more in one platform built for small business.

Start Free Today