Array containing duplicates

davidepstein22

New Member
Joined
Aug 27, 2012
Messages
27
Hi all,

I have an array function that returns text separated by commas (e.g. "Dave, Tom, Dave, Mike...") and it contains duplicates when there is more than 1 match (i.e. Dave). What functions should I wrap around the array to remove the duplicates?

Thank you!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi all,

I have an array function that returns text separated by commas (e.g. "Dave, Tom, Dave, Mike...") and it contains duplicates when there is more than 1 match (i.e. Dave). What functions should I wrap around the array to remove the duplicates?

Thank you!

[TABLE="class: grid, width: 192"]
<colgroup><col width="64" style="width:48pt" span="3"> </colgroup><tbody>[TR]
[TD="width: 64, bgcolor: transparent"] [/TD]
[TD="width: 64, bgcolor: transparent"] [/TD]
[TD="width: 64, bgcolor: transparent, align: right"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Dave[/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"]Dave[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Tom[/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"]Tom[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Dave[/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"]Mike[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Mike[/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
</tbody>[/TABLE]

In C1 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($A$2:$A$5=""),MATCH($A$2:$A$5,$A$2:$A$5,0)),ROW($A$2:$A$5)-ROW($A$2)+1),1))

In C2 control+shift+enter, not just enter, and copy down:

=IF(ROWS($C$2:C2)>$C$1,"",INDEX($A$2:$A$5,SMALL(IF(FREQUENCY(IF(1-($A$2:$A$5=""),MATCH($A$2:$A$5,$A$2:$A$5,0)),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($C$2:C2))))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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