Hi -
If i understood you correct...please use the below formula...it is to be array entered
INDEX($B$2:$B$19,MATCH(LARGE(IF($A$2:$A$19=$D2,ROW(INDIRECT("1:"&COUNTA($A$2:$A$19))),"x"),2),IF($A$2:$A$19=$D2,ROW(INDIRECT("1:"&COUNTA($A$2:$A$19))),"x"),0))
You may even download the attached