Function in Excel

  • Thread starter Thread starter Vincent Martel
  • Start date Start date
V

Vincent Martel

I have a two column sheet which include two lists of name. I want to compare
these list and get the names who are not listed in the both lists to another
column. It's very important to find only the names which are not listed in
both columns.

Ex:
A B C
1 Dave Dave Julie
2 Mike Mike Frank
3 Julie Steven
4 Steven Kevin
5 Frank Frank


Julie and Frank are the result of the Function.

Thanks.

Vincent
 
Sorry my ex. had an error. Here what the result is supposed to look like. C3
C4 and C5 must be empty.

A B C
1 Dave Dave Julie
2 Mike Mike Kevin
3 Julie Steven
4 Steven Kevin
5 Frank Frank
 
Oh you mean that the order is not important. Just that the listing in C
is the people who are only listed once between the two lists of A and B?
can it be there are multiple entries for one person on one of the lists?
 
try
Sub compare()
i = 2
On Error Resume Next
For Each c In Range("a2:a6")
If Range("b2:b6").Find(c) = "" Then
Cells(i, "c") = c
i = i + 1
End If
Next c

For Each cc In Range("b2:b6")
If Range("a2:a6").Find(cc) = "" Then
Cells(i, "c") = cc
i = i + 1
End If
Next cc


End Sub
 
Back
Top