To avoid this, on the Advanced tab of the Excel Options dialog box, select Show A Zero In Cells That Have Zero Value (in Excel 2007 and Excel 2010), or select Tools/Options and select the Zero Values Disabled check box on the View tab (in previous versions of Excel). However, the calculation still uses 0.
Example. In the example for the ISTEXT() function, the formula to calculate the sales tax was entered in column N (see Figure 11-6 later in this chapter):
=IF(ISTEXT(M42),,L42*M42)
If no sales tax is used, the value 0 is displayed. If you want to show an empty cell instead, enter the following formula:
=IF(ISTEXT(M42),"",L42*M42)
However, the formula
=L42+N42
to calculate the gross amount produces an error. To avoid this, use the ISNUMBER() function together with the IF() function:
=IF(ISNUMBER(N42),L42+N42,L42)