How to Hide Error Values in Microsoft Excel

Updated on July 16, 2018

N/A appearing in an Excel spreadsheet

Source

Hiding Error Values

Sometimes when using Microsoft Excel, you find that an error value has appeared in one of your cells. This might be because you are using a formula that has tried to divide by 0 (in which case #DIV/0 will appear) or maybe your formula is linked to a VLOOKUP function that can't find a match for your data (in which case #N/A will appear). These are just two of the several error codes that can appear in Excel.

But why hide them? Why not just delete the formula? Well, in the case of the #N/A error especially, you might have set up your spreadsheet with formulae ready for data that you will be entering in the future. In this case, you want the formulae there ready, but having #N/A written all over the sheet can look messy and unprofessional. In this article I will give a couple of different ways to solve this problem.

Source

Example

Take a look at the table I have set up in the picture above. The table shows eight school students and their end of year target grades (the pink column). The column titled 'Term 1' shows their actual grades for that term. The next column is then set up with a formula involving the VLOOKUP function.

I have used the VLOOKUP function and the table on the right to convert the students' letter grades into numbers so that I can then display the difference between their target and actual grades in the column titled 'Difference'.

This has worked well for most of the students in term 1. We can quickly see the difference between their target and actual grades and who needs help, who is above target etc.

Unfortunately John Surtees was absent when the class did their end of term test, so he does not have an actual grade for term 1. This has then returned #N/A in the 'Difference' column as the VLOOKUP formula cannot find anything to match to. The term 2 and 3 columns are the same for everybody.

This looks messy and I want to hide all of the error messages without having to delete my formula from all those cells.

Let's have a look at how we can do this.

Method 1 - Using formatting to hide the error

By using the IFERROR function, you can convert any errors into a number and then use conditional formatting to hide these.

Using the IFERROR function

Source

Using the =IFERROR function

The =IFERROR function works by returning an item of your choice if your formula returns an error.

In my example in the picture above, I have entered the following formula:

=IFERROR(VLOOKUP($C6,$N$2:$O$10,2,FALSE)-VLOOKUP(D6,$N$2:$O$10,2,FALSE),100)

I have the same VLOOKUP formula as before contained within the brackets of the =IFERROR function as so:

=IFERROR(my formula,

this is then followed by a comma and a 100. The 100 is what I have chosen for Excel to return if an error appears. I could have chosen anything and put it after the comma, but you will see why I have chosen a number in a moment.

The final formula looks like this:

=IFERROR(my formula, 100).

Excel will now return the answer to my formula if it works, or a 100 if it doesn't work.


To complete the fix, we now need to add some formatting so that any 100 will be hidden.

Source

Using conditional formatting

1. Highlight all of your cells and click 'Conditional Formatting', then 'New Rule'.

2. Select 'Format only cells that contain', then make sure the drop box below this contains 'equal to' and you enter '100' next to this. (This tells Excel to format any box that contains 100).

Source

3. Click 'Format' and then the 'Number' tab. In the category menu click on 'Custom' and type ';;;' into the type box. This tells Excel to take any box containing the 100 and leave it blank.

4. Click 'Ok'. All of you #N/A cells should now be blank, but will continue to work as normal as soon as you input data that allows your formula to have an answer.

Source

Method 2 - Turn the text white

This method is a little less satisfying, but a lot quicker and easier to do. The #N/A will still be displayed, but as the text will be white, you won't be able to see it.

1. In the home tab, select 'Conditional Formatting' and then click 'New Rule' as we did in method 1.

2. Select 'Format only cells that contain' and then choose 'Errors' from the drop down box.

Source

3. Click 'Format' and then go onto the 'Font' tab. On the drop-down colour menu, change this to 'white' (or whichever colour the background of your cell is) and then click Ok.

Your error messages will have disappeared.

Comments

    0 of 8192 characters used
    Post Comment

    • profile image

      xneelhtakx 

      4 months ago

      i uses if(iserror though. and i find it amazing awesome and useful.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, turbofuture.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://turbofuture.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)