Need help with TEXTJOIN for Unique Values

skushner

New Member
Joined
Feb 15, 2019
Messages
3
Need some help changing the following formula to only grab unique values:

{=TEXTJOIN(",",TRUE,IF($A$2:$A$20000=A2,$C$2:$C$20000,""))}

Here's an example of the data (the last column is where this formula goes for each row:

Part NumberProjectProject ParentTEXTJOIN
961344W13-1 W13W13
1001156A36-1 A36A36,A36
1001156A36-2 A36A36,A36
1001521P21-1 P21P21,P21
1001521P21-2 P21P21,P21
1023070A32-3 A32A32,L11,L20,L8
1023070L11-1L11A32,L11,L20,L8
1023070L20-1L20A32,L11,L20,L8
1023070L8-1 L8A32,L11,L20,L8
1023435L17-1 L17L17,L17
1023435L17-2L17L17,L17

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>


I'm trying to get rid of the bolded instances where it shows the same project parent twice (like P21, P21) and only show it once so each value after the comma is unique.
I really don't want to use VBA for this because it will be an ongoing report so i'd rather use formulas that I can copy/paste if possible.

If someone could help me with this i'd really appreciate it!!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,212
Office Version
  1. 365
Platform
  1. Windows
Try...

Code:
D2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=TEXTJOIN(",",TRUE,IF(FREQUENCY(IF($A$2:$A$12=A2,MATCH(IF($A$2:$A$12=A2,$C$2:$C$12),IF($A$2:$A$12=A2,$C$2:$C$12),0)),ROW($A$2:$A$12)-ROW($A$2)+1)>0,$C$2:$C$12,""))

Hope this helps!
 
Last edited:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,699
Messages
5,833,195
Members
430,196
Latest member
rez5656

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
Top