How to Identify Duplicate Data in Google Sheets: Using Functions and Conditional Formatting
In our previous article, we covered how to remove duplicate data in Google Sheets. This time, we’ll focus on how to extract duplicate data efficiently.
Using functions is ideal when you want to automate the extraction process, while conditional formatting is perfect for visually identifying duplicates at a glance. Both methods offer unique advantages depending on your specific needs.
Extracting Duplicate Data Using Functions
- To display all rows with duplicate data:
- Use a combination of the
FILTER()
andCOUNTIF()
functions.
- Use a combination of the
- To display duplicate data only once:
- Use a combination of the
UNIQUE()
andFILTER()
functions.
- Use a combination of the
There are two main methods to extract duplicate data using functions.
①Function to Display All Rows with Duplicate Data (FILTER and COUNTIF)
Example Formula:
=FILTER(A2:A, COUNTIF(A2:A, A2:A) > 1)
All duplicate data in column A will be displayed.
In this formula, the COUNTIF
function is used to check how many times each cell’s value appears, and the FILTER()
function extracts the data where the occurrence count is greater than 1.
This method is useful when you want to display all duplicate rows.
②Function to Display Duplicate Data Only Once (UNIQUE and FILTER)
Example Formula:
=UNIQUE(FILTER(A2:A, COUNTIF(A2:A, A2:A) > 1))
The duplicate data (e.g., “Laptop,” “Keyboard,” “Monitor”) will be displayed only once.
The FILTER()
function is used to extract the duplicate data, and the UNIQUE()
function then lists each duplicate data entry only once.
This method is useful when you want to identify the types of duplicate data.
To Display the Number of Duplicates for Each Data
Example Formula to Show Duplicate Counts:
=ARRAYFORMULA(IF(C2:C <> "", COUNTIF(A:A, C2:C), ""))
The number of times each data item in column C appears in column A will be displayed in column D.
This allows you to identify the types of duplicate data and their occurrence counts.
Highlighting Duplicate Data Using Conditional Formatting
Conditional formatting is a convenient way to visually identify duplicate data.
Choose the range of data where you want to find duplicates.
From the menu, select “Format” → “Conditional formatting.”
(You can also right-click and select “Conditional formatting” from the context menu.)
In the conditional formatting rules, select “Custom formula is” and enter the following formula.
Example Formula (to check column A):
=COUNTIF(A:A, A1) > 1
Choose your preferred color for highlighting and click “Done” to apply the formatting.
Conclusion
There are several methods to extract duplicate data in Google Sheets, including using functions and conditional formatting.
For more advanced customization, you can also use Google Apps Script (GAS) to extract duplicate data.
Choose the method that best fits your specific needs to streamline your workflow effectively.
- Functions: When you want to automatically filter duplicates.
- Conditional Formatting: When you need to visually identify duplicates.
- GAS (Google Apps Script): When customized processing is required.
弊社では、Google Apps Script(GAS)を活用した業務効率化のサポートを提供しております。
GASのカスタマイズやエラー対応にお困りの際は、ぜひお気軽にご相談ください。
また、ITツールの導入支援やIT導入補助金の申請サポートも行っております。
貴方の業務改善を全力でサポートいたします。
Comments