Search code examples
arraysgoogle-sheetstransposearray-formulasgoogle-sheets-query

Converting two columns table into one column table in Google Sheets


In column A there is a list of tasks.

In column B each task has an associated group.

How to, using built-in formulas, generate sequence like in column D?

Here is a screenshot :

enter image description here


Solution

  • try:

    =ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(QUERY(IF(A2:B="",,A2:B&"♦"), 
     "select max(Col1) where Col1 is not null group by Col1 pivot Col2", 0)
     ,,999^99)),,999^99), "♦"))))
    

    0