This should solve your problem:

Formula: copy to clipboard
=IF(AND(B20<>"",$F$9="R"),VLOOKUP(B20,'Price list'!$B$5:$F$52,3,0),IF(AND(B20<>"",$F$9="W"),VLOOKUP(B20,'Price list'!$B$5:$F$52,5,0),""))