Food & Drink1 min ago
Excel - 2 lists - want to find duplicates!
6 Answers
I have 2 lists of numbers in Excel (6 digits each number).
Some of these numbers appear in both lists.
Some numbers only appear in one list.
I would like to cross-reference these lists and create another list of the singular, unique records.
I have done this before but cannot remember how I did it!
Some of these numbers appear in both lists.
Some numbers only appear in one list.
I would like to cross-reference these lists and create another list of the singular, unique records.
I have done this before but cannot remember how I did it!
Answers
Best Answer
No best answer has yet been selected by funkylad20. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.Copy and Paste both of your lists (one under the other) into column A of a new worksheet.
I will assume that you now have 5000 rows in column A
In cell B1 enter the formula :
=COUNTIF($A$1:$A$5000,A1)
Now fill the formula all the way down column B to cell B5000.
If you now Autofilter on column B, the entries that return a 1 in the filter will be the unique entries.
Just copy and paste these to another sheet.
That should give you what you want.
Cheers,
BW
I will assume that you now have 5000 rows in column A
In cell B1 enter the formula :
=COUNTIF($A$1:$A$5000,A1)
Now fill the formula all the way down column B to cell B5000.
If you now Autofilter on column B, the entries that return a 1 in the filter will be the unique entries.
Just copy and paste these to another sheet.
That should give you what you want.
Cheers,
BW
It's a while since I did this sort of thing (meaning you may need to tinker with the formula a bit), but here goes anyway.
Copy and paste both lists into the same worksheet, putting them all in column A,. Sort in ascending order. In column B, row 2 enter the formula =IF(A2=A1,"DUPLICATE","") and fill down to the end of the list. Filter on column B, selecting those entries which don't have the word DUPLICATE, then copy and paste into a new sheet.
You could also use VLOOKUP, but I'm not going to go there !
Copy and paste both lists into the same worksheet, putting them all in column A,. Sort in ascending order. In column B, row 2 enter the formula =IF(A2=A1,"DUPLICATE","") and fill down to the end of the list. Filter on column B, selecting those entries which don't have the word DUPLICATE, then copy and paste into a new sheet.
You could also use VLOOKUP, but I'm not going to go there !
The two methods above from Bushwhacker and Huderon solve slightly different problems.
Once you have created one long list from the two lists, if there are duplicates in this long list, do you want to keep one of the duplicates, or remove all instances of the number?
If you want to keep one of each number, Huderon's method works, if you only want to keep numbers that weren't duplicated (i.e. if there's two 301905s you get rid of both of them) then Bushwhacker's method works.
Hope that helps.
Once you have created one long list from the two lists, if there are duplicates in this long list, do you want to keep one of the duplicates, or remove all instances of the number?
If you want to keep one of each number, Huderon's method works, if you only want to keep numbers that weren't duplicated (i.e. if there's two 301905s you get rid of both of them) then Bushwhacker's method works.
Hope that helps.
Related Questions
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.