Reputation: 47
I have the following table of data:
In C2, I then input the following formula =TEXTJOIN(", ",TRUE,IF($B$2:$B$7=$B2,$A$2:$A$7,""))
which returns the following:
However, I want the formula to ignore any duplicates and just return 1, 30
I've had a peruse, and looked a similarly asked questions on here, but i am unable to get anything to work
I have partially resolved this with the following code:
=TEXTJOIN(", ",TRUE,IF($B$2:$B$13=$B2,IF(MATCH($A$2:$A$13,$A$2:$A$13,0)=ROW($A$2:$A$13)-ROW($A$2)+1,$A$2:$A$13,""),""))
However, if the ID code changes and an income code, previously populated under a different ID, appears it will just return blank:
Many thanks
Upvotes: 0
Views: 1854
Reputation: 3802
Or, try this array formula (Ctrl+Shift+Enter) instead :
=TEXTJOIN(", ",TRUE,IF($B$2:$B$13=$B2,IF(MATCH($A$2:$A$13&$B$2:$B$13,$A$2:$A$13&$B$2:$B$13,0)=ROW($A$2:$A$13)-ROW($A$2)+1,$A$2:$A$13,""),""))
Upvotes: 1
Reputation: 60224
Applies to O365 with the UNIQUE
function
try:
=TEXTJOIN(",",TRUE,UNIQUE(IF($B$2:$B$7=$B2,IF($A$2:$A$7="","",$A$2:$A$7),"")))
Upvotes: 1