Use Conditional Formatting with Formulas to Deal with Common Excel Issues

by Avantix Learning Team | Updated April 20, 2019

Applies to: Microsoft® Excel® 2010, 2013, 2016, 2019 and 365 (Windows)

Conditional formatting is a great tool in Excel and if you combine it with formulas, you can do some amazing things. In this article, we’ll use some simple examples to show the power of conditional formatting.

Conditional Formatting appears on the Home tab in the Ribbon in the Styles group.

Conditional formatting button on the Ribbon in Microsoft Excel.

You can apply conditional formatting using a formula and a new rule. Below is a sample of a rule with a formula:

Conditional formatting dialog box in Excel.

Recommended article: 15 Microsoft Excel Keyboard Shortcuts to Speed Up Formatting

Highlighting errors using conditional formatting

You can use conditional formatting to highlight errors in a range of cells.

In example below, there are errors in column C.

Sample with conditional formatting in Excel to highlight errors.

To highlight the errors using conditional formatting:

  1. Select the range of cells in a column where some of the cells contain errors. In this example, select C2 to C10 .
  2. Click the Home tab in the Ribbon and select Conditional Formatting in the Styles group. A drop-down menu appears.
  3. Select New Rule from the menu. A dialog box appears.
  4. Click Use a formula to determine which cells to format. In the formula box, enter =ISERROR(active cell reference). In this example, enter =ISERROR(C2). Enter the formula for the first row in the range. Excel uses relative referencing by default so the formula will be copied down and adjusted for the remaining cells.
  5. Click Format.
  6. Click the Fill tab and select a light fill.
  7. Click OK twice.

Highlighting blanks using conditional formatting

You can use conditional formatting to highlight blanks in a range of cells.

In the example below, there are blanks in column C:

Sample data with blanks highlighted using conditional formatting in Excel.

To highlight the blanks using conditional formatting:

  1. Select the range of cells in the column where some of the cells contain blanks. In this example, select C2 to C10.
  2. Click the Home tab in the Ribbon and select Conditional Formatting in the Styles group. A drop-down menu appears.
  3. Select New Rule from the menu. A dialog box appears.
  4. Click Use a formula to determine which cells to format. In the formula box, enter =ISBLANK(active cell reference). In this example, enter =ISBLANK(C2). Enter the formula for the first row in the range. Excel uses relative referencing by default so the formula will be copied down and adjusted for the remaining cells.
  5. Click Format.
  6. Click the Fill tab and select a light fill.
  7. Click OK twice.

Highlighting duplicates using conditional formatting

You can also use conditional formatting to highlight duplicates in a range of cells.

In the example below, there are duplicates in column A.

Sample data in Microsoft Excel with duplicates highlighted.

To apply conditional formatting to highlight the duplicates:

  1. Select the range of cells in the column where some of the cells contain duplicates. In this example, select A2 to A10.
  2. Click the Home tab in the Ribbon and select Conditional Formatting in the Styles group. A drop-down menu appears.
  3. Select New Rule from the menu. A dialog box appears.
  4. Click Use a formula to determine which cells to format. In the formula box, enter =COUNTIF(absolute range,cell containing criteria)>1. In this example, enter =COUNTIF($A$2:$A$10,A2)>1. Enter the formula for the range of cells using absolute referencing (as this range should not change) and for the cell holding the criteria as relative and refer to the active cell. Excel will then copy the formula down and adjust for the remaining cells.
  5. Click Format.
  6. Click the Fill tab and select a light fill.
  7. Click OK twice.

These are just a few examples of conditional formatting with formulas. You can use all kinds of other formulas in rules to format cells.

Subscribe to get more articles like this one

Did you find this article helpful? If you would like to receive new articles, join our email list.

To request this page in an alternate format, contact us.

Recommended Microsoft Excel training

Microsoft Excel: Intermediate / Advanced

Microsoft Excel: Data Analysis with Functions, Dashboards and What-If Analysis Tools

Microsoft Excel: Introduction to Visual Basic for Applications (VBA)

VIEW MORE COURSES >

Our instructor-led classroom training courses are delivered at our downtown Toronto location at 1 Yonge Street, Suite 1801 (Toronto Star Building), Toronto, Ontario, Canada (some courses may also be delivered at an alternate downtown Toronto location). Contact us if you’d like to arrange custom training at your office on a date that’s convenient for you.

To request this page in an alternate format, contact us.

 

Copyright 2020 Avantix® Learning Inc.

You may also like

How to Delete a Pivot Table in Excel

How to Delete a Pivot Table in Excel

A pivot table can be deleted in an Excel workbook in several ways. You can delete a pivot table, convert a pivot table to values or clear data and customizations from a pivot table to reset it. When a pivot table is created from source data in a workbook,

How to Change Commas to Decimal Points and Vice Versa in Excel (5 Ways)

How to Change Commas to Decimal Points and Vice Versa in Excel (5 Ways)

Depending on your country or region, Excel may display decimal points or dots instead of commas for larger numbers. The decimal point (.) or comma (,) is used as the group separator in different regions in the world. You can change commas to decimal points or dots or vice versa in your Excel workbook temporarily or permanently.

How to Group by Month and Year in a Pivot Table in Excel

How to Group by Month and Year in a Pivot Table in Excel

You can group by month, year or other date period in a pivot table in Excel. One option is to group by date periods in a pivot table using the Grouping feature. Alternatively, you can also create calculations in source data to extract the month name and the year from a date field and use the fields in your pivot table.

Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.

Avantix Learning | 1 Yonge Street, Suite 1801 (Toronto Star Building), Toronto, Ontario, Canada M5E 1W7 | info@avantixlearning.ca

Summary
How to Highlight Errors, Blanks and Duplicates in Microsoft Excel
Article Name
How to Highlight Errors, Blanks and Duplicates in Microsoft Excel
Description
You can highlight errors, blanks and duplicates in Microsoft Excel easily using conditional formatting. Conditional formatting is a great tool in Excel and if you combine it with formulas, you can do some amazing things.
Author
Publisher Name
Avantix Learning

Pin It on Pinterest

Share This