google spreadsheet: join arrays using function NOT CODE

后端 未结 7 1336
我寻月下人不归
我寻月下人不归 2021-02-05 03:52

I have one array

1 
2
3

another array

4
5
6

How do I use one function to join the 2 arrays?

         


        
7条回答
  •  被撕碎了的回忆
    2021-02-05 04:14

    Given the information provided by Mr.Monshaw, I figured this out for you.

    Given values "1,2,3" are in cells A1:A3 of a spreadsheet, and values "4,5,6,7" are in cells B1:B4. Here is the formula to use:

    =TRANSPOSE(SPLIT(ARRAYFORMULA(CONCATENATE(concat(A1:A3,",");concat(B1:B4,","))),","))

    Explanation. The concat formula creates a string of the values with the indicated separator, ",". So concat(A1:A3,",") results in "1,2,3".

    The Concatenate combines the values of the specified array as one string. So CONCATENATE(concat(A1:A3,",");concat(B1:B4,",")) results in "1,2,3,4,5,6,7"

    The Split function here is used to identify the "," as a deliminator and not a value in the array. The Transpose will cause the results to display in a column instead of in a row.

提交回复
热议问题