尝试:
=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)), " ")), "♥", " "))