=INDEX(IF(ROW(A1)>SUM(IF($B$2:$B$30>"",1/COUNTIF($B$2:$B$30,$B$2:$B$30))),$D$2:$D$30,$B$2:$B$30),MATCH(,COUNTIF($F$1:$F1,IF(ROW(A1)>SUM(IF($B$2:$B$30>"",1/COUNTIF($B$2:$B$30,$B$2:$B$30))),$D$2:$D$30,$B$2:$B$30)),))&""数组公式,按三键完成公式,下拉。