how to remove duplicates in a column in google sheets

How to Remove Duplicates in a Column in Google Sheets

By Rachel Miller
AD

Ever found yourself dealing with duplicate entries in a Google Sheets column, wishing you could quickly remove them to keep your data clean and organized? You're not alone. Duplicates can sneak in from various sources, but fear not, as Google Sheets provides several methods to help you eliminate them efficiently. Let's dive into these solutions and get your spreadsheet back in shape.

Before we proceed, it's crucial to mention that removing duplicates is an irreversible action. Always download or create a backup of your data first to prevent any loss. Now, let's explore three powerful techniques to tackle this issue.

Using Data Removal Tool

The Data Removal tool in Google Sheets is an easy-to-use feature specifically designed to eliminate duplicates. Here's how to utilize it:

AD
5 Easy Methods to Remove Duplicates in Google Sheets – Clean Your Data Like a Pro!
5 Easy Methods to Remove Duplicates in Google Sheets – Clean Your Data Like a Pro!
How to Remove Empty Rows and Columns in Google Sheets
How to Remove Empty Rows and Columns in Google Sheets
4 Ways to Remove Duplicates in Google Sheets
4 Ways to Remove Duplicates in Google Sheets

1. Select the range containing the data, including headers if necessary.

2. Click on "Data" in the menu bar, then select "Data Removal Tool..."

Create a Unique List of Data Across Multiple Columns in Google Sheets
Create a Unique List of Data Across Multiple Columns in Google Sheets
How to Remove Duplicates in Google Sheets
How to Remove Duplicates in Google Sheets
2 Ways to Highlight and Remove Duplicates in Google Sheets - Make Tech Easier
2 Ways to Highlight and Remove Duplicates in Google Sheets - Make Tech Easier

Identifying Unique Columns

When the Data Removal Tool dialog box appears, you'll notice a preview of your selected range.

3. Next, select the columns you want to consider unique (duplicates will be removed based on these columns).

AD

Running the Tool

4. Once you've chosen the unique columns, click "Remove Duplicates..."

How to Remove Duplicates in Google Sheets – 4 Easy Ways
How to Remove Duplicates in Google Sheets – 4 Easy Ways
Remove Duplicates in Google Sheets (2 Quick and Easy Ways)
Remove Duplicates in Google Sheets (2 Quick and Easy Ways)
Google Sheets Trick: Find Duplicates Automatically ✨
Google Sheets Trick: Find Duplicates Automatically ✨
Remove Duplicates in Google Sheets: Rows, Columns, and Formulas
Remove Duplicates in Google Sheets: Rows, Columns, and Formulas
How to Highlight Duplicated Cells in Google Sheets
How to Highlight Duplicated Cells in Google Sheets
How to Add or Remove Rows and Columns in Google Sheets
How to Add or Remove Rows and Columns in Google Sheets

5. Click "Remove Duplicates" again in the confirmation dialog box to proceed.

The tool will remove duplicates, leaving you with a clean set of data. However, this method doesn't retain the original row order, so keep that in mind if the sequence matters.

AD

Using RemoveDuplicates Script

If you prefer a script-based approach, Google Apps Script offers a function called "RemoveDuplicates". This method doesn't disrupt the original order of data.

Find duplicates with COUNTIF (Excel and Google Sheets)
Find duplicates with COUNTIF (Excel and Google Sheets)
Clean Messy Data in Google Sheets: 5 Fixes (Trim, Duplicates, Phone Numbers)
Clean Messy Data in Google Sheets: 5 Fixes (Trim, Duplicates, Phone Numbers)
How to Remove Duplicates in Google Sheets
How to Remove Duplicates in Google Sheets

Here's a simple example of how to use it:

Writing the Script

1. Click on "Extensions" in the menu, then choose "Apps Script."

AD

2. Delete any existing code in the "Code.gs" file, and paste the following:

function removeDuplicates() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var range = sheet.getDataRange(); var values = range.getValues(); var uniqValues = removeDuplicatesFrom2DArray(values); sheet.clearContents(); sheet.getRange(1, 1, uniqValues.length, uniqValues[0].length).setValues(uniqValues); }

Running the Script

3. Save the project with a relevant name, like "RemoveDuplicates".

4. Run the function by clicking the play icon, and confirm by clicking "Run" in the dialog box.

After running, you'll have a fresh, duplicate-free dataset while preserving the original order.

Using the UNIQUE Function and Filter

Google Sheets also provides a simpler, albeit slightly more labor-intensive, method using the UNIQUE function and a filter.

Here's how to do it:

1. Assume your data starts from A1, and the first column has headers. In cell C1, enter "=UNIQUE(A:A)" to generate a list of unique values in column A.

Creating Unique List

2. Press Enter, and you'll see a list of unique values populated in column C.

Filtering Data

3. Click on cell C1 and drag it down to copy the formula for the entire column (or until you run out of data).

4. Click on the filter icon in the header of column C to apply a filter.

5. Click on the dropdown arrow in cell C1, then " filters", "Select all", and "Clear". This will hide all the duplicate entries, leaving you with only the unique ones.

6. Select your entire data range, including headers if necessary, and press Ctrl + C (Windows) or Command + C (Mac) to copy it.

7. Create a new, blank sheet, and paste your data (paste special as "values only" if needed) to get a clean dataset without duplicates.

There you have it - three effective methods to remove duplicates in a Google Sheets column. Now you can keep your spreadsheets organized and your data accurate. Happy.remove-duplicates:ing!

AD