Sorting Cells Into Groups Based On Content

I have been using LibreOffice Calc for quite some time and I have learned a lot about it. One thing that I am working on now is making data sort into groups. For example, I am making a inventory-like list of coats we have. I want every coat that is listed as style “A” to be put at the top, below a header that says “A”. All coats that are listed as style “B” to be listed below a header “B”, which is below the last coat listed in “A”. So on, and so on. Any ideas?

The easiest way is use the “Subtotals” functionality from Menu “Data”.

  • Starting with this table:

  • You can transform the table using the “Subtotals” dialogue with the following settings:

  • leading to this result:

Now, you can modify the result table to insert headers for the different groups.

I would love to share the answer if I had it, but the images have been removed from the answer given by tohuwawohu, so I don’t have it! …or any good idea whether tohuwawohu’s even works for that matter.