bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Formatting > Conditional Formatting > More than Three Conditional Formats

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.

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!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)