How to Extract a List of Duplicates From a Column

atb88

New Member
Joined
May 23, 2013
Messages
3
Hello!

So I've been having trouble with this - I have a column of user IDs, and I need to find which IDs appear more than once in the column, and extract those IDs to a new column. The scenario, if it helps, is that the user IDs represent purchases, and we want to reward customers who purchase more than once, so we need the list of IDs of customers who have purchased multiple times. I can't use a Pivot Table to count the number of times a value occur. Also, I have no idea what IDs are being put into the ID column, the order the IDs are in the ID column, or how many IDs there are in total.

If Column A is the provided data, and Column C is the extracted duplicates, it should look like:

ABC
1IDID's that occur more than once
2
100100
3200400
4300
5100
6400
7400

<tbody>
</tbody>


Thanks in advance! Let me know if you need more information.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello!

So I've been having trouble with this - I have a column of user IDs, and I need to find which IDs appear more than once in the column, and extract those IDs to a new column. The scenario, if it helps, is that the user IDs represent purchases, and we want to reward customers who purchase more than once, so we need the list of IDs of customers who have purchased multiple times. I can't use a Pivot Table to count the number of times a value occur. Also, I have no idea what IDs are being put into the ID column, the order the IDs are in the ID column, or how many IDs there are in total.

If Column A is the provided data, and Column C is the extracted duplicates, it should look like:

A
B
C
1
ID
ID's that occur more than once
2
100
100
3
200
400
4
300
5
100
6
400
7
400

<tbody>
</tbody>


Thanks in advance! Let me know if you need more information.

ID0 2
100 Returning ID
200 100
300 400
1001
400
4002

<colgroup><col style="width: 48pt;" span="3" width="64"> <col style="width: 118pt; mso-width-source: userset; mso-width-alt: 5603;" width="158"> <tbody>
</tbody>

B1 must house a 0.

B2, just enter and copy down:

=IF(ISNUMBER(MATCH(A2,$A$1:A1,0)),LOOKUP(9.99999999999999E+307,$B$1:B1)+1,"")

D1, just enter:

=LOOKUP(9.99999999999999E+307,B:B)

D3, just enter and copy down:

=IF(ROWS($D$3:D3)<=$D$1,LOOKUP(ROWS($D$3:D3),B:B,A:A),"")

If needed, you can also have...

E3, copied down:

=COUNTIF(A:A,$D3)
 
Upvote 0
When I do that and extend D3 down, multiple instances of the duplicated numbers are displayed, and I need it so only one instance of each number is displayed... how can I make it so only one instance of the duplicated values is displayed in the new column (regardless of how many instances there are of the value in the original column). Thanks!
 
Upvote 0
When I do that and extend D3 down, multiple instances of the duplicated numbers are displayed, and I need it so only one instance of each number is displayed... how can I make it so only one instance of the duplicated values is displayed in the new column (regardless of how many instances there are of the value in the original column). Thanks!

Change B2 to:

=IF(COUNTIF($A$2:A2,A2)=2,LOOKUP(9.99999999999999E+307,$B$1:B1)+1,"")
 
Upvote 0
It worked! YOU ROCK Aladin! Could you possibly explain a little bit to me of what you did there?

The formula in B2 effects a serialized count: 1, 2,3,... When the progressively determined occurrence count of an ID is 2 (meaning a duplicate), mark this item as Nth observation, where N is built up as Last count + 1. Last count is monitored by the LOOKUP expression that picks up the last numeric value in the range it looks at. At A5 we see CountIf yields a 2 for the ID in this cell(which is 100). LOOKUP then picks up the last value in B1:B5, which is 0, and augments this by 1. The set up continues to apply this logic for the whole reference. Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top