China Naming Network - Company naming - How to make a lottery form quickly

How to make a lottery form quickly

As shown in the figure, C2 formula:

= LARGE(IF(COUNTIF(c $ 1:c 1,ROW($ 1:$30))=0,ROW($ 1:$30),RANDBETWEEN( 1,3 1-ROW(a 1)))

Array formula, CTRL+SHIFT+ Enter, drop down;