From Cell D37
I entered the formula:
=IF(OR(B37="",L36=""),"",IF(L36="SD",VLOOKUP(B37,H9:L33,4,0),IF(L36="MM",VLOOKUP(B37,H9:L33,5,0))))
The typed in value of D37 is 13.
H9:H33 have formulas that produce numeric values.
The formula-generated value in H15 is also 13.
This formula returns #N/A...