Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Split the rows and orgzinze as multi columed row using Google Sheets formula

I have a table with n rows with data, the rows are required to be placed to the right.
Which is the chunk size, as shown

Make a copy of sheet here: https://docs.google.com/spreadsheets/d/1aitrEnBpL7VV_qiylF4d00tLcKq9efU99hdO-5fa1RM/copy

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The chink size is a variable and when chunk is changed the formula needs to auto adjust the result.

I have tried with

=transpose(flatten(query(ARRAYFORMULA(A2:F8),"select * limit 4 offset 0")))

but my formula needs manual reasoning and update of the formula when the table changes which is not feasible. A single formula that does the job accepting chunk size is greatly appreciated.

>Solution :

You may try:

=let(a,B11*columns(A$2:F$8),b,roundup((rows(A2:F8)*columns(A2:F8))/a),makearray(b,a,lambda(r,c,iferror(index(flatten(A$2:F$8),(r-1)*a+c)))))
  • for the reference I had the chunk number entered in the cells B11 and B17

enter image description here


If and when the new functions are active & operational fo ya; you can also use this simple one:

=wraprows(tocol(A2:F8),B11*columns(A2:F8),)

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading