Use Conditional Formatting in Excel with Formulas to Highlight Errors, Blanks and Duplicates

by Avantix Learning Team | Updated April 7, 2021

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 Excel. to highlight data

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

New conditional formatting rule dialog box in Excel.

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

Do you want to learn more about Excel? Check out our virtual classroom or live classroom Excel courses >

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.

Highlight errors in Excel with conditional formatting.

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 drop-down 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 cell 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. A dialog box appears.
  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 cell 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. A dialog box appears.
  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.

Highlight duplicates in Excel.

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 (since this range should not change) and for the cell holding the criteria using relative referencing and refer to the active cell. Excel will then copy the formula down and adjust for the remaining cells.
  5. Click Format. A dialog box appears.
  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.

More resources

How to Use Flash Fill in Excel (4 Ways with Shortcuts)

How to Freeze Row and Column Headings in Excel Worksheets

3 Excel Strikethrough Shortcuts to Cross Out Text or Values in Cells

How to Replace Blank Cells with a Value from the Cell Above in Excel

Use Conditional Formatting in Excel to Highlight Dates Before Today (3 Ways)

Related courses

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 courses are delivered in virtual classroom format or at our downtown Toronto location at 1 Yonge Street, Suite 1801 (Toronto Star Building), Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you'd like to arrange custom onsite training or an online course on a date that's convenient for you.

Copyright 2022 Avantix® Learning

You may also like

Use Excel Conditional Formatting to Highlight Dates Before Today (3 Ways)

Use Excel Conditional Formatting to Highlight Dates Before Today (3 Ways)

You can use conditional formatting in Excel to highlight cells containing dates before today or within a date range before the current date. In a worksheet, you can use conditional formatting to highlight selected cells by filling them with a color based on rules or conditions. This type of formatting is helpful if you want to highlight past due dates such as invoices that are 30, 60 or 90 days overdue.

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 (Using Formulas)
Article Name
How to Highlight Errors, Blanks and Duplicates in Microsoft Excel (Using Formulas)
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