Search code examples
google-sheetsfilterlambdaconcatenationtextjoin

How to change the TextJoin range in google sheet dynamically based on empty cell


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,"")


Solution

  • Try this:

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

    enter image description here