# Conditionally Displaying Decimal Places in Excel: Part 2

*By David Ringstrom, CPA*

**=MOD(number,divisor)**

**=MOD(4,2)**

**=MOD(3,2)**

**Figure 1:**You can conditionally display decimals by way of the MOD function.

Choose Home, Conditional Formatting, New Rule, and then Use a Formula to Determine Which Cells to Format.**Excel 2007 and later:**Choose Format and then Conditional Formatting.**Excel 2003 and earlier:**From the Home tab, choose Conditional Formatting, and then New Rule, or choose Format and then Conditional Formatting from the menu and then click the Plus sign. When the New Formatting Rule window appears, choose Classic from the Style List, and then specify Use a Formula to Determine Which Cells to Format.*Excel 2011 for Mac:*

3. Enter the following formula:

**=MOD(A1,1)=0**

Repeat steps 2 through 4, but this time use the formula =MOD(A1,1)<>0 for step 3 and specify two decimal places in step 4.*Excel 2007 and later, Excel 2011 for Mac:*Choose Format, Conditional Formatting, and then click Add. Specify =MOD(A1,1)<>0 for Condition 2, and then carry out step 4, but specify two decimal places.*Excel 2003 and earlier:*

Once applied, you can easily remove conditional formatting:

Select one or more cells, and then choose Home, Conditional Formatting, and make a selection from the Clear Rules menu.*Excel 2007 and later:*Choose Format, Conditional Formatting, Delete, and then remove any unwanted conditions.*Excel 2003 and earlier:*

**Related article:**

**About the author:**

*David H. Ringstrom, CPA, heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at* *david@acctadv.com* [4]* or follow him on **Twitter* [5]*. David speaks at conferences about Microsoft Excel and presents webcasts for several CPE providers, including AccountingWEB partner **CPE Link* [6]*.*