Home > Blockchain >  Horizontally Concatenate Array of Columns with delimiter and ignore blank columns in google sheets
Horizontally Concatenate Array of Columns with delimiter and ignore blank columns in google sheets

Time:08-16

The shared enter image description here

I want to be able to use this as an independent formula string that might be added to other strings of information. For example, "Favorite colors: "& textjoin(", ",1,A2:D2)&"Favorite foods:"&textjoin(", ",1,E2:G2)&"...

Possible solutions

May be a variant of one of the following:

  1. Modifying this so it could be used w/ an array formula JOIN("~", SPLIT(JOIN(CHAR(60000), B3:E3), CHAR(60000)))
  2. Modifying this formula works with join also JOIN(", ",FILTER(H2:H,H2:H<>""))
  3. Using a combination of IF(a2:A<>"" along with a regex replacement at the end (see my answer below) but this could be very long formula compared to textjoin if there are many columns)

An ideal solution would be concise and look closest to something this:

arrayformula(TEXTJOIN(", ", TRUE, A2:A,B2:B,C2:C)

Shared sheet is enter image description here

  • Related