TekRevue

  • Home
  • OS X
  • Windows
  • Mobile
  • Games
  • Home Theater
  • Reviews
  • Editorials
  • Tips
    • Windows
    • Mac
    • Mobile
  • Twitter
  • Facebook
  • Google+
  • Feed

 020

Tips

How to Hide Excel Errors with the IF and ISERROR Functions

By Jim Tanous on April 8, 2015 at 5:27 AM • @mggjim

Microsoft Excel is a powerful and versatile spreadsheet application that is great for tracking and managing everything from enterprise inventory, to small business budgets, to personal fitness. One of the benefits of Excel is that you can set up formulas ahead of time which will automatically update as you enter new data. Some formulas, unfortunately, are mathematically impossible without the requisite data, resulting in errors in your table such as #DIV/0!, #VALUE!, #REF!, and #NAME?. While not necessarily harmful, these errors will be displayed in your spreadsheet until corrected or until the required data is entered, which can make the overall table less attractive and more difficult to understand. Thankfully, at least in the case of missing data, you can hide Excel errors with some help from the IF and ISERROR functions. Here’s how to do it.

Don’t wait another day to Level Up Your Life! Join the Nerd Fitness Rebellion and learn how to use your favorite video games, books, and movies as inspiration for adventure.

We’re using a small weight loss tracking spreadsheet as an example of the kind of table that would produce a calculation error (weight lost percentage calculation) while waiting for new data (subsequent weigh-ins).

excel #div/0! error

Our example spreadsheet waits for input in the Weight column and then automatically updates all other columns based upon the new data. The problem is that the Percent Lost column relies on a value, Change, that hasn’t been updated for the weeks in which weight has not yet been entered, resulting in a #DIV/0! error, which indicates that the formula is attempting to divide by zero. We can solve this error three ways:

  1. We can remove the formula from the weeks in which no weight has been entered, and then manually add it back in each week. This would work in our example because the spreadsheet is relatively small, but wouldn’t be ideal in larger and more complicated spreadsheets.
  2. We can calculate percent lost using another formula that doesn’t divide by zero. Again, this is possible in our example, but might not always be depending on the spreadsheet and data set.
  3. We can use the ISERROR function, which when coupled with an IF statement lets us define an alternate value or calculation if the initial result returns an error. This is the solution we’ll show you today.

The ISERROR Function

By itself, ISERROR tests the designated cell or formula and returns “true” if the result of the calculation or the value of the cell is an error, and “false” if it is not. You can use ISERROR simply by entering the calculation or cell in parentheses following the function. For example:

ISERROR((B5-B4)/C5)

If the calculation of (B5-B4)/C5 returns an error, then ISERROR will return “true” when paired with a conditional formula. While this can be utilized in many different ways, its arguably most useful role is when paired with the IF function.

The IF Function

The IF function is used by placing three tests or values in parentheses separated by commas: IF(value to be tested,value if true,value if false). For example:

IF(B5>100,0,B5)

In the example above, if the value in the cell B5 is greater than 100 (which means the test is true), then a zero will be shown as the cell value. But if B5 is less than or equal to 100 (which means the test is false), the actual value of B5 will be shown.

IF and ISERROR Combined

The way we combine the IF and ISERROR functions is by using ISERROR as the test for an IF statement. Let’s turn to our weight loss spreadsheet as an example. The reason that cell E6 is returning a #DIV/0! error is because its formula is attempting to divide the total weight lost by the previous week’s weight, which isn’t yet available for all weeks and which effectively acts as trying to divide by zero.

But if we use a combination of IF and ISERROR, we can tell Excel to ignore the errors and just enter 0% (or any value we want), or simply complete the calculation if no errors are present. In our example, this can be accomplished with the following formula:

IF(ISERROR(D6/B5),0,(D6/D5))

excel if iserror function

To reiterate, the formula above says that if the answer to D6/D5 results in an error [IF(ISERROR(D6/B5),0,(D6/D5))], then return a value of zero [IF(ISERROR(D6/B5),0,(D6/D5))]. But if D6/B5 does not result in an error, then simply display the solution to that calculation [IF(ISERROR(D6/B5),0,(D6/D5))].

With that function in place, you can copy it to any remaining cells and any errors will be replaced with zeros. However, as you enter new data in the future, the affected cells will automatically update to their correct values because the error condition will no longer be true.

hide excel errors

Keep in mind that when trying to hide Excel errors you can use just about any value or formula for all three variables in the IF statement; it doesn’t have to be a zero or whole number like in our example. Alternatives include referencing an entirely separate formula or inserting a blank space by using two quotation marks (“”) as your “true” value. To illustrate, the following formula would display a blank space in the event of an error instead of a zero:

IF(ISERROR(D6/B5),"",(D6/D5))

Just remember that IF statements can quickly become lengthy and complicated, especially when paired with ISERROR, and it’s easy to misplace a parentheses or comma in such situations. Recent versions of Excel color code formulas when you enter them to help you keep track of cell values and parentheses.

Want news and tips from TekRevue delivered directly to your inbox? Sign up for the TekRevue Weekly Digest using the box below. Get tips, reviews, news, and giveaways reserved exclusively for subscribers.

 020

  • Categories: Tips
  • Tags: #How To #Microsoft Excel #Microsoft Office #Productivity #Spreadsheets #Tips

Sign Up for the TekRevue Weekly Digest

Read more in Tips on TekRevue

  • format skype text chats
    How to Format Skype Text Chats

    Filed Under: Tips

  • chrome for mac os x
    How to Test Chrome’s Native Notifications for Mac

    Filed Under: Tips

  • ps4 remote play mac
    How to Change PS4 Remote Play Resolution & Frame Rate on the Mac

    Filed Under: Games / OS X / Tips

Search

Related Articles

  • office lens
    Office Lens for iOS and Android is Essential for OneNote and Office Users
  • 10 Father’s Day Gift Ideas for Geeky Dads
  • How to Export Excel Charts as Image Files
  • 20130601_hidecellexcelmac
    How to Hide Cells in Excel for Mac OS X

Connect with TekRevue

  • TekRevue on Twitter
  • TekRevue on Facebook
  • TekRevue on Google+
  • Cheats
  • Deals
  • Distractions
  • Editorials
  • Gadgets
  • Games
  • Giveaway
  • Hardware
  • Home Theater
  • Mobile
  • News
  • OS X
  • Podcast
  • Reviews
  • Sponsor
  • More in Tips
  • Windows
  • format skype text chats
    How to Format Skype Text Chats
  • chrome for mac os x
    How to Test Chrome’s Native Notifications for Mac
  • ps4 remote play mac
    How to Change PS4 Remote Play Resolution & Frame Rate on the Mac
  • youtube loop
    How to Loop YouTube Videos
  • itunes trash can
    How to Hide iTunes Purchases and Clean Up Your Digital Library
  • new-apple-tv-home-screen
    How to Move and Delete Apple TV Apps
  • office 365 installer
    How to Install the Older Office 2013 via Office 365
  • itunes 12 separate download window
    iTunes 12: How to Show a Separate iTunes Downloads Window
  • remove creative cloud files file explorer
    How to Remove Creative Cloud Files from the File Explorer Sidebar in Windows
  • chrome offline installer
    How to Download the Chrome Offline Installer
  • disable sharefile auto launch mac os x
    How to Stop Citrix ShareFile from Launching Automatically In OS X
  • icloud email android
    How to Set Up iCloud Email with Non-Apple Apps and Devices
  • iTunes 12 Yosemite
    How to See Your iTunes Purchase History
  • create-chrome-custom-search-engine
    Turn Your Favorite Websites Into Chrome Custom Search Engines
  • microsoft-office-save-location
    How to Change the Default Save Location in Office 2013
  • netflix bandwidth data usage
    How to Reduce Netflix Bandwidth Usage to Avoid ISP Data Caps
  • excel error
    How to Hide Excel Errors with the IF and ISERROR Functions
  • netflix autoplay
    How to Stop Netflix From Automatically Playing the Next Episode
  • distracted man computer
    How to Turn Off Distraction-Free Mode in WordPress
  • watch super bowl online
    Attention Cord-Cutters: How to Watch the Super Bowl Online

Tips

  • Apps
  • Gaming
  • Mac
  • Mobile
  • Online
  • Windows
  • format skype text chats
    How to Format Skype Text Chats
  • chrome for mac os x
    How to Test Chrome’s Native Notifications for Mac
  • office 365 installer
    How to Install the Older Office 2013 via Office 365
  • itunes 12 separate download window
    iTunes 12: How to Show a Separate iTunes Downloads Window
  • ipad controller game
    How to Set Up and Game With an iOS Controller on Your iPhone or iPad
  • ps4 remote play mac
    How to Change PS4 Remote Play Resolution & Frame Rate on the Mac
  • steam trash
    How to Remove a Game From Your Steam Library
  • xbox one elite controller
    How to Use Custom Button Mapping on the Xbox One
  • mac website globe icon
    How to Add Website Shortcuts to the Mac OS X Dock
  • command symbol mac
    How to Find the Command Symbol and Other Technical Symbols in Mac OS X
  • mac keyboard command control
    How to Switch the Command and Control Keys on Your Mac Keyboard
  • disable automatic updates el capitan
    How to Disable Automatic Updates in OS X El Capitan
  • clean status bar iphone
    How to Get a Clean Status Bar in Your iPad & iPhone Screenshots
  • iphone weather app
    Get a City’s Full Weather Channel Forecast From Within the iPhone Weather App
  • hey siri iphone
    How to Turn Off Hey Siri on the iPhone and iPad
  • safari-reader-ios-ipad
    How to Use and Customize Safari Reader in iOS
  • youtube loop
    How to Loop YouTube Videos
  • netflix bandwidth data usage
    How to Reduce Netflix Bandwidth Usage to Avoid ISP Data Caps
  • netflix autoplay
    How to Stop Netflix From Automatically Playing the Next Episode
  • distracted man computer
    How to Turn Off Distraction-Free Mode in WordPress
  • change install location windows 10 apps
    How to Change the Default Install Location for Universal Apps in Windows 10
  • map location pin
    How to Download and Manage Offline Maps in Windows 10
  • windows-10-drop-shadow
    Disable Windows 10 Animations for a Snappier Experience
  • chkdsk windows 10
    How to Scan & Fix Hard Drives with CHKDSK in Windows 10
Company
  • About TekRevue
  • Get in Touch
  • Sponsorships

Sign Up for the TekRevue Weekly Digest

© TekRevue LLC. All Rights Reserved.

  • TekRevue User Agreement
  • TekRevue Privacy Policy

Built by Blazer Six