2

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

player0
  • 124,011
  • 12
  • 67
  • 124

2 Answers2

3

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

player0
  • 124,011
  • 12
  • 67
  • 124
1

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<>''")
MattKing
  • 7,373
  • 8
  • 13