Calc: Transform some rows into columns

Hi,
I need change some rows of the table to columns.
This is original table:

And this is how it should look like. The names of headers “X” and “Y” are unknown.

Transpose Tables in Calc

Welcome to the community!
You should surely read this pinned post. and other pinned posts about generally needed information.

As things are, I can’t know (e.g.) if you are using a LibO version 24.8.0 or higher. This is very relevant specially in this case, becaus only the fresh versions have implemented the FILTER() function.

ask113855.ods (22.9 KB)
I added some column labels in row 1, so the actual data start in row 2.
First, extract the unique headers:

  1. Select column A
  2. Call Data>Filter>More Filters>Standard Filter and fill out like this:
    Bildschirmfoto von 2024-11-14 13-23-53
    in order to extract a list of unique names from the attributes column to cell M1.
  3. Cut this list without the column header (“Attributes” in my sample) and paste-special with option “Transpose” in order to convert the vertical list into a horizontal one.
  4. The formula in column C matches the value in A with the new list of unique.
  5. The formula in column D counts one up (next row) when there is an error in column C.
  6. The formula in G3 matches the row position.s in column D where new rows start. Fill down until you get an error. G2 is just the start value 1
  7. The formula in H2 looks up the column header H1 in a cell range shifted by the offset value in G2 and returns the corresponding value from column B. Copy down and to the right.
  8. Finally, copy the whole list, paste-special values to some other place (without transposing).

See this attachment (25.3 KB).