Converting two columns table into one column table in Google Sheets

Viewed 102

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

2 Answers

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

This should work as well as player0s. I keep trying to get him to use FLATTEN() :)

=QUERY(FLATTEN(TRANSPOSE(QUERY(A2:B,"select Max(A) group by A pivot B"))),"where Col1<>''")
Related