Imagine working with survey results, inventory lists, or crucial financial reports, where clean and accurate data is the priority. Duplicate entries, such as an item added twice in the inventory list or survey responses with repetitive entries, can clutter the information and interfere with your decision-making. However, if you know how to remove Google Sheets duplicates, you can handle data cleaning confidently to manage large datasets in this one of the best free spreadsheet software and make the right decisions.
Before understanding the various step-by-step methods to delete duplicates in Google Sheets in this article, let’s help you identify them.
You can use conditional formatting and a custom formula generated with Gemini to find and highlight duplicates in Google Sheets. Here is how.
Now that you have the duplicates, you can decide to keep or delete them.
Various methods are available to get rid of duplicates in Google Sheets, including the built-in tool, formulas, pivot tables, conditional formatting, and Apps Script. The built-in Remove Duplicates tool is the easiest option and is recommended for beginners or anyone who wants a quick, manual fix, especially for large datasets.
Formulas such as UNIQUE or QUERY are useful when you want a dynamic table that updates automatically as your data changes, without altering the original data. Pivot tables are useful for analyzing or summarizing data while removing duplicates at the same time. Conditional formatting is best for visually identifying duplicates before removing them manually.
Apps Script is ideal if you need to automate duplicate removal or handle continuous updates in larger or more complex sheets. Below are all the methods explained step by step, so you can choose the one that best fits your needs.
Also know: How to Change the Sound of Your Google Assistant’s Voice
You can use UNIQUE and QUERY functions to clear duplicates in Google Sheets. Below is how to remove duplicates in Google Sheets using formulas.
The UNIQUE function creates a separate dynamic table that updates automatically when you change the original data, based on the current columns. Importantly, using UNIQUE does not modify or remove your original data at all. The original dataset remains untouched, and the function simply displays a different table with only unique values. This makes UNIQUE a safe method for anyone who wants to remove duplicates while preserving all original information.
While the QUERY function is not a dedicated formula for deleting duplicates in Google Sheets, it filters and manipulates data based on specific criteria and can be used to remove duplicates. Here is how to get rid of duplicates in Google Sheets using the QUERY function.
Pivot tables rotate the data set to view it from another perspective or perform data reorganization before changing it. Displaying the data in the pivot table locates and removes duplicates. Below is how to remove all duplicates in Google Sheets using pivot tables.
Also know: How To Setup and Use Google Docs Offline
Conditional formatting is not a dedicated method to remove duplicates in Google Sheets. To delete Google Sheets duplicates using conditional formatting, you need to identify and highlight duplicates and then delete them. Here is how to do this.
=(COUNTIF($A$1:$A,$A1)>1)*
(COUNTIF($B$1:$B,$B1)>1)*
(COUNTIF($E$1:$E,$E1)>1)*
(COUNTIF($I$1:$I,$I1)>1)
Replace the values in the above formulas with the columns you selected.
Apps Script is a method advanced users can use to create a custom function to remove duplicates in Google Sheets and delete duplicates according to the preset conditions. This approach is helpful when your sheet accumulates new entries continuously. With Apps Script, you can set the conditions, such as columns to analyze, in the function and run it to get rid of duplicates. Here is how.
function removeDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var newData = [];
for (var i in data) {
var row = data[i];
var duplicate = false;
for (var j in newData) {
if (row.join() == newData[j].join()) {
duplicate = true;
}
}
if (!duplicate) {
newData.push(row);
}
}
sheet.clearContents();
sheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
}
function removeDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var rng = sheet.getRange(“B1:F”)
var data = rng.getValues();
var newData = new Array();
for(i in data){
var row = data[i];
var duplicate = false;
for(j in newData){
if(row.join() == newData[j].join()){
duplicate = true;
}
}
if(!duplicate){
newData.push(row);
}
}
rng.clearContents();
sheet.getRange(1, 1, newData.length,
newData[0].length).setValues(newData);
}
That’s all for the methods to remove Google Sheets duplicates. Below, we answer a few related questions to clear up any remaining confusion.
Also know: Best Google Chrome Extensions | Chrome Security Plugins
To remove duplicates but keep their position, i.e., delete duplicates without changing your data set’s order, you can identify and highlight duplicates using conditional formatting and then remove duplicates manually, as explained in the guide above.
The quickest way to remove Google Sheets duplicates is using the built-in Remove Duplicates tool. To get rid of duplicates, select the cell range with duplicates, follow the path Data menu => Data cleanup => Remove duplicates, check if the chosen data range has a header row, select the columns to perform the analysis for duplicates, and then click Remove Duplicates.
You can use the built-in remove tool or the UNIQUE function to delete duplicates but keep the first instance in Google Sheets. It deletes duplicate rows and keeps only the first copy in Google Sheets.
You can use the UNIQUE function, as explained in the guide above, to delete duplicates in one column in Google Sheets. Alternatively, you can identify duplicates using conditional formatting and then remove them manually.
To get rid of duplicates in Google Sheets from 2 or more different columns, you can use the pivot table to remove duplicates in a separate sheet automatically, the UNIQUE function to remove duplicates from an integral data range, or the QUERY function.
You can block duplicates using Data Validation to prevent them in Google Sheets. To block duplicates with Data Validation, select the column or range where you wish to prevent duplicates, click Data, click Data Validation, click Add Rule, click the Criteria dropdown, click Custom formula is, enter the formula: =COUNTIF(A:A, A1)=1 ( in this formula, change A:A to your selected column letter and A1 to the first data cell, click Advanced Options, click Reject Input, click Show help text, enter a custom alert, click Done.
Hopefully, this makes it clear how to remove Google Sheets duplicates to maintain information clarity and accuracy. If you are a beginner, we suggest using the built-in Remove Duplicates feature. However, if you do not want to alter your original dataset, you can run a Google Sheets formula or create a pivot table. If you are comfortable with coding, you can also use Apps Script. If you want to identify and highlight duplicates and then remove them manually, you can use conditional formatting. If you have any questions or concerns, you can leave us a comment.
Dell Pro 14 Premium is a top-of-the-shelf laptop in the Dell Pro series, targeted at…
A Snapchat streak is a badge of honor for your friendships. Unique to Snapchat, one…
The PS4, or PlayStation 4, is like a dream gaming console for almost every passionate…
The weak password for your email, Yahoo account, and even your iPhone makes it easier…
So, where does your page rank on Google? Well! You can easily track your Google…
Google Gravity trick is a web experiment where the Google homepage gives in to gravity.…