http://www.360doc.com/content/12/1021/15/7665211_242782107.shtml
=IFERROR(VLOOKUP(D2&ROW(A1),IF({1,0},$A$2:$A$8&COUNTIF(INDIRECT("$A$2:$A"&ROW($2:8)),D2),$B$2:$B$8),2,),"")
http://www.360doc.com/content/12/1021/15/7665211_242782107.shtml
=IFERROR(VLOOKUP(D2&ROW(A1),IF({1,0},$A$2:$A$8&COUNTIF(INDIRECT("$A$2:$A"&ROW($2:8)),D2),$B$2:$B$8),2,),"")