Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

Newest Tips

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

More than Three Conditional Formats

Summary: Conditional formatting is a powerful feature of Excel, but it has traditionally been limited to three explicit formats. This tip examines ways around this limitation, along with a look at how the limitation was entirely removed in Excel 2007. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

The conditional formatting feature of Excel is very powerful. For complex formatting, however, there is one drawback for most Excel users: The conditional formatting feature only seems to allow up to three conditions to be defined.

This is actually a bit misleading. There are actually four conditional formats that can be specified. The fourth one is the format that is used by Excel if none of the three conditions specified in the Conditional Formatting dialog box is true. (In other words, the way you format the cell to begin with is the fourth format.)

It is also misleading if you are using Excel 2007, as the Conditional Formatting Rules Manager allows you to enter many more than three conditional formats. (More on Excel 2007 and conditional formatting in a moment.)

If you are using an older version of Excel and you simply need to define additional conditions, without the need of corresponding formats, you can design formulas to use in the conditions. These formulas can use the OR, AND, and NOT functions. For instance, if you want cell B5 to be colored red when the cell value is outside the range of 5 to 10, or it is not a number, you can use the following condition:

=OR(B5<5,B5>10,NOT(ISNUMBER(B5)))

In order to enter this formula into the Conditional Formatting dialog box, make sure you specify "Formula is" instead of "Cell Value Is" in the condition. You would then change the formatting for the condition in the dialog box so that it is red. Similar "compound formulas" can be designed for other complex conditional needs.

If you need to define additional conditions (more than three) and you need different formats for each of the conditions, then you are out of luck using the conditional formatting feature in all versions of Excel prior to Excel 2007. In that instance, you will need to use VBA macros to check your conditions and modify cell formats accordingly.

If you are using Excel 2007, you can use the Conditional Formatting Rules Manager to define as many conditional formats as you need. Just follow these general steps:

  1. Select the cell or cells to which you want the conditional formats applied.
  2. Make sure the Home tab of the ribbon is displayed.
  3. Click the Conditional Formatting tool in the Styles group. Excel displays a drop-down list of options.
  4. Click the Manage Rules option. Excel displays the Conditional Formatting Rules Manager dialog box. (Click here to see a related figure.)
  5. Click the New Rule option. Excel displays the New Formatting Rule dialog box, which you can use to define rules as you desire.
  6. Click the Format button. Excel displays the Format Cells dialog box, which you can use to specify the formatting associated with the conditional format.
  7. Click OK to dismiss the Format Cells dialog box.
  8. Click OK to dismiss the New Formatting Rule dialog box.
  9. Repeat steps 5 through 8 to define as many rules as necessary.
  10. Click OK to dismiss the Conditional Formatting Rules Manager dialog box.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2439) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

Got the Time? Understanding the ins and outs of working with times and dates can be confusing. Remove the confusion--ExcelTips: Times and Dates is an invaluable resource for learning how best to work with times and dates.
 
Check out ExcelTips: Times and Dates today!