Remove duplicates & create list

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
I have a long list with codes in sheet 1 of my data starting at A2 (the list is very long 4500 rows):

C56
A125
R89
C56
B125
B125
A125
R89
D512
S226
D512
R89

<tbody>
</tbody>

In sheet 2 I need to create a list of all the codes and remove the duplicates. I'm using the following array formula to try and do it:

{=INDEX('Sheet 1'!$A$2:$A$4568,MATCH(0,COUNTIF('Sheet 1'!$A$1:A1,'Sheet 1'!$A$2:$A$4568),0))}

The formula results in the 1st and 2nd unique codes to be returned correctly but the 3rd unique code is duplicated for the rest of the lines:

Code
C56
A125
R89
R89
R89

<tbody>
</tbody>

I cannot work out what is wrong with the formula?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Maybe,

In "Sheet 2" A2, non-CSE formula copied down :

=IFERROR(INDEX('Sheet 1'!$A$2:$A$4568,MATCH(0,INDEX(COUNTIF('Sheet 2'!$A$1:A1,'Sheet 1'!$A$2:$A$4568&""),0),0))&"","")

Regards
Bosco
 
Upvote 0
Thank you for this. I get the same result as before using this formula.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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