
Tips.Net > ExcelTips Home > Formatting > Conditional Formatting > 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:
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!
It doesn't matter if you are a beginner or expert, the ExcelTips archives are the fastest way to improve your productivity. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site