Search code examples
google-sheetsgoogle-sheets-formulaarray-formulasgoogle-sheets-querytextjoin

Import data from one sheet to “only one cell” in another sheet


I have 3 columns with variable data below them. I need to import all 3 columns in this format "A <> B -- (C)" to one singular cell. I have not the slightest clue how to do this. I found a question that was similar to this but I can't make heads or tales of the formula.

=JOIN(CHAR(10),QUERY(TRANSPOSE(IMPORTRANGE("SpreadsheetID",A2:C100)),,2e6))

Solution

  • like this:

    =ARRAYFORMULA(TEXTJOIN(CHAR(10), 1, 
     TRANSPOSE(QUERY(TRANSPOSE(IF(A2:C<>"", A2:C, )),,999^99))))
    

    or this:

    =ARRAYFORMULA(TEXTJOIN(CHAR(10), 1, 
     TRANSPOSE(QUERY(TRANSPOSE(IF(A2:A<>"", A2:A&" <> "&B2:B&" -- ("&C2:C&")", )),,999^99))))
    

    0