Use Conditional Formatting 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 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.

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 (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.

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

How to Insert or Type Greek Letters or Symbols in PowerPoint (5 Ways)

Related 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 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 live 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 training on a date that's convenient for you.

Copyright 2021 Avantix® Learning

You may also like

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

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

You can apply strikethrough to text or values in Excel to cross out or create a line through a cell or part of a cell. There are 3 common ways to apply strikethrough in your Excel worksheets – using a built-in keyboard shortcut, using the Font dialog box, or by adding a command to the Quick Access Toolbar.

How to Lock the Position of a Slicer in Excel

How to Lock the Position of a Slicer in Excel

Slicers are a great tool in Excel to filter tables or pivot tables. You can lock the position of a slicer in an Excel worksheet using a two-step process. First, select the slicer or slicers and Disable resizing and moving in the Format Slicer task pane (and choose other options based on your preferences). Second, protect the sheet using the Review tab in the Ribbon. There are a few important options you’ll need to select to get this to work.

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