Compare Two Columns in Excel. For efficient column comparison in Excel, utilize a combination of IF, ISERROR, and MATCH functions to spot duplicates or unique values.
Before diving in, are you aiming to pinpoint unique values in each column when comparing two lists? Explore our dedicated guide on comparing two lists for detailed assistance.
Compare Two Columns in Excel
Discovering Duplicates
Let’s delve into comparing two columns and identifying duplicates.
- Showcase the duplicates within the first column (these values are also present in the second column).
Explanation: In cell C1, the MATCH function returns 5 (representing letter A found at position 5 in range B1:B7). Consequently, ISERROR returns FALSE, and IF retrieves the value from A1. However, in C4, the MATCH function encounters a #N/A error (due to the absence of letter D in range B1:B7), making ISERROR return TRUE and IF produce an empty string.
- Highlight duplicates in the second column as well.
Note: Step 1 involved matching each value in the first column with the range in the second column. Step 2 reverses this, matching values in the second column with the range in the first column.
Distinct Values in Each Column
Seeking to display unique values in both columns? Easily swap the last 2 arguments of the IF function.
- Showcase the unique values in the first column (absent in the second column).
Note: Review the second image on this page, demonstrating the adjustment in the last 2 arguments of the IF function.
- Alternatively, reveal the unique values in the second column.
Note: Check out the third picture on this page, illustrating the switch in the last 2 arguments of the IF function.
Row-by-Row Comparison
For a swift row-by-row comparison, leverage the IF function within Excel.
- The IF function in cell C1 indicates “Match” when the value in A1 matches B1.
- To conduct a case-sensitive comparison, integrate the EXACT function.
- Interested in highlighting differences across each row in two columns? Our guide on Row Differences offers tailored insights.