A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
As the column for lookup is determined by the (x,1) and (x,y) is looked up in that columns, I think that bringing OFFSET() into the mix might be the best method. If I'm interpreting your description correctly, this is a simplistic representation of your data matrix (B2:F6) and known values (B9 & C9).
The formula in D9 that returns Y is,
=INDEX($B$3:$B$6,MATCH(C9,OFFSET($B$2,1,MATCH(B9,$C$2:$F$2,0),4,1),0))
| INDEX function |
|---|
| MATCH function |
| OFFSET function |
Edit: typed "The formula in B9 that returns Y is" insteaf of "The formula in D9 that returns Y is". Corrected description. Formula did not need modification.