New iteration question

I have the following table

enter the description of the image here

And I would like a formula that would produce the following result.

enter the description of the image here

I would like to traverse the table from left to right from top to bottom and if there is a value in a cell, I would like to return with the matching top row criteria. How would I do this?