0

I'm having trouble getting this to work. Basically, I have the following set of data:

enter image description here

In the TextJoin Formula column, I want it to do a look up against the adjacent ID, scan the income code column and concat the income codes pertaining to that unique ID, separated by a ','.

enter image description here

Many thanks

Jason
  • 47
  • 1
  • 7

1 Answers1

0

use:

=TEXTJOIN(",",TRUE,IF($A$2:$A$6=$A2,$B$2:$B$6,""))

Depending on one's version this may require Ctrl-Shift-Enter instead of Enter when exiting edit mode.


If one has the Dynamic Array Formula FILTER:

=TEXTJOIN(",",,FILTER(B:B,A:A=A2))
Scott Craner
  • 148,073
  • 10
  • 49
  • 81
  • I can confirm the first formula worked after doing Ctrl-Shift-Enter! Thanks so much Scott. – Jason Feb 19 '20 at 09:17
  • If the income code repeats against the unique ID, is there a way to limit the value to populating just once? E.g. if ABCD has Income code 5 appearing in two different rows, instead of it showing as 5,5 (how it populates currently) it just reflects as 5. – Jason Feb 19 '20 at 09:49
  • That is a different question. And it has been asked and answered before do a quick search of stack overflow. – Scott Craner Feb 19 '20 at 13:53