Search code examples
arrayscsvgoogle-sheetsgoogle-sheets-formulatextjoin

how to get x no. columns data from same row to single column with comma seperated


I want all data from column "A" to single-cell "d5" with comma-separated.

Example: I have the following data in a sheet.

A1=john
A2=berry
A3=spartan
A4=sparrow

result i need is "john,berry,spartan,sparrow" in cell "d5".

Also, it would be great if I can set the desired no of rows instead of all. like if required one than = "john" and if required three than = "john,berry,spartan"


Solution

  • try like this:

    =TEXTJOIN(","; 1; A:A)
    

    0


    for 3 use:

    =TEXTJOIN(","; 1; A1:A3)