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

Is there a way in Google Sheets to order cells in a range in the way depicted in the attached file and with one single formula?

In Google Sheets I have a situacion like this:
[![Cell reorder][1]][1]
https://i.stack.imgur.com/P2GZI.png

In column A:A I have some keys list, with an associated order (column B:B). Then I have some values in column E:E associated with the previous keys spread in column D:D and with a suborder (column F:F).

In column H:H I have the desired results; all the values listed, following their suborder, and grouped under the associated key, and everything ordered by the keys order takeb from column B:B. Besides that, the keys are prefixed and suffixed with several hypens.
I would like to achieve these results with one single formula located in cell H2, or cell H1 including the header (in the example I am using several sort & filter formulas).
Down below is the link to the spreadsheet in case you need it.
The formula should be able to accept as many keys, orders, values and suborders needed.

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

https://docs.google.com/spreadsheets/d/1XDaJFE_BYJpkhdq32iPHzucjf78mP2WCrDN76U5KwZM/edit?usp=sharing

Thank you.

>Solution :

You may try:

=reduce("Header",tocol(sort(A2:A,B2:B,1),1),lambda(a,c,{a;"--- "&c&" ---";choosecols(sort(filter(E:F,D:D=c),2,1),1);if(,,)}))

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