I have two columns in Excel that I want to compare and find the differences between them.
Suppose
Col A has 50 numbers i.e 0511234567 Col B has 100 numbers in the same format
I have two columns in Excel that I want to compare and find the differences between them. Suppose Col A has 50 numbers i.e 0511234567 Col B has 100 numbers in the same format 

migrated from stackoverflow.com May 27 '11 at 20:05This question came from our site for professional and enthusiast programmers. 


Using Conditional FormattingHighlight column A. Click Conditional Formatting > Create New Rule > Use this formula to determine which cells to format > Enter the ff. formula:
Click the Format button and change the Font color to something you like. Repeat the same for column B, except use this formula and try another font color.
Using a Separate ColumnIn column C, enter the ff. formula into the first cell and then copy it down.
In column D, enter the ff. formula into the first cell and then copy it down.
Both of these should help you visualize which items are missing from the other column. 


Microsoft has an article detailing how to find duplicates in two columns. It can be changed easily enough to find unique items in each column. For example if you want Col C to show entries unique to Col A, and Col D to show entries unique to Col B:



If I understand well your question :
Replace True/false directives by a function or by a string like "Equal" or "different" 


It depends on the format of your cells and your functional requirements. With a leading "0" they could be formatted as text. Then you could use IF function to compare cells in Excel:
Example:
If they are formatted as numbers, you could subtract the first column from the other in order to get the difference:



Say you want to find those in col. B with no match in col. A. Put in C2:
This will give you 1 (or more) if there's a match, 0 otherwise. You can also sort both columns individually, then select both, Goto Special, select Row Differences. But that will stop working after the first new item, and you will have to insert a cell then start again. 


This formula will directly compare two cells. If they are the same, it will print



I'm using excel 2010 and just highlight the two columns that have the two sets of values I'm comparing, and then click the Conditional formatting dropdown on the home page of excel, choose the Highlight Cells rules, and then differences. It then prompts to higlight either differences or similarities and asks what colour highlight you want to use... 


I know that this is an old thread but I don't think the previous posters really understood your question. Here's the formula that you are looking for:
http://randoltech.blogspot.com/2015/04/excelfinddifferencesbetweentwo.html 

