将多行转置为 Google sheet 中的列

Transpose multiple rows into column in Google sheet

我想在此数据中使用转置公式

我希望输出看起来像这样

尝试:

=QUERY(A2:B, "select max(B) where A is not null group by B pivot A")


或:

=ARRAYFORMULA(SUBSTITUTE(TRANSPOSE(SPLIT(TRANSPOSE(QUERY(QUERY(
 {SUBSTITUTE(A2:A, " ", "♥"), B2:B}, 
 "select max(Col2)
  where Col1 is not null
  group by Col2
  pivot Col1"),,999^99)), " ")), "♥", " "))