Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Excel - compare columns

Posted on 2013-01-17
Medium Priority
341 Views
In Excel, is there a way to compare column A and B and highlight if the different?

sample

accountnumber_A      accountnumber_B

12345                         11111
7890                           22222
2222                           12345
etc
0
Question by:VBdotnet2005

LVL 24

Accepted Solution

Steve earned 2000 total points
ID: 38789786
you can use COUNTIF to determine if a value appears in one column of data from the other...

So to see if the value in A1 is in column B you can use:

=CountIF(B:B,A1)

Or you can use MATCH which will return the row number for the first matching data:

=MATCH(A1,B:B,0)
0

LVL 50

Expert Comment

ID: 38789790
Do you want to compare row by row or compare a value in one column against any value in the other?

If it's the former you can just use

=A2=B2

or to compare A2 against any value in column B

=COUNTIF(B:B,A2)>0

You can use either formula on the worksheet and copy down the columns......or use within conditional formatting to format the relevant cells as required

regards, barry
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
###### Suggested Courses
Course of the Month15 days, 21 hours left to enroll