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

Noting When a Workbook was Changed

Do you need to know when a workbook was last changed? There are a couple of ways you can go about keeping track of the ...

Discover More

Highlighting Greater Than Average Dry Durations

If you need to find whether the duration between two dates is greater than the average of all durations, you'll find the ...

Discover More

Creating a Center Across Selection Button

The ability to center text across a range of cells has long been a staple of experienced Excel users. Here's how to ...

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)

Applying Conditional Formatting to Multiple Worksheets

If you just updated your copy of Excel, you may have noticed some differences in how the program handles applying ...

Discover More

Shading Based on Odds and Evens

You can use conditional formatting to add shading to various cells in your worksheet. This tip shows how you can shade ...

Discover More

Highlighting After-Hours Times

The Conditional Formatting capabilities of Excel are powerful. This tip shows how you can use a simple approach to ...

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 6 - 0?

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.