by Allen Wyatt
(last updated February 28, 2015)
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.)
If 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:
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. In that instance, you will need to use VBA macros to check your conditions and modify cell formats accordingly. (You could also upgrade to a later version of Excel—2007 or later—as these later versions will easily handle more than three conditional formats.)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2439) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
You can use conditional formatting to add shading to various cells in your worksheet. This tip shows how you can shade cells ...Discover More
Conditional formatting can be used to highlight cells that contain the improper type of data for your needs. This tip ...Discover More
If you want to apply a conditional format to data imported into Excel from Access, you may run into some difficulties related ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.