Comparing columns of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to compare two columns of data in Excel. For example if I
have two columns of names A & B, with column A containing 5,000 names and
column B containing 1,000 names, how would I compare B to A. Additionally,
would it be possible to then conditionally format the duplicated item in
Column B, maybe make it bold or red?

Thanks

Howard
 
Select column A, Format, Conditional format, Formula is,
=countif(B:B,A1)
then select your cell colour

Select column B, Format, Conditional format, Formula is,
=countif(A:A,B1)
then select your cell colour

--
 
Thanks, to both Bryan and James, this is very helpful. One additional
question -

Is it possible to have the COUNTIF function return 1, instead of a 0, to
indicate that the value in the Newlist already exists in the old list. Then,
instead of changing the formatting have the value which already exists in the
Oldlist deleted from the Newlist?

For example:

Oldlist Newlist
1 3
2 4
3 6
4 1

Ideally, after running COUNTIF()

Oldlist Newlist
1
2
3 6
4


I hope that makes sense and thanks for any ideas or help.

Howard
 
Hi chief775,
I'm bemused how this question relates to the first or what you're
trying to do. Perhaps a new thread with more details so you get a wide
audience?

But I can give an answer to your first question
Is it possible to have the COUNTIF function return 1, instead of a 0
....?
Yes:
--Not()
This formulas surrounding countif (or referenced to a cell containing
the countif formula) will convert false values to true (i.e. 0 or false
to 1) and true values to false (i.e. True or 1 or any non-zero number to
0). The double negative at the start converts the boolean (true/false)
to the number (1/0).
 
OK, Think I now understand what you're after

Here's one way:
Assumed your table is in A1 to B5
In C1, enter a heading for your check
In C2 enter
=--NOT(COUNTIF($A$2:$A$5,B2))
Copy down
Whilst in the table select Data-Filter-Autofilter
In the dropdown box in C1 select 0
This highlights all entries in column B to be deleted
Delete these entries in column 2
Dump the filter and column C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Comparing two columns 1
comparing 2 columns 6
Comparing Data 1
List Comparison 3
Comparing two Excel sheets 3
VBA Excel partial cell compare to another cell 0
Compare the data in 2 columns 1
Excel 2007 comparing dates 5

Back
Top