1

I want to join the text but the number of rows differ for each record. If I use the static range data is missing for few records, in below example 22Inch is missing,

enter image description here

Used the below formula. How to dynamically change the range.

=TEXTJOIN(",",TRUE,A3:A8,"")

player0
  • 124,011
  • 12
  • 67
  • 124

3 Answers3

3

Try this:

=TEXTJOIN(",", 1, A3:INDEX(A:A, MIN(IFERROR(1/(1/(ROW(A3:A)*(A3:A="")))))))

enter image description here

Sunderam Dubey
  • 1
  • 11
  • 20
  • 40
player0
  • 124,011
  • 12
  • 67
  • 124
1

Can you test this one out:

=LAMBDA(z,BYROW(z,LAMBDA(a,REGEXREPLACE(TEXTJOIN(",",1,IFNA(FILTER(A2:A,XLOOKUP(ROW(B2:B),z,z,,-1)=a))),"^(.*?)\,",""))))({ROW();BYROW(A3:A,LAMBDA(z,IF((z<>"")*(OFFSET(z,-1,0)=""),ROW(z),)))})

enter image description here

rockinfreakshow
  • 15,077
  • 3
  • 12
  • 19
1

Here's another formula you can try:

=QUERY(INDEX(LAMBDA(ζ,SORT(REGEXREPLACE(ζ,"^,",),COUNTIFS(A1:A,"",ROW(A1:A),"<="&ROW(A1:A)),1,LEN(ζ),))({"";IF({A3:A;""}<>"",,SCAN(,A2:A,LAMBDA(a,c,IF(c="",,a&","&c))))})),"limit "&ROWS(A2:A))

enter image description here

z''
  • 4,527
  • 2
  • 3
  • 12