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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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:
Upvote 0

Forum statistics

Threads
1,214,659
Messages
6,120,786
Members
448,993
Latest member
Seri

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