Reputation: 87
I have data with blank cells in between and I am looking for a way to squeeze them into one column.
Since the number of rows can change and the number of columns can change, too, I am looking for a dynamic way to this. I have already managed to do it in a non-dynamic way using the following formula but I am really interested in a dynamic way.
=IFS(COUNTA($B2:2)=1, TEXTJOIN("",true, $B2:2), COUNTA($B2:2)>1, "AMBIGUOUS")
Upvotes: 1
Views: 244
Reputation: 1
try:
=ARRAYFORMULA(IF(REGEXMATCH(TO_TEXT(TRIM(TRANSPOSE(QUERY(TRANSPOSE(SUBSTITUTE(
INDIRECT("B2:"&ROWS(B:B)), " ", "♦")),,999^99)))), " "), "ambiguous",
SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(SUBSTITUTE(
INDIRECT("B2:"&ROWS(B:B)), " ", "♦")),,999^99))), "♦", " ")))
Upvotes: 1