
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
More Power! For some people, the prospect of creating macros can be scary. Those who conquer their fears, however, find they become much more confident and productive once they learn how to make Excel do exactly what they want. ExcelTips: The Macros is an invaluable source for learning Excel macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of ExcelTips. Learn at your own pace, exactly the way you want.
Check out ExcelTips: The Macros today!
If you have tons of data to analyze, one of the best tools in Excel's arsenal is the PivotTable. Learn how to use this tool to analyze your data. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips
Advertise on the
ExcelTips Site