Home > database >  Google Sheets IF (in multiple cells) text contains, then return the text
Google Sheets IF (in multiple cells) text contains, then return the text

Time:01-27

Please help!

If A2, B2, or C2 contains text (ANY TEXT... nothing specific), then return the text of that cell in D2.

I've tried several things, but I cannot get it to work.

CodePudding user response:

If more than one contains text what should happen??

With =IFNA(FILTER(A2:C2,ISTEXT(A2:C2))) you can search through them and then join them with =TEXTJOIN(", ",1,IFNA(FILTER(A2:C2,ISTEXT(A2:C2))))

If you need it as an array, you can do:

=BYROW(A2:C,LAMBDA(each,TEXTJOIN(", ",1,IFNA(FILTER(each,ISTEXT(each))))))

CodePudding user response:

use in cell D2:

=A2&B2&C2

you can add spaces if you need:

=TRIM(A2&" "&B2&" "&C2)
  • Related