dslimited Excel Add-ins Specialist  

Home > Excel Tutorials > How to use Conditional Formatting

How to use Conditional Formatting in spreadsheets

Do you know that you can turn your spreadsheet into a chameleon? That might sound strange but it's true. You can link your spreadsheet's format to the data you enter. When you change the data, the format changes too. This is called conditional formatting.

Conditional formatting is fairly flexible but there are things it can't do. For example, you can't use conditional formatting to change fonts but you can use it to change font size and font style. Even so, it's a powerful tool for adding visual impact to your spreadsheets.

Let's look at an example. We'll consider a check account spreadsheet. The spreadsheet might look like this:

Fig. 1 - Spreadsheet Example
Fig. 1 - Spreadsheet Example


We'll use conditional formatting to shade the deposits. Start by selecting cells B5:B9. Then open the conditional formatting dialog box. To do this, select Conditional Formatting on the Format menu. Deposits are positive numbers so change the dialog box like this:

Fig. 2 - Conditional Formatting Dialog Box
Fig. 2 - Conditional Formatting Dialog Box


Next click on the Format button. After the dialog box opens:

1. Click on the Patterns tab
2. Select a color
3. Click on OK
Fig. 3 - Format Cells Dialog Box
Fig. 3 - Format Cells Dialog Box
(Click on image to enlarge)


Finally, click on OK to close the Conditional Formatting dialog box. The spreadsheet now looks like this:

Fig. 4 - Conditionally Formatted Spreadsheet
Fig. 4 - Conditionally Formatted Spreadsheet


Notice how the deposits are shaded. More importantly, notice how the shading disappears if you change a deposit to a debit. Try it and see - change 50.00 to -50.00. The spreadsheet's format is now dynamic; it changes every time you replace a deposit with a debit and vice versa.

Fig. 5 - Spreadsheet With New Value
Fig. 5 - Spreadsheet With New Value


This is a simple example. You can use conditional formatting to do more than shade cells. You can use it to change border and font attributes. And you can develop complex conditions to vary the look of your spreadsheets. In this example we used a simple condition - shading is applied if a value is positive. But you might want to use more than one condition or use formulas instead of a simple conditional test. All this is possible; just give it a go.

email this articleEmail this article to a friend

Write to the editorWrite to the editor


UltraSleuth logo UltraSleuth
Compare, check, analyze and document your Excel projects with UltraSleuth.
bullet point Gain confidence in your spreadsheet results
bullet point Speed up your spreadsheet development
bullet point Understand third party spreadsheets
bullet point Create an audit trail
Learn more Learn More...


Other Tutorials


Home | Excel Add-ins | Downloads | Excel Tutorials | Support
Buy | Links | About dslimited


Copyright© 2003-2007 Digital Solutions Limited. All rights reserved.   Privacy | Legal
For any problems with the web page, please contact us.