is there a way to use the char(10) function without separating every value?

Viewed 92

enter image description hereI am currently using char (10) to merge columns, from a separate tab called "scripts", into one cell based on a name. =IFERROR(TEXTJOIN(CHAR(10),1,QUERY(Scripts!$A$3:A,"select B, C, D, E where A ='"&A1&"'")))

my information shows up in a list. is there a way to combine columns B+C and then D+E.

row 1 is what my data looks like on "scripts" tab. row 7 is what the data looks like with the above equation. row 12 is what i would like the equation to do.

1 Answers

try:

=ARRAYFORMULA(IFNA(VLOOKUP(A1:A, QUERY(
 {Scripts!A:A, Scripts!B:B&" "&Scripts!C:C&CHAR(10)&Scripts!D:D&" "&Scripts!E:E}, 
 "where Col1 is not null"), 2, 0)))

enter image description here


update:

=ARRAYFORMULA(REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(QUERY(
 {Data!A2:A&"×", CHAR(10)&TEXT(Data!B2:B, "m/d/yy")&
 CHAR(10)&Data!C2:C&", "&Data!D2:D&", "&Data!E2:E, ROW(Data!A2:A)}, 
 "select max(Col2) where not Col1 starts with '×' group by Col3 pivot Col1")
 ,,9^9)), "×")), "^"&CHAR(10), ))

enter image description here

Related