Understanding Conditional Formatting Conditions

by Allen Wyatt
(last updated April 13, 2013)

5

Excel includes a powerful feature that allow you to format the contents of a cell based on a set of conditions that you specify. This is know as conditional formatting. The first step in using conditional formatting, of course, is to select the cell whose formatting should be conditional. Then choose Conditional Formatting from the Format menu. Excel displays the Conditional Formatting dialog box. (See Figure 1.)

Figure 1. The Conditional Formatting dialog box.

The top line of the dialog box is where you specify the condition for which you want Excel to test. There are two types of conditions you can test, and they are specified in the first pull-down list of the dialog box. You can have Excel test the cell value (Cell Value Is), or evaluate a formula (Formula Is). Each of these are quite different in their effect.

When the first pull-down list of a condition is set to Cell Value Is, you can specify thresholds for the result shown in the cell. You then use the second pull-down list to specify how Excel should examine the cell value. You can choose from any of the following:

  • between
  • not between
  • equal to
  • not equal to
  • greater than
  • less than
  • greater than or equal to
  • less than or equal to

These test conditions cover the entire gamut of how your cell could be viewed. When you specify a test, you can then specify the actual values to test for. For instance, if you wanted Excel to apply a particular format if the value in the cell exceeds 500, then you would choose Greater Than as your test, and enter 500 in the field just to the right of the test.

When the first pull-down list of a condition is set to Formula Is, you can specify a particular formula for determining if special formatting should be applied to the cell. This is most useful if the formatting is based on a value in a cell different from the one you selected when you first chose Conditional Formatting from the Format menu.

For instance, let's say that column A has a list of company names, and column N has a total of all the purchases made by that company during the year. You may want the company name to appear in bold, red type if their sales exceeded a certain amount. This type of scenario is perfect for using a formula for your conditional test. The reason is because the formatting in column A will be based not on column A, but on a value in column N.

To complete your conditional test, select Formula Is in the pull-down list, and then enter your formula in the space provided in the dialog box. Formulas must evaluate to either a true or false condition, not to some other value. For instance, you could use the formula =N4>500 if you wanted cell A4 to be conditionally formatted if cell N4 exceeds a value of 500.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2795) applies to Microsoft Excel 97, 2000, 2002, and 2003.

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

Conditional Processing During a Mail Merge

The Mail Merge capabilities built into Word can appear limited at first glance. One thing that is often overlooked (and which ...

Discover More

Updating the Spelling Exclusion List Automatically

Want to add words easily to the spelling exclusion list? Here's a macro that can make the task completely painless.

Discover More

Chapter Numbers in Indexes and TOAs

Word allows you to define prefixes for page numbers. These are often used for chapter or section numbers in a large document. ...

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 (MENU)

Sorting or Filtering by Conditional Format Results

Conditional formatting is a great feature in Excel. Unfortunately, you can't sort or filter by the results of that ...

Discover More

Protecting Your Conditional Formatting Rules

If you have conditional formatting applied in a worksheet, the formulas in those formats may not be as secure as you would ...

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
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 for this tip:

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. 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 nine more than 2?

2013-04-18 09:30:38

Jacqi

Gordon - I find that very same problem and cannot figure out a way to stop it. I would love to hear what others are doing. Do you have to format each individual cell or row separately? No copy and pasting allowed?


2013-04-16 21:26:40

Abby D

Dwight Kitchin, you must have a virus in your computer. What you described doesn't happen in my Firefox.


2013-04-13 15:16:17

Dwight Kitchin

It seems that the embedded atvertizing links are working in a quite unintended manner.
In both IE and Firefox simply passing over the blue double-underlined links opens a pop-up. The worst part of this is not the pop-up itself (have ot pay bills) but that they neither go away or have a mechanisim to close them. A <click> anywhere then completely takes over, hijacks your page, and takes us to a different site. Not as intended I think.


2013-04-13 09:55:41

Gordon

Every time I use Conditional formatting, after a while the ranges I have assigned for it to operate upon get expanded and/or multiple occurances of the conditional line get propogated. Very annoying when trying to update later on.


2013-04-13 06:43:33

Tim C

Just wondering why this web page will not render properly in FireFox but it does in IE, Chrome, Opera ?


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.

Links and Sharing
Share