Zend certified PHP/Magento developer

Transform cross-reference table into combination of rows and columns with their respective values

I have a cross-reference table similar to this:

Cross-reference table and expected result

How do I combine both rows and columns to arrange them in 3 columns where their values are in the last column?

Is there any special Excel tool/function to achieve it?