ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Compare two columns (https://www.excelbanter.com/excel-discussion-misc-queries/20453-compare-two-columns.html)

Chewy

Compare two columns
 
Hello,

I have two columns in the same sheet which contain cells with identical
results. I want to delete any result that is the same in both columns. Any
suggestions?

Column A Column B
abc jkl
def abc
ghi mno

Want to write a function to delete abc

Thanks.

Art

This might not be what you're looking for, but:

You can put a "conditional format" in each column, that would check for the
presence of an item in the other column. This would then change the
highlighting or color, thus allowing you to see the duplicated items.

So, working in columns column A and B as in your example. Highlight column
A. Select Format, Conditional Formatting. Change Condition1 from "Cell
Value Is" to "Formula Is".

In the formula box, type: =COUNTIF($A:$A,B1)0. Then pick a format you'd
like to use for this.

Now, if you want to delete items from both columns, be careful. As soon as
you delete the item from one column, the formatting in the other column will
go back to normal. One way to deal with this would be to turn off automatic
calculations.

Art




All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com