How to Remove Duplicates from Two Excel Columns and Exclude Matching Values
Question details
The user wants to generate unique lists from two separate columns and ensure that any values present in the first column are excluded from the second column's unique list.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Data cleaning and deduplication across multiple dataset columns.
- Observed behavior
- Needs to create distinct lists without overlapping values between the two specified columns.
Ensure your spreadsheet software is updated to a version that supports dynamic array functions such as UNIQUE, FILTER, and XMATCH before proceeding.
Use Dynamic Array Formulas to Extract Unique Values
Utilize the UNIQUE, FILTER, and XMATCH functions to automatically generate distinct lists and exclude cross-column duplicates.
This method leverages dynamic array functions to automatically spill the results into adjacent cells, ensuring your extracted lists update instantly if the source data changes.
Select an empty cell (e.g., D2) and enter =UNIQUE(A2:A151) to get a list of all unique values from your first data column.
Select another empty cell (e.g., E2) and enter =UNIQUE(FILTER(B2:B151,ISERROR(XMATCH(B2:B151,A2:A151)))). This checks column B against column A, excludes any matches, and returns only the remaining unique values.
Hit Enter after typing the formulas. The distinct, non-overlapping lists will automatically spill down the respective columns.

Easily Filter Data and Remove Duplicates with WPS Spreadsheet
WPS Spreadsheet fully supports dynamic array functions like UNIQUE, FILTER, and XMATCH. You can process complex datasets, eliminate duplicates, and extract unique values quickly without paying for expensive software.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the two columns you want to deduplicate.
- 2. Apply the UNIQUE formula: Click on a blank cell and type the =UNIQUE() formula to instantly extract non-repeating values from your primary column.
- 3. Combine FILTER and XMATCH: Use =UNIQUE(FILTER()) alongside the XMATCH function in the next column to effortlessly exclude values that already appeared in the first column.

Frequently Asked Questions
Why is the UNIQUE or FILTER formula returning a #NAME? error?
The #NAME? error typically occurs if your spreadsheet software version does not support dynamic array functions. Upgrading to the latest version of WPS Office or Excel will resolve this issue.
Can I use this method to compare more than two columns?
Yes, but the formula becomes more complex. You would need to nest additional XMATCH or COUNTIF functions within the FILTER criteria to exclude matches from multiple preceding columns.
Is there a non-formula way to remove duplicates from two columns?
Yes. You can copy both columns into a single column, use the 'Remove Duplicates' feature found under the Data tab, and then separate the data manually if needed. However, this is a static method and will not update automatically if the original data changes.




