another alternative:
Formula:
Sheet1!B2:
=IF($A2="","",SUMPRODUCT((Sheet2!$A$2:$A$100=$A2)/COUNTIFS(Sheet2!$A$2:$A$100,Sheet2!$A$2:$A$100&"",Sheet2!$B$2:$B$100,Sheet2!$B$2:$B$100&"")))
confirmed with enter, and copied down
modify ranges to suit but avoid entire column references (e.g. A:A) as this is not an efficient calculation.
Bookmarks