Working with Multiple Conditions

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


1

When working with conditional formats, you'll often discover times when you need to apply multiple conditions to a single cell. How you define a single condition is described in other ExcelTips, but Excel allows you to define many conditions that can all apply to the same cell or range of cells.

Begin by selecting the cells for which you want to define conditional formatting rules. Then, with the Home tab of the ribbon displayed, click Conditional Formatting in the Styles group. From the resulting list of options, select Manage Rules. Excel displays the Conditional Formatting Rules Manager. (See Figure 1.)

Figure 1. The Conditional Formatting Rules Manager.

The Conditional Formatting Rules Manager is nothing but a list of the rules which have been defined for the selected cells. Each rule is shown on a separate line, and you can work with the rules by clicking one of the available buttons:

  • New Rule. Allows you to define a new rule, which is added to the end of the rules list. Defining a new rule uses the same procedures described in other ExcelTips.
  • Edit Rule. Make changes to the selected rule.
  • Delete Rule. Remove the selected rule so it no longer applies to the selected cells.
  • Up Arrow. Move the selected rule up in the list of rules.
  • Down Arrow. Move the selected rule down in the list of rules.

Rules are always evaluated in the order in which they appear in the Conditional Formatting Rules Manager. You can modify the evaluation order by using the up and down arrow tools.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6755) 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

Deleting VBA Code in a Copied Worksheet

VBA makes it easy to copy a worksheet from the current workbook into a brand-new workbook. You may want to delete some ...

Discover More

Moving Subtotals

When you add subtotals to a worksheet, Excel typically places them in the same column that you are subtotaling. If you ...

Discover More

Inserting a Formatted Text Box with a Macro

Macros allow you to do just about anything in Word, but not if you limit yourself to using just the Macro Recorder. This ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Controlling Data Entry in a Cell

Sometimes you want whatever is displayed in one cell to control what is displayed in a different cell. This tip looks at ...

Discover More

Conditionally Making a Sound

Need to have a sound played if a certain condition is met? It is rather easy to do if you use a user-defined function to ...

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 two more than 7?

2023-02-11 13:30:50

Tomek

Also important is understanding how the evaluation order really works, and how "Stop if True" setting interacts with the evaluation order.
While the rules are evaluated from top to bottom, it does not mean that the last rule will fully determine how the cell is formatted. If a particular formatting attribute is applied by one rule, any subsequent rule will not change that attribute. For example, if you have a rule setting the background to yellow for value in the cell >5, and the following rule to set the background to red if cell value >10, the cell background will be yellow whether the value is 6 or 100; this cell will never show red background, contrary to what you may expect. To get what you expect, you need to change the order of the rules, and if in doubt, use "Stop if True": the latter, if the condition for that rule is met, will cause the the formatting to ignore all of the rules below.

In short, not as simple as you may think.


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.