Defining a Single Conditional Formatting Condition

Written by Allen Wyatt (last updated April 29, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Excel includes a powerful feature that allows you to format the contents of a cell based on a set of conditions that you specify. This is known as conditional formatting. How you define conditional formats depends on whether you want to define a single formatting condition or multiple conditions. Even if you decide you want to define multiple conditions, however, it is beneficial to understand how single conditions are defined.

The first step in using conditional formatting, of course, is to select the cell whose formatting should be conditional. Then, with the Home tab of the ribbon displayed, click Conditional Formatting in the Styles group. Excel displays a list of various conditions you can define:

  • Highlight Cells Rules. These rules are designed to allow you to indicate how a specific cell should be highlighted, based on the condition you specify.
  • Top/Bottom Rules. These rules are used to format cells based on whether they are in the upper or lower portion of a range of values.
  • Data Bars. These rules allow you to specify a graphic bar that appears based on the value in a cell. (Similar to a histogram, where longer bars denote larger values and shorter bars are used for lesser values.)
  • Color Scales. These rules are used to indicate a range of colors that should apply to a cell, based on the value in that cell.
  • Icon Sets. These rules allow you to apply various graphic icons based on the condition you specify.

In reality, each "condition" selected from these options is nothing but a shortcut to filling in the settings of the New Formatting Rule dialog box. You may have noticed that each of the above choices leads to a series of specific conditions, and that the last condition, in all cases, is "More Rules." If you select this option, if you select one of the defined conditions, or if you select New Rule (available when you first click Conditional Formatting) you will typically see the New Formatting Rule dialog box. (See Figure 1.)

Figure 1. The New Formatting Rule dialog box.

In the top of the dialog box you select a type of rule you want applied to the selected cells. There are six rule types:

  • Format All Cells Based On Their Values
  • Format Only Cells that Contain
  • Format Only Top or Bottom Ranked Values
  • Format Only Values that are Above or Below Average
  • Format Only Unique or Duplicate Values
  • Use a Formula to Determine which Cells to Format

These six rule types may look somewhat familiar; they are the basis for the pre-defined rules discussed earlier in this tip. When you select a rule type, Excel changes the settings you can make in the bottom of the dialog box. Each rule type has value, but you will find, over time, that the last rule type (where you use a formula to define formatting) is the most powerful.

When you select a rule type and then adjust the settings in the bottom of the dialog box, you can (depending on the rule type) click the Format button to specify the formatting Excel should apply if the conditions detailed in the rule are satisfied.

When you are satisfied with your rule settings and formatting options, you can click OK to dismiss the New Formatting Rule dialog box. The format is applied and you can continue working in your worksheet.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6754) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Printing Show/Hide Characters

Non-printing characters are very handy to view when editing a document. But what if you want those characters to no ...

Discover More

Displaying the PC Settings Screen

Need to customize how your Windows interface looks? If so, you'll want to use the PC Settings screen. This tip explains ...

Discover More

Outstanding Macro Function Reference

Looking for a great reference that you can use to help figure out the various worksheet functions available in Excel? ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Conditionally Highlighting Cells Containing Formulas

Excel's conditional formatting feature allows you to create formats that are based on a wide variety of criteria. If you ...

Discover More

Conditional Formatting Based on Date Proximity

Conditional formatting can be used to draw your attention to certain cells based on what is within those cells. This tip ...

Discover More

Protecting Conditional Formatting

When you apply conditional formatting to the cells in your worksheet, those rules can seem a bit fragile at times. For ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.