Search Contextures Sites ![]()
Excel Conditional Formatting -- Examples
Hide Errors
You can use Excel conditional formatting to check for errors, and change the font colour to match the cell colour. In this example, if column B contains a zero, the #DIV/0! error is displayed in column C.
- Select cells C2:C5
- Choose Format|Conditional Formatting
- From the first dropdown, choose Formula Is
- For the formula, enter a formula that refers to the active cell in the selection:
=ISERROR(C2)
or, to hide only #N/A errors: =ISNA(C2)
- Click the Format button.
- Select a font colour to match the cell colour.
- Click OK, click OK
download a zipped sample file for the
Excel Conditional Formatting tutorial
Hide Duplicate Values
In a table, each row should have all data entered, to enable sorting and filtering. However, you can use Excel conditional formatting to hide the duplicate values, and make the list easier to read. In this example, when the table is sorted by Region, the second (and subsequent) occurences of each region name will have white font colour.
In Excel 2003:
In Excel 2007:
- Select range A2:A5
- Choose Format|Conditional Formatting
- From the first dropdown, choose Formula Is
- For the formula, enter
=A2=A1- Click the Format button.
- Select a font colour to match the cell colour.
- Click OK, click OK
- Select range A2:A5
- On the Ribbon, go to the Home tab and click Conditional Formatting
- Click New Rule
- Click Use a Formula to Determine Which Cells to Format
- For the formula, enter
=A2=A1- Click the Format button.
- Select a font colour to match the cell colour.
- Click OK, click OK
To view the steps
for Excel Conditional Formatting
in a short video, click here
(Excel 2007)
Highlight Items in a List
Use Excel conditional formatting to highlight items that are in a list on the worksheet.:
- Create a list of items you want to highlight. If the items are on a different sheet than the conditional formatting, name the list.
- Select range A2:A7
- Choose Format|Conditional Formatting
- From the first dropdown, choose Formula Is
- For the formula, enter
=COUNTIF($C$2:$C$4,A2)
or, if the list is named, use the name in the formula:
=COUNTIF(CodeList,A2)
- Click the Format button.
- Select a font colour for highlighting.
- Click OK, click OK
Excel Conditional Formatting Tutorials
- Conditional Formatting -- Introduction
- Conditional Formatting -- Multiple Cells
- Conditional Formatting -- Examples
- Conditional Formatting -- Documentation
Contextures Inc., Copyright © 2009.
All rights reserved.
Last updated: October 15, 2009 0:22 AM