Conditional formats is a wonderful feature that incrementally adds format to a cell based on some criterias. You could use it to highlight cells by adding a color fill, changing borders or modifying any other format element.
In it’s basic form, you can use it with a simple condition depending on the cell value. However, a more interesting yet underused way of working with conditional formats is with a formula condition. Let’s see how we can use both.
Conditionally format a cell based on its value
Let’s start with an example where a model user needs to input a product mix (e.g. overall sales to be broken down into the different categories). Obviously, the total mix should be 100%. The next picture shows how the model could be layed out.

I have added a conditonal format rule that will change total cells to red when the value is different than 100%. To do so, follow these steps:
- Select the cells on which you want “Conditional Formatting”. (In this case the cells with the totals)
- In the “Style” section of the “Home” tab, click “Conditional Formatting” then “New Rule…”. (In Excel 97-2003, you will find it in the format menu)
- Select “Use a formula to determine which cell to format”
- In the edit rule description, set it to cell value not equal to 1.
Conditionally format a cell based on a formula
Following on our previous example, suppose we want to highlight the input cells like in the picture below.

To add the conditional formatting, simply follow these steps:
- Select the cells on which you want “Conditional Formatting” (I.e.: the input cells).
- In the “Style” section of the “Home” tab, click “Conditional Formatting” then “New Rule…”. (In Excel 97-2003, you will find it in the format menu)
- Select “Use a formula to determine which cells to format”.
- Type the formula to be evaluated in the “Format values where this formula is true:” section. In our example, the formula looks like this: =SUM(E$23:E$26)<>1
Conditional Format gives you a quick glance to verify the inputs and might even highlight errors that would have normally been missed. As an example, look closely at the second picture, you’ll notice that the total seems to be 100% when in fact it’s not.
Note that, in some instance, you might want to add rounding to your conditions when your totals are close but not quite equal to 100%.
You can download the companion file used for the examples here: Conditional Formats - The Warm-Up
Conditionnal Format Controls – Part Deux
In this post, I’ll show you how I like to use Conditional Formatting in my Excel models to add a disabled look to some cells based on a criteria. With this technique, you will get clear visual indications that will simplify inputs and avoid errors.
The context
As an example, you need to enter monthly sales volumes for a product that is yet to be launched. The spreadsheet is layed out with one column for each month. The goal is to have the input cells shaded for the months previous to the launch date.
Of course, you could do that manually, but that wouldn’t be fun nor very flexible. Instead I’ll show you how to setup conditional formatting to have it done automatically without resorting to macros.
Model Layout
The solution
To make sure the launch date inputs are valid, you need to add data validation with a drop down list of all months next to each product.
The next picture demonstrates how the conditional formatting is set, with L$6 being the evaluated month and $D11 being the launch date.
Conditional Formatting setup
Since this technique only changes formats and leaves the input in the shaded cells, you need to adjust the formulas that are connected to the inputs. This insures that your results are not affected by inputs in the shaded cells. You can see how I have adjusted the annual sums and the revenue calculation to consider the launch date by downloading the example.
Final thoughts
As it is setup in the example, you have to adjust the inputs each time you change the launch date. The conditional formatting acts only as visual help for inputs. However, it could also be interesting to have formulas that adjust with the launch date instead of the inputs.
Download:
Conditional Format Controls – Part Deux.xls (size 124Kb)
Other related post:
Conditional Formats Control – The Warm-Up