Find differences between two columns of data

S

shawn dorsey

All,
I have a worksheet with two columns of data. The
first column is more than 220 entires the second column is
more than 400 entires, so I don't want to do this by
hand. The first column has the correct entires, the
second column has some matching the first and a bunch that
are extra.
I would like to find the differences between the two
columns and output to a third column. We are using Office
XP (2002)...all help is appreciated!
 
D

Dave R.

Shawn, I think a simple IF/COUNTIF formula would work. But to be best, you
would want to specifically know what you want in the 3rd column.

I would reccomend going here, looking at how to find duplicate numbers in
lists:

http://www.cpearson.com/excel/duplicat.htm

I don't know what you mean when you say the difference between the lists. Do
you want to pull the unique ones from column with 400 entries (and assume
the other 220 match the column with 220 entries?).
 
C

Chris Leonard

All,
I have a worksheet with two columns of data. The
first column is more than 220 entires the second column is
more than 400 entires, so I don't want to do this by
hand. The first column has the correct entires, the
second column has some matching the first and a bunch that
are extra.
I would like to find the differences between the two
columns and output to a third column. We are using Office
XP (2002)...all help is appreciated!

Here's a starter for 10. I'm not sure if you want to list each entry or not,
afraid your requirement is not very clear but hopefully this little snippet
of code will help.

Function diff()

Set myRange1 = Range("A1:A20")
Set myRange2 = Range("B1:B20")

Count = 1

For Each c In myRange1
For Each x In myRange2
If c.Value = x.Value Then
Cells(Count, 3) = x.Value
Count = Count + 1
Exit For
End If
Next
Next

End Function


Chris
 

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

Top