
The above formula will give you the result starting from the cell in which you entered the formula. The below formula would remove all the duplicate records and you will get all the unique ones: = UNIQUE ( A2:B17 ) Suppose you have the dataset as shown below and you want to remove all the duplicate records from this dataset: Google Sheets also has a function that you can use to remove the duplicate values and keep the unique values only.
#Excel remove duplicates how to
It simply deletes the duplicate records from the cells (without disturbing cells around the dataset) Also read: How to Highlight Duplicates in Google Sheets Remove Duplicates using the UNIQUE function This means that using it doesn’t remove the rows or delete any cells. When you use the ‘Remove Duplicates’ option to get rid of the duplicate records, it wouldn’t impact the data around it. The above steps would instantly remove all the duplicate records from the dataset and you would get the result as shown below. Click on the ‘Remove duplicates’ button.Make sure ‘Select All’ is selected (in the ‘Columns to Analyze’ section).In the Remove Duplicates dialog box, make sure ‘Data has header row’ is selected (in case your data has the header row).Select the dataset from which you want to remove the duplicate records.Suppose you have a dataset as shown below and you want to remove all the duplicate records from this dataset.īelow are the steps to remove duplicates from a dataset in Google Sheets: Removing duplicates is such a common thing people do in Google Sheets, that there is now a dedicated option to quickly remove the duplicate records. Remove Duplicates using the UNIQUE functionĭelete Duplicates Using the ‘Remove Duplicates’ Tool.Delete Duplicates Using the ‘Remove Duplicates’ Tool.
#Excel remove duplicates code
The following code sample shows the removal of entries with duplicate values in the first column. This means empty rows contained within in the range will be included in the RemoveDuplicatesResult. The value of an empty cell is treated like any other value. Empty cells are not ignored by removeDuplicates.If two different functions evaluate to the same result, the cell values are not considered duplicates. removeDuplicates considers cell values, not function results.When using a range's removeDuplicates method, keep the following in mind. The removeDuplicates method returns a RemoveDuplicatesResult object that specifies the number of rows removed and the number of unique rows remaining. When true, the top row is ignored when considering duplicates. The method also takes in a boolean parameter that specifies whether the first row is a header. This array is zero-based and relative to the range, not the worksheet. RemoveDuplicates takes in a number representing the column indices which are checked for duplicates. removeDuplicates does not affect the position of cells outside of the range. Rows in the range below the deleted row are shifted up. A row is deleted if a value in its specified column or columns appeared earlier in the range. The method goes through each row in the range from the lowest-valued index to the highest-valued index in the range (from top to bottom). The Range.removeDuplicates method removes rows with duplicate entries in the specified columns. For the complete list of properties and methods that the Range object supports, see Excel.Range class. This article provides a code sample that removes duplicate entries in a range using the Excel JavaScript API. Remove duplicates using the Excel JavaScript API
