How to Find Duplicates in Excel Using a Formula - Spreadsheeto (2024)

Highlight Duplicates using Conditional Formatting

One of the ways to find and highlight duplicates in Excel is by using Conditional Formatting.

Conditional formatting makes it easy to highlight certain values or make particular cells easy to identify. This changes the appearance of a cell range based on a condition (or criteria).

Open your sample Excel workbook and let’s use conditional formatting to find duplicate cells in our worksheet.

Step 1) Select the cells that you want to check for duplicates.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (1)

Step 2) Go to the Home Tab.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (2)

Step 3) In the Styles group, click Conditional Formatting and a drop-down will appear.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (3)

Step 4) When the drop-down menu appears, hover your cursor over the Highlight Cells Rules option and it will show another menu.

Step 5) Click the Duplicate Values option.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (4)

A Duplicate Values dialog box will appear.

Step 6) Select how you want the duplicate values will appear by clicking the drop-down arrow.

Step 7) Click OK.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (5)

The steps above highlight duplicates in your item list. In our sample worksheet, duplicate values appear in light red fill with dark red text. 🔍

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (6)

Find Duplicates using the COUNTIF Function

Another way to find duplicate values in your data set is by using the COUNTIF Function.

The COUNTIF function is one of the statistical functions that counts the number of cells that meet a criterion;

In its simplest form, COUNTIF says:

=COUNTIF(Where do you want to look?, What do you want to look for?)

The syntax of this function is =COUNTIF(range, criteria) with the following arguments:

  • range (required) – the range of cells you want to count. Range can contain numbers, arrays, a named range, or references that contain numbers. The blank and text values are ignored.
  • criteria (required) – a number, expression, cell reference, or text string that determines which cells will be counted.

You can use the COUNTIF function to find duplicates including or excluding the first occurrences. We will show you how in the next sections. 👇

Including 1st occurrences

In our sample workbook, let’s use the COUNTIF function to find duplicates in the list of items in column A.

To start,

Step 1) Double-click cell B2 and type

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (7)

Step 2) For the range, select the cells A2 to A10. This is the range of cells you want to count. Then, type a comma symbol (,)

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (8)

Step 3) For the criteria, select the first cell (Cell A2) which contains the text “Apple”, a cell value we want to find any duplicates. Then close the formula with a right parenthesis.

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (9)

Step 4) Type a greater than symbol (>) and type 1.

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (10)

Step 5) Press Enter.

Fill in the rest of the cells by double-clicking or dragging down the Fill Handle.

As you can see, the COUNTIF formula returns TRUE for duplicate values and FALSE for unique values. 👍

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (11)

Note that using this formula doesn’t result the cells below as duplicates. That is why the COUNTIF formula above is not good to use. 😬

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (12)

When selecting a range of cells in Excel, it’s important to lock the range of cells with the dollar ($) sign. This fixes the reference to a given cell so that it remains unchanged no matter where the formula moves.

In the steps done above, it’s better to use this formula:

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (13)

This shows correct results.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (14)

The above example shows how important relative and absolute cell references are. Click this article to learn more about how important is the dollar sign ($) and how to use it in your Excel formulas.💡

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (15)Kasper Langmann, co-founder of Spreadsheeto

You can make the duplicate formula into something more clear and meaningful than the Boolean values of TRUE and FALSE.

For this, utilize another function, the IF function.

You can enclose the duplicate formula we’ve used above and type the labels you want for duplicate and unique values.

For example, the formula returns “Duplicate” for duplicate values and “Unique” for unique values. You can copy this formula below:

Click to copy

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (16)

This makes it more clear. 👍

In case, you want an Excel formula to only find duplicates, replace “Unique” with an empty string (“”) like this, use this formula.

Click to copy

The formula will return “Duplicates” for duplicate records, and a blank cell for unique records.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (17)

Excluding 1st occurrences

Notice that the first occurrence of “Apples” in our list is a duplicate. 👀

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (18)

This is because using the above formula marks all the identical records as duplicates. If you decide to remove duplicates by then, you may lose some of the unique data in the process.

To avoid this, you must exclude the first occurrences and only delete the 2nd and other subsequent instances. 😊

Let’s try to use this formula:

Click to copy

and press Enter.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (19)

Then double-click or drag down the fill handle to fill in the rest of the cells.

Now, the first occurrences of the items aren’t identified as duplicates. Only the second occurrences are.

How to Find Duplicates in Excel Using a Formula - Spreadsheeto (20)

That’s It—Now What?

Awesome!

Finding duplicates shouldn’t be stressful at all. With Microsoft Excel’s features and formulas, you can do this easily and quickly.

What else can Microsoft Excel do for you? Check out these related articles we’ve picked for your next read: 📚

  • How to Find and Remove Duplicates in Excel (Easily)
  • Use This Excel Formula to Remove Duplicates (Fast)
  • How to Search for Words and Names in Excel Sheet
  • How to Use COUNTIF in Excel: Step-by-Step (+COUNTIFS)
  • How to use the IF and AND function in Excel (Examples)
How to Find Duplicates in Excel Using a Formula - Spreadsheeto (2024)
Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6123

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.