Assuming Tom read Hulub right I suggest to enter my
function UniqRandInt() from
http://www.sulprobil.com/html/random_numbers.html
(substitute RandInt by UniqRandInt in line 25, I have to
correct that next weekend) and enter into your spreadsheet:
Cell AG3: =COUNTIF($B$2:$AE$2,$A3)
Cells AH3 and AI3 together (as array formula, enter with
CTRL+SHIFT+ENTER): =uniqrandint(AG3)
Cell B3: =IF($A3=B$2,IF(ISERROR(MATCH(COUNTIF
($B$2:B$2,$A3),OFFSET($AH3,0,0,1,$AF3),FALSE)),0,1 ),0)
Then copy AG3:AI3 down to line 9 and B3 right to AE3 and
finally B3:AE3 down to line 9.
Regards,
sulprobil