I have the following table
And I would like a formula that would produce the following result
I would like to iterate through the table going from left to right 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?