Reputation: 81
I'm trying to perform a Textjoin()
when the cell is filled in a row to get the adjacent row header:
I have a formula that works without looking at the blanks.
The desired output would be:
I have a formula that works without looking at the blanks, what I need is when there is a blank cell the adjacent header is ignored.
Upvotes: 1
Views: 139
Reputation: 461
I know,I was too late, but I came here with another approach..
=TEXTJOIN(" ",,IF(ISBLANK(A2:C2),"",$A$1:$C$1&":"&A2:C2))
also
=TEXTJOIN(" ",,IF(A2:C2=0,"",$A$1:$C$1&":"&A2:C2))
Upvotes: 0
Reputation: 36880
Try the following formula-
=TEXTJOIN(" ",1,FILTER($A$1:$C$1,A2:C2<>"")&":"&FILTER(A2:C2,A2:C2<>""))
To make it dynamic (automatically spill result) try-
=BYROW(A2:C4,LAMBDA(x,TEXTJOIN(" ",1,FILTER(A1:C1,x<>"")&":"&FILTER(x,x<>""))))
Upvotes: 2