Search code examples
arraysgoogle-sheetsgoogle-sheets-formulagoogle-query-language

Google Sheets - repeat TRANSPOSE WITH QUERY


as the graph I hope I could get the result like red line, just use formula in one row I try everything I could think of, but it all doesn't work

https://i.sstatic.net/r7M2S.jpg


Solution

  • use:

    =ARRAYFORMULA(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(
     UNIQUE({A2:B, B2:B}), 
     "select Col1,max(Col2) 
      where Col1 is not null 
      group by Col1 
      pivot Col3"), 
     "offset 1", 0)),,9^9)), " "))
    

    enter image description here