Use this formula...
=Max(if((a1:a100=a1),b1:b100,""))
And this is an array formula enter by ctrl+shift+enter
Saurabh