Hi Andre,

This problem took no formulas but did take about 12 mouse clicks to do. I used Power Query to UnPivot your top table first. See the green table on the attached. Then I used the green table and Pivoted it to get the answer I think you want. If you don't have Power Query you can install it from Microsoft as an Add-In.
UnPivot and then Pivot in another way.xlsx