How To Check For Duplicates In Google Sheets

6 min read

Checking for duplicate entries in Google Sheets is a common task for anyone who works with spreadsheets, whether you are managing a sales list, a contact database, or a project tracker. Duplicate rows can distort analysis, inflate totals, and make your data look unprofessional. In practice, this article explains how to check for duplicates in Google Sheets step by step, covering simple visual methods, built‑in tools, formula‑based techniques, and even a quick script for power users. By the end, you will have a toolbox of reliable approaches that fit any workflow No workaround needed..

Introduction

When you open a Google Sheet, the first thing you notice is the grid of cells arranged in rows and columns. Each row typically represents a single record, and each column holds a specific attribute of that record. If the same record appears more than once, you have a duplicate. Which means detecting duplicates early saves time and prevents errors in reporting, budgeting, or any data‑driven decision‑making. The methods described below are all native to Google Sheets, so you don’t need additional software or programming expertise.

Understanding What Constitutes a Duplicate

Before you start the detection process, clarify what counts as a duplicate in your context.

  • Exact duplicate: All columns in a row contain identical values.
  • Partial duplicate: Only a subset of columns (for example, the same email address but different names) repeats.

Deciding this distinction will determine whether you use a blanket “remove all duplicates” command or a more nuanced formula that checks specific columns. Partial duplicates often require custom logic, while exact duplicates can be handled with simple tools.

Preparing Your Data

  1. Clean the header row – see to it that the first row contains clear, unique column titles.
  2. Remove empty rows – Blank rows can interfere with formulas and conditional formatting.
  3. Standardize data – Convert text to lowercase, trim extra spaces, and unify date formats. Inconsistent data can cause false negatives when checking for duplicates.

Once your data is tidy, you can apply any of the methods described below with confidence.

Method 1: Using Conditional Formatting to Highlight Duplicates

Conditional formatting lets you visually spot duplicates without altering the data itself.

Steps

  1. Select the range you want to examine (e.g., A2:D100).

  2. Click Format > Conditional formatting It's one of those things that adds up..

  3. Under “Format cells if,” choose Custom formula is.

  4. Enter a formula that counts occurrences of the current row within the selected range. Here's one way to look at it: to flag duplicate rows based on columns A through D:

    =COUNTUNIQUE($A2:$D2) < COUNTA($A2:$D2)
    

    Explanation: COUNTUNIQUE returns the number of unique combinations in the current row. If that number is less than the total number of non‑empty cells, the row contains at least one repeated value.

  5. Choose a formatting style (bold text, red fill, etc.) and click Done Worth keeping that in mind..

The duplicate rows will now be highlighted, making them easy to review or delete.

Method 2: Using the “Remove Duplicates” Feature

If you need to eliminate duplicates rather than just identify them, Google Sheets offers a built‑in command Most people skip this — try not to..

Steps

  1. Select the entire data range, including headers (e.g., A1:E200).
  2. Go to Data > Data cleanup > Remove duplicates.
  3. In the dialog, decide whether to Data has header row (usually checked).
  4. Choose which columns to consider for duplication.
    • To find exact duplicates across all columns, leave all columns selected.
    • To find duplicates based on a specific key (e.g., email address), deselect all except that column.
  5. Click Remove duplicates.

Google Sheets will instantly delete repeated rows, keeping only the first occurrence. A confirmation dialog tells you how many duplicates were removed.

Note: This action is permanent. Always make a copy of your sheet before using this feature, or work on a duplicate tab.

Method 3: Formula‑Based Detection with COUNTIF and UNIQUE

For greater flexibility—especially when you want to list duplicates instead of just highlighting them—use formulas.

3.1. List Unique Values

Place this formula in an empty cell to generate a list of all unique rows:

=UNIQUE(A2:D100)

UNIQUE returns each distinct combination of values from the specified range. Still, if you only need to check for duplicates in a single column (e. g.

=UNIQUE(C2:C100)

3.2. Count Occurrences with COUNTIF

To see how many times each value appears, use COUNTIF. Take this: to count how many times each email shows up:

=ARRAYFORMULA({C2:C100, COUNTIF(C2:C100, C2:C100)})

The result is a two‑column array: the email address and its frequency. Any count greater than 1 signals a duplicate.

3.3. Highlight Duplicates with Conditional Formatting Using COUNTIF

You can also create a conditional format that flags rows where a specific column appears more than once:

  1. Select A2:D100.

  2. Format > Conditional formatting.

  3. Choose Custom formula is and enter:

    =COUNTIF($C$2:$C$100, $C2) > 1
    

    (Replace C with the column you are checking.)

  4. Set a striking format style and click Done That's the part that actually makes a difference..

Rows where the email in column C appears more than once will be highlighted The details matter here..

Method 4: Advanced Detection with Google Apps Script

For large datasets or complex criteria, a short script can automate duplicate detection and even move or flag duplicates And it works..

Sample Script

function highlightDuplicates() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var range = sheet.getDataRange();
  var values = range.getValues();

  // Create a map to count occurrences of each row (as a string)
  var map = {};
  for (var i = 1; i < values.length; i++) { // start at 1 to skip header
    var key = values[i].join("|"); // concatenate row values with a delimiter
    map[key] = (map[key] || 0) + 1;
  }

  // Apply red background to duplicate rows
  for (var i = 1; i < values.Even so, length; i++) {
    var key = values[i]. Now, join("|");
    if (map[key] > 1) {
      sheet. getRange(i + 1, 1, 1, values[i].length).

  sheet.getRange(i + 1, 1, 1, values[i].length).setBackground('#ffcccc');
}

}

// Optional: mark only duplicate occurrences after the first var seen = {}; for (var i = 1; i < values.So length; i++) { var key = values[i]. join("|"); if (seen[key]) { sheet.Consider this: getRange(i + 1, 1, 1, values[i]. length).

No fluff here — just what actually works Simple, but easy to overlook..

This script gives you a programmatic way to enforce data quality. You can adapt the delimiter, add multiple columns, or even write the duplicate keys to another sheet for review. For most users, however, the built-in formula and formatting options will cover everyday needs.

Conclusion

By combining quick visual checks with flexible formulas and optional automation, you can handle duplicates in Google Sheets efficiently. Start with conditional formatting for immediate spotting, move to COUNTIF and UNIQUE when you need lists or counts, and use Apps Script only when your dataset demands deeper control. Whichever path you choose, always test on a copy of your data and keep a backup before making permanent changes. With these strategies in place, you’ll be able to keep your spreadsheets clean, accurate, and ready for analysis.

Latest Batch

Fresh Reads

Neighboring Topics

Others Also Checked Out

Thank you for reading about How To Check For Duplicates In Google Sheets. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home