Search code examples
google-sheetspivotgoogle-sheets-formulaarray-formulasgoogle-sheets-query

How to convert every 50 rows to columns in Google Sheets


I have a csv file as follows:

LINK   | NAME
A0     | B
A1     | B
A2     | B
A3     | B
A4     | B
A5     | B
...
A51    | C
A52    | C
A53    | C
...

I'm looking for a method to convert each 50 rows into columns in the following form:

NAME | Link 1 |  Link 2 |  Link 3 | etc
B    | A0     |  A1     |  A2     | etc
C    | A51    |  A52    |  A53    | etc

Anyone has a practical solution to offer using Excel, google Sheets or other software? thank you


Solution

  • you can try this:

    =ARRAYFORMULA(SPLIT(TRIM(TRANSPOSE(QUERY(QUERY(A2:B; 
     "select max(A) where A is not null group by A pivot B");;999^99))); " "))
    

    0