Robert Jan Ki
Robert Jan Ki

Reputation: 81

Textjoin with adjacent headers and rows with a twist

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:

example desired output:
enter image description here

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

Answers (2)

Manoj
Manoj

Reputation: 461

I know,I was too late, but I came here with another approach..

Result

=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

Harun24hr
Harun24hr

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

enter image description here

Upvotes: 2

Related Questions