How to Compare, Sort, and Separate Matching Values in Excel
Question details
The user needs to compare two columns of alphanumeric values to identify matches, sort the results, and separate the duplicate and unique values.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Comparing two lists of data to find matching and unique entries for data organization and extraction.
- Observed behavior
- Identify matching and unique entries, sort the dataset based on the first column, and extract specific values based on whether they are duplicates or unique.
Ensure your data is organized into clear columns without blank rows, and that both columns you intend to compare are formatted identically (e.g., both formatted as Text or General) to avoid false mismatches.
Use the MATCH Formula and Data Filtering
This method uses a combination of an IF and MATCH formula to identify duplicates, followed by standard sorting and filtering tools to separate the data.
Assuming your values are in columns A and B, click on cell C1 and enter the formula `=IF(ISNUMBER(MATCH(A1,B:B,0)),"Match","No Match")`. Press Enter, then double-click or drag the fill handle down to apply it to all rows in your dataset.
Select your entire dataset (Columns A, B, and C). Navigate to the 'Data' tab on the top ribbon, click 'Sort', and choose to sort by Column A to organize your results alphabetically or numerically.
Highlight your column headers, go to the 'Data' tab, and click 'Filter'. Click the filter drop-down on Column C and select 'Match' to view and copy duplicate values, or 'No Match' to view and extract unique values to a new sheet.

Easily Compare and Filter Lists with WPS Spreadsheet
WPS Spreadsheet provides powerful functions and intuitive filtering tools to compare columns, find duplicates, and manage large datasets efficiently without lag.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the columns you want to compare.
- 2. Apply the comparison formula: In an empty adjacent column (e.g., C1), type `=IF(ISNUMBER(MATCH(A1,B:B,0)),"Match","No Match")` and drag the fill handle down the column.
- 3. Filter the results: Navigate to the 'Data' tab, select 'AutoFilter', and use the drop-down menu on your new column to isolate 'Match' or 'No Match' values.

Frequently Asked Questions
How can I visually highlight matching values instead of separating them?
You can use Conditional Formatting. Select the two columns you want to compare, navigate to the Home tab, click 'Conditional Formatting', choose 'Highlight Cells Rules', and then select 'Duplicate Values' to automatically color-code matching entries.
Does the MATCH function differentiate between uppercase and lowercase text?
No, the standard MATCH function is case-insensitive. If you need a case-sensitive comparison between your columns, you will need to use a combination of the EXACT and MATCH functions configured as an array formula.
Why is my formula returning 'No Match' for values that look exactly the same?
This usually happens due to formatting inconsistencies, such as one column being formatted as Text and the other as Numbers, or there might be hidden trailing spaces in one of the cells. Try using the TRIM() or VALUE() functions to clean your data before comparing.




