Try this..

=IF(B2=MAX(IF($A$2:$A$22=A2,$B$2:$B$22)),B2,"")

Confirm with Ctrl+Shift +Enter