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

Alt+Enter Stopped Working Correctly

What do you do if a keypress you know worked correctly before all of a sudden stops working as you expect? This tip ...

Discover More

Extra Blank Lines in Some Cells

When adjusting column width, Excel can add an extra line to some cells. This behavior seems to be related to the text ...

Discover More

Hiding Macros

Don't want a particular macro to be visible in the Macros dialog box? Once you understand the criteria that Word uses ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Conditionally Formatting an Entire Row

Need to conditionally highlight an entire row based on the contents of a single cell in each row? This tip explains how ...

Discover More

Diagonal Borders in a Conditional Format

Conditional formatting is a great tool for changing how your data looks based on the data itself. Excel won't allow you ...

Discover More

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
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 five more than 3?

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.