Hi,

In your example, use this array formula (using CTRL, SHIFT and ENTER to confirm)

=MAX(IF($A$3:$A$6=F12,$B$3:$D$6,""))