Google Spreadsheet Remove Duplicate Rows: A Step-by-Step Guide

Author

Reads 1.2K

Persons Pointing at the Numbers on the Invoice
Credit: pexels.com, Persons Pointing at the Numbers on the Invoice

Removing duplicate rows in Google Spreadsheets can be a real time-saver, especially when working with large datasets. You can use the "Remove duplicates" feature to quickly eliminate duplicates and get down to business.

One of the most common reasons for removing duplicates is to prepare data for analysis. This feature is particularly useful when you need to merge data from multiple sources, but end up with duplicate entries.

To remove duplicates, you can use the "Data" menu and select "Remove duplicates". This feature is available in all Google Spreadsheet versions.

How to Remove Duplicates

Removing duplicates from your Google spreadsheet can be a tedious task, but don't worry, I've got you covered.

To start, you can use the Remove Duplicates tool, which is a Google Sheets native tool that's super straightforward. You can find it under Data > Data cleanup tab and click Remove duplicates.

If your table has a header row, be sure to check the "Data has header row" box so that Google ignores those rows when removing duplicates. Once you've configured the removal of duplicates, click on the "Remove duplicates" button at the bottom of the dialog box.

A different take: Delete Duplicates Dropbox

Credit: youtube.com, Remove duplicates in Google Sheets

Alternatively, you can use formulas to remove duplicates. The UNIQUE function is great for small, simple datasets or when you need to remove duplicates inside a nested formula.

Here are the steps to remove duplicates using formulas:

  1. Step 1: Select the rows with TRUE values (the duplicates) and delete them.
  2. Step 2: Select the remaining rows and they will be the unique values.

If you're unsure if you have duplicates and want to check your data, you can use Pivot Tables. They're extremely flexible and fast to use, making them a great tool for the job.

To use the Remove Duplicates tool, follow these steps:

  1. Data > Data cleanup > Remove Duplicates.
  2. Choose which columns you want to check for duplicates.
  3. The duplicates will be removed and you'll be presented with a summary report, telling you how many duplicates were removed.

You can also use Conditional Formatting to highlight duplicates in Google Sheets. This is a great way to visually identify the duplicates and remove them manually.

Here's a rundown of when to use the different methods:

  1. Method 1: Remove Duplicates tool is the easiest method of removing duplicates.
  2. Method 2: Formulas The UNIQUE function is great for small, simple datasets or when you need to remove duplicates inside a nested formula.
  3. Method 3: Pivot Tables are a great way to highlight duplicates in Google Sheets.
  4. Method 4: Conditional Formatting is a great way to highlight duplicates in Google Sheets.
  5. Method 5: Apps Script is useful for developers who want to remove duplicates from Sheets as part of their apps.

Pivot Tables and Counting

Pivot tables can be used to count duplicates in Google Sheets. To do this, go to Insert > Pivot table, specify your data range and a place for the pivot table.

In the pivot table editor, add a column with your duplicates (Name in my example) for Rows and for Values. If your column contains numeric records, pick COUNT as a summary function for Values to count duplicates in Google Sheets. If you have text, select COUNTA instead.

The pivot table will feature each item from your list and get you the number of times it appears there. For example, if you have a column with invoice numbers, the pivot table will show you how many times each number appears.

COUNTIF

Flat Screen Computer Monitor
Credit: pexels.com, Flat Screen Computer Monitor

The COUNTIF function is a powerful tool in Google Sheets that can help you find duplicates in your data. It's a simple and efficient way to identify duplicate values, especially when you're working with a large dataset.

To use COUNTIF, you'll need to create a new column next to the data column you want to check for duplicates. Then, use the formula in cell B2 to highlight the duplicates in column A, making sure to lock the range to the top of the column with the $ sign.

This formula checks for duplicates in the current row back up to the top, and when a value shows up for the first time, the count will be 1, so the formula result will be false. But when the value shows up a second time, the count will be 2, so the formula result will be TRUE.

If you have a large dataset with many duplicates, it's best to turn the Duplicate column into values, sort by this column, and then delete them in one big group. This method is most suitable for finding duplicates in Google Sheets.

The COUNTIF function is a great alternative to wasting cells with another dataset, and it can be used to count duplicates in a single column. However, if you need to count duplicates in multiple columns, you'll need to use a different function, like COUNTIFS.

Additional reading: Google Drive Duplicate Files

Pivot Table Counting

Women working in a traditional outdoor market sorting and filtering grains using wicker trays.
Credit: pexels.com, Women working in a traditional outdoor market sorting and filtering grains using wicker trays.

To count duplicates in Google Sheets using a pivot table, you need to add the column with duplicates as Rows and Values in the pivot table editor. This will give you a count of how many times each item appears in your list.

You can pick COUNT as a summary function for Values to count duplicates if your column contains numeric records, or COUNTA if you have text records. This will help you see which items are duplicates and how many times they appear.

A new tab will open with the Pivot Table editor, where you can choose the column you want to check for duplicates under ROWS. Then, in VALUES, choose another column and make sure it's set to summarize by COUNT or COUNTA.

The Pivot Table will then display the count of each item, making it easy to identify duplicates. For example, if you have an invoice number column, duplicates will have a count greater than 1.

Credit: youtube.com, Pivot Table Count Features and Options

Here are the steps to count duplicates in a Pivot Table:

  1. Go to Insert > Pivot table, specify your data range and a place for the pivot table
  2. Under ROWS, choose the column you want to check for duplicates
  3. Then in VALUES, choose another column and make sure it's set to summarize by COUNT or COUNTA

By following these steps, you can easily count duplicates in your Google Sheets data using a pivot table.

Highlighting and Formatting

You can highlight duplicates in Google Sheets using conditional formatting. This will help you spot duplicates at a single glance.

To start, open the conditional formatting settings by going to Format > Conditional formatting. Make sure the Apply to range field contains the range of cells where you want to highlight duplicates.

In the Format rules section, pick Custom formula is and enter the COUNTIF formula: =COUNTIF($B$2:$B$10,$B2)>1. This formula checks for duplicates in column B.

If you only want to scan for duplicates in specific rows or columns, simply update the data range under Apply range to match the cell range you want to check for repeats.

You can also highlight duplicate rows by adjusting the range to apply the rule to multiple columns.

Credit: youtube.com, How to Find and Remove Duplicates in Google Sheets

To customize how your duplicates will appear on the spreadsheet, go to Formatting style. Then click Done.

Here are some options for formatting styles:

  • White fill color
  • Colored fill color

Once you highlight duplicates in your Google Sheets, you can filter the data by color. You can either filter the column so that only cells with the white fill color remain visible, or keep only colored cells visible.

If you have a large dataset with many duplicates, it's best to turn the Duplicate column into values, sort by this column, and then delete them in one big group.

Deleting Rows and Entries

Deleting rows and entries can be a bit tricky, but don't worry, I've got you covered. You can use the UNIQUE function to remove duplicates, and there are two ways to do it.

You can delete duplicate rows, keeping only the first occurrences, by using the UNIQUE function with the range of your data. For example, if your data is in cells A1:C10, you can enter the formula =UNIQUE(A1:C10) and it will return all unique rows and first occurrences.

Credit: youtube.com, How to Find and Remove Duplicates in Google Sheets

To delete all duplicate rows, even the first occurrences, you need to add two more arguments to the UNIQUE function. You can skip the second argument, but add the third, which tells the function to delete not only duplicates but also their first entries. So, the formula would be =UNIQUE(A1:C10,,TRUE).

This will return only unique rows, without any duplicates, including the first occurrences.

Using Apps Script

You can remove duplicates in Google Sheets using Apps Script, a relatively straightforward process that allows you to run it over and over as needed.

The advantage of writing an Apps Script program is that you can run it over and over, for example each time you add new data.

This program removes duplicates from a dataset in Sheet 1, working as follows: Get the values from the data range in Sheet1, turn the array rows into strings for comparison, filter out any duplicate rows, and check whether a de-duplicate sheet exists.

If this caught your attention, see: Remove Double Folder from Onedrive

Credit: youtube.com, Remove Duplicates Automatically in Google Sheets | Apps Script Course (27)

Here's a step-by-step breakdown of the process:

  • Get the values from the data range in Sheet1
  • Turn the array rows into strings for comparison
  • Filter out any duplicate rows
  • Check whether a de-duplicate sheet exists

You can also add a custom menu to run it from your Google Sheet rather than the script editor window.

How to Add Extensions

To add extensions to Google Sheets, you can visit the Google Workspace Marketplace.

There, you can search for and install the Remove Duplicates add-on, which is an advanced tool that offers 7 different ways to handle duplicates.

The add-on resides in your Google Sheets and can be found under the Extensions.

Once installed, it provides a user-friendly process with 4 steps to select the range, what to find, the columns, and what to do with the found duplicates or uniques.

You can also use other add-on extensions to remove duplicates in Google Sheets.

Method 5: Apps Script Steps

Creating an Apps Script program to remove duplicates in Google Sheets is relatively straightforward. You can run it over and over, for example, each time you add new data.

Credit: youtube.com, Google Apps Script for Beginners: Automate Google Sheets (and Anything Else) Like a Pro!

To get started, you'll need to write a small script file that can remove duplicate rows from your datasets. This program removes duplicates from a dataset in Sheet 1.

Here's a step-by-step guide to help you create your own Apps Script program:

1. Get the values from the data range in Sheet1, using Apps Script.

2. Turn the array rows into strings (blocks of text) for comparison.

3. Filter out any duplicate rows.

4. Check whether a de-duplicate sheet exists.

5. If it does, clear out the old data and paste in the new de-duplicated data.

6. If it does not exist, create a new sheet and paste in the new de-duplicated data.

7. Add a custom menu to run from the Google Sheet.

You can also add a custom menu to run it from your Google Sheet rather than the script editor window. The code for this simple duplicate program is also available on GitHub.

To run the script, save your script and click on the Run button at the top to remove duplicates.

Configuring and Managing

Credit: youtube.com, How To Remove Duplicate Rows In Google Sheets

Configuring and managing duplicates in Google Sheets is a breeze. To start, select the range of cells containing the data you want to work with.

You'll need to configure the removal of duplicates by checking the "Remove duplicates" dialog box. This is where you'll find checkboxes next to each column in your selected range.

The combination of values in these columns will determine duplicates in your spreadsheet. It's a good idea to check the "Data has header row" box if your selected dataset has column names, so Google ignores those rows when removing duplicates.

Once you've configured the removal of duplicates, click on the "Remove duplicates" button at the bottom of the dialog box. This will get the job done quickly and efficiently.

Identify

Identify duplicate rows in your Google Spreadsheet by using the COUNTIFS function. This function scans each column for its first value and counts only those rows where all records in all columns appear several times in the table.

Credit: youtube.com, Master Duplicate Values in Google Sheets | Highlight, Find, and Remove Duplicates with Ease! Part-1

To mark absolute duplicate rows, start with the same COUNTIFS formula from before and enclose it in IF. This checks the number of repeated rows and if it exceeds 1, the formula names the row as a duplicate.

The formula =COUNTIFS($A$2:$A$10,$A2,$B$2:$B$10,$B2,$C$2:$C$10,$C2) counts the number of rows with identical values in all three columns.

You can also use the formula =IF(COUNTIFS($A$2:$A10,$A2,$B$2:$B10,$B2,$C$2:$C10,$C2)>1",Duplicate"",") to identify duplicate rows.

To remove duplicate data, select the data range on your sheet in Google Sheets, and a dialogue box will appear with the data range you selected.

General Information

Google Sheets is a powerful tool for organizing and analyzing data. You can make a copy of a spreadsheet to practice working with it, such as the "Find & remove duplicates in Google Sheets" example.

To remove duplicate rows in Google Sheets, you'll need to have a spreadsheet with data to work with.

A different take: Dropbox Spreadsheet

Suggestions for Improvement

To improve your understanding of general information, consider the following suggestions.

Focused woman using a laptop in a modern office setting, wearing a white blazer, working diligently.
Credit: pexels.com, Focused woman using a laptop in a modern office setting, wearing a white blazer, working diligently.

Firstly, it's essential to have a clear and organized system for storing and retrieving information. This can be achieved by using a reliable note-taking method, such as the Cornell Note-taking System, which involves dividing notes into two columns for main ideas and supporting details.

Having a good understanding of the importance of accuracy in information can also be beneficial. As mentioned in the "Sources of Information" section, relying on credible sources like academic journals and government reports can help ensure the accuracy of information.

To improve your critical thinking skills, try to evaluate information from multiple sources before accepting it as true. This can be done by looking for potential biases and inconsistencies in the information.

Developing a habit of regularly updating your knowledge on various topics can also be helpful. By staying current with the latest developments in different fields, you can better appreciate the complexities of general information.

Focusing on understanding the context and purpose of information can also enhance your comprehension. As discussed in the "Understanding Information" section, considering the author's intent and the intended audience can provide valuable insights into the information.

Spreadsheet

Credit: youtube.com, Google Sheets Tutorial for Beginners 🔥

You can use a spreadsheet to find and remove duplicates in Google Sheets, just like the example shows, and it's a great tool for organizing and analyzing data.

Spreadsheets are super versatile and can be used for a variety of tasks, from budgeting to tracking inventory.

To create a spreadsheet, you can start with a blank template and add your own formulas and data, just like the example with the Google Sheets formula examples.

One of the most useful features of spreadsheets is the ability to use formulas to perform calculations and operations, such as finding and removing duplicates.

You can also use spreadsheets to make copies of existing documents, like the example shows, to practice and experiment with different formulas and techniques.

Oscar Hettinger

Writer

Oscar Hettinger is a skilled writer with a passion for crafting informative and engaging content. With a keen eye for detail, he has established himself as a go-to expert in the tech industry, covering topics such as cloud storage and productivity tools. His work has been featured in various online publications, where he has shared his insights on Google Drive subtitle management and other related topics.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.