Hide Error Cells When Printing


October 03, 2023 - by

Hide Error Cells When Printing

Problem: I have a formula that does division. Occasionally, the divisor cell is zero, so I have a couple of #DIV/0! value errors. I need to print this sheet without the errors to get the report to a staff meeting. I don’t have time to rewrite all the formulas to test whether the divisor is zero. What can I do?

Several cities are shown. Revenue is in B. Units is in C. A formula in D calculates the average as =B2/C2.  However, one city has 0 in B and C, so the formula in D shows as #DIV/0 meaning a division by zero error.
Figure 1345. A few nagging error cells.

Strategy: From the Page Layout tab, you can select the dialog launcher at the bottom right corner of the Page Setup group. In the Page Setup dialog, you go to the Sheet tab, select the dropdown for (Print) Cell Errors As, and select <blank>.


Page Setup dialog. Choose the Sheet tab. Cells Errors As offer choices for
Displayed
<blank>
--
#N/A
Figure 1346. Select to print error cells as blank.

Results: Although the error will still appear in the worksheet, when you print, the error cells will print as blanks.

The Division by Zero error is now displayed as an empty cell.
Figure 1347. No errors will show in the printed document.

Alternate Strategy: The ultimate way to solve this problem is to change the formula to test whether the divisor is zero. In this case, a proper formula would be =IFERROR(B2/C2,0).




This article is an excerpt from Power Excel With MrExcel

Title photo by Cam Morin on Unsplash