Enter the formula in B2 (note that it is B2, not B 1):
= SMALL(SMALL(IF(COUNTIF(B $ 1:B 1,$ A $ 2:A $ 20 1),FALSE,$ A $ 2:A $ 20 1),ROW(INDIRECT(" 1:" & amp; 200-sum product(COUNTIF(B $ 1:B 1,$ A $ 2:A $ 20 1)))),round up(RAND()*(200-sum product(COUNTIF(B $ 1:B 1,$ A $ 2:A $ 20 1))),0))
CTRL+SHIT+ENTER ends.
Pull-down filling