I thought this was such an ingenious formula by a "Mark W" that I wanted to resurrect it. I found it on the purchased copy of Mr. Excel forum postings (KnowledgeBase vol1)
Scenario:
You have 2 lists of names, both of equal dimensions (though not necessary). Both lists have unique names not appearing in the other list and both lists have duplicated names, both within themselves and in the other. You want a count of unique names.
Setup:
A1:A10 contains the first list of names
B1:B10 contains the 2nd list of names
Solution
=COUNTA(A1:A10,B1:B10)-SUM((A1:A10=TRANSPOSE(B1:B10))+0)
Enter with Ctrl-Shift-Enter
The first part, counta(A1:A10,B1:B10) is simple, it counts 20 entries.
The next part is what is so facinating. Instead of creating a manually coded matrix of List1 running down a column and List2 running across a heading row, it sets this whole matrix up in memory and then performs the matches. In the sample data I had there were 5 such matches.
Finally the simple math is done: 20-5 = 15 unique entries.
Here is the original sample data:
Suppose A1:A10 contains {"Sally";"Mary";"Larry";"Jerry";"Linda";"Mike";"Jim";"Jake";"Moe";"John"}
B1:B10 contains {"Mark";"Sally";"Barry";"Larry";"Peter";"Tom";"Paul";"Mary";"Moe";"Jim"}
Scenario:
You have 2 lists of names, both of equal dimensions (though not necessary). Both lists have unique names not appearing in the other list and both lists have duplicated names, both within themselves and in the other. You want a count of unique names.
Setup:
A1:A10 contains the first list of names
B1:B10 contains the 2nd list of names
Solution
=COUNTA(A1:A10,B1:B10)-SUM((A1:A10=TRANSPOSE(B1:B10))+0)
Enter with Ctrl-Shift-Enter
The first part, counta(A1:A10,B1:B10) is simple, it counts 20 entries.
The next part is what is so facinating. Instead of creating a manually coded matrix of List1 running down a column and List2 running across a heading row, it sets this whole matrix up in memory and then performs the matches. In the sample data I had there were 5 such matches.
Finally the simple math is done: 20-5 = 15 unique entries.
Here is the original sample data:
Suppose A1:A10 contains {"Sally";"Mary";"Larry";"Jerry";"Linda";"Mike";"Jim";"Jake";"Moe";"John"}
B1:B10 contains {"Mark";"Sally";"Barry";"Larry";"Peter";"Tom";"Paul";"Mary";"Moe";"Jim"}