How to Filter Duplicate Rows When One is Confirmed in Excel
Question details
The user needs to display every row in a duplicate group if at least one row within that matching group has a specific column (e.g., Confirmed) set to 'Yes'.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Filtering and managing grouped duplicate records based on a single condition found within the group.
- Observed behavior
- The user wants an automated formula approach to conditionally filter whole duplicate groups based on the status of a single row, rather than manually checking each group.
Ensure your dataset is organized into clear columns, noting which column contains your duplicate identifiers (e.g., ID or Name) and which column contains the confirmation status.
Use a Helper Column with the COUNTIFS Function
The most effective way to filter an entire group based on one row's condition is to create a helper column that checks the confirmation status of the whole group using the COUNTIFS function.
The COUNTIFS function counts how many times a specific condition is met across multiple criteria. By wrapping it in an IF statement, you can tag all rows in a matching group with 'Yes' if at least one row has the 'Confirmed' status.
Add a new column next to your dataset and name it something recognizable, such as 'Group Confirmed'.
In the first data cell of the helper column, enter the formula: =IF(COUNTIFS(C$2:C$12, C2, G$2:G$12, "Yes")>0, "Yes", "No"). Note: Replace Column C with your duplicate identifier column and Column G with your confirmation status column.
Press Enter, then click the bottom-right corner of the cell and drag the fill handle down to apply this formula to all rows in your dataset.
Highlight your header row, go to the Data tab, and click 'Filter'. Click the dropdown arrow on your new 'Group Confirmed' helper column and select 'Yes' to display only the matching duplicate groups.

Filter Complex Data Effortlessly with WPS Spreadsheet
WPS Spreadsheet offers powerful data processing capabilities, including advanced formulas like COUNTIFS, seamless filtering, and intuitive UI to help you manage duplicate records efficiently.
- 1. Open Your File in WPS: Launch WPS Spreadsheet and open your workbook containing the duplicate entries.
- 2. Insert the Helper Formula: Add a new column and input the COUNTIFS formula to identify groups with a confirmed status.
- 3. Apply Data Filters: Navigate to the Data tab on the top ribbon, click Filter, and sort your new helper column to display the required rows.

Frequently Asked Questions
Why does my COUNTIFS formula return incorrect results?
This usually happens if your cell ranges aren't locked with absolute references (e.g., $C$2:$C$12) or if there are leading/trailing spaces in your text. Double-check that your references are locked and your text exactly matches the criteria.
Can I highlight these duplicate groups instead of filtering them?
Yes. You can use the core logic of the formula (=COUNTIFS($C$2:$C$12, $C2, $G$2:$G$12, "Yes")>0) within the Conditional Formatting tool to apply a specific color to the entire group of duplicate rows without hiding the others.
Does this filtering method work for text or just numbers?
The COUNTIFS function works perfectly for both text strings and numerical data, provided that the duplicate identifiers in your target column match exactly.




