You could use INDEX and MATCH:
For Row 2: =MATCH(B2,$C$1:$F$1)
would lookup the index of the column your value is in. The $ around the range value in C1:F1 will ensure the column headers are static even if you copy the formula down.
Then combine with index: =INDEX(C2:F2,1,MATCH(B2,$c$1:$F$1))
which retrieves the data from that index.
A nice extra is you could wrap that in =IFNA(formula' "") which will prevent it showing #N/A if you haven't entered a value into a cell in column B.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…