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

Understanding Frames and Text Boxes

What is the difference between frames and text boxes? Why use one over the other? Find out here.

Discover More

Swapping Two Strings

Strings are used quite frequently in macros. You may want to swap the contents of two string variables, and you can do so ...

Discover More

Symbols Convert to Numbers in Excel

Insert a symbol into a cell, and it should stay there, right? What if the symbol changes to another character, such as a ...

Discover More

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!

More ExcelTips (ribbon)

Conditional Format that Checks for Data Type

Conditional formatting can be used to highlight cells that contain the improper type of data for your needs. This tip ...

Discover More

Turning a Cell Red when a Threshold is Exceeded

Excel provides a great conditional formatting capability that allows you to change how a cell appears based on critiera ...

Discover More

Conditionally Formatting Cells Containing Dates

Need to know if a particular cell contains a date value? Excel doesn't have a worksheet function to determine this ...

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 2 + 8?

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.