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!!
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,294
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:

Watch MrExcel Video

Forum statistics

Threads
1,108,490
Messages
5,523,249
Members
409,506
Latest member
reneekeane

This Week's Hot Topics

Top