Stacking multiple columns on to one?

后端 未结 8 1084
遥遥无期
遥遥无期 2020-12-01 02:13

I am using Google SpreadSheet, and I\'m trying to have multiple sheets containg a list of words. On the final sheet, I would like to create a summative list, which is a comb

相关标签:
8条回答
  • Try using your CONCATENATE argument with

    =ArrayFormula(EXPAND(...))
    
    0 讨论(0)
  • 2020-12-01 02:26

    Much more simple:

    ={sheetone!A2:A;sheettwo!A2:A}
    
    0 讨论(0)
  • 2020-12-01 02:27

    =TRANSPOSE(SPLIT(TEXTJOIN("@",TRUE,TRANSPOSE(A:C),TRANSPOSE(D1:D5)),"@",FALSE,FALSE))

    • use a preferred delimiter absent in the data (instead of @) if needed
    • the first 1 (TRUE) parameter means IGNORE EMPTY, which is very important in this case..
    • the A:C and D1:D5 are the ranges to combine
    • all values remain there - not using UNIQUE
    0 讨论(0)
  • 2020-12-01 02:34

    The unique() function gets rid of blank spaces, but wasn't helpful for me because some of my rows repeat. Instead I first filter the columns by len() to remove blank cells. Then I combine the columns together in the same way.

    ={filter(A:A, len(A:A)); filter(B:B, len(B:B))}

    0 讨论(0)
  • 2020-12-01 02:34

    There is an undocumented function called flatten

    flatten(A1:B2)

    If the 2d range is not in one piece, one can be created first with the ampersand or similar techniques. Afterwards flatten can be called on the resulting 2d range. The below example is a bit overkill but it is nice when working with dynamic 2d ranges, where the basic solution can't be easily used.

    flatten(ARRAYFORMULA(SPLIT(ARRAYFORMULA(A1:A2&";"&C3:C4), ";")))
    

    The article shows also how to easily unflatten a range using the, as well undocumented, skipping clause in a query.

    0 讨论(0)
  • 2020-12-01 02:38

    The basic way, is just to do it as arrays like so

    ={A1:A10;B1:B10...etc}
    

    The problem with this method, as I found out is that its very time consuming if you have lots of columns. I've done some searching around and have come across this article:

    Joining Multiple Columns Into One Sorted Column in Google Spreadsheets

    The core formula is

    =transpose(split(arrayformula(concatenate(if(len(A:Z)>0,A:Z&";",""))),";"))
    

    Obviously you'd replace the A:Z to whatever range you want to use. And if you want to do some sorting or removing duplicates, you'd simply wrap the the above formula in a SORT() and/or UNIQUE() method, like so..

    =sort(unique(transpose(split(arrayformula(concatenate(if(len(A:Z)>0,A:Z&";",""))),";"))))
    

    Hope this helps. Happy coding everyone :)

    0 讨论(0)
提交回复
热议问题