Forum Discussion

terryrossahern1's avatar
terryrossahern1
Copper Contributor
Apr 02, 2025
Solved

Unique(RANDBETWEEN) errors

I am trying to create a Random List between 1 and 21 in Excel

I am in Spain, so it seems I have to change the Comma for a semi-colon.

This is my formula, 1st entered into Cell C2 and then dragged down to include all cells from C2 to C22

=UNIQUE(RANDBETWEEN(1;21))

Even though I have used the UNIQUE code, I am still getting repeats.

Attached is a screenshot and I am also attaching the File.

How do I prevent the repeats

 

  • The file cannot be access without a login!

    RANDBETWEEN generates a single number, so UNIQUE serves no purpose here. The numbers in the red outlined area are not connected in any way. The are just 21 unrelated random numbers between 1 and 21.

    Use RANDARRAY to generate 21 random numbers. Don't use integers!! Then use SORTBY to generate a random list of Horse Names.

     

     

     

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    The file cannot be access without a login!

    RANDBETWEEN generates a single number, so UNIQUE serves no purpose here. The numbers in the red outlined area are not connected in any way. The are just 21 unrelated random numbers between 1 and 21.

    Use RANDARRAY to generate 21 random numbers. Don't use integers!! Then use SORTBY to generate a random list of Horse Names.

     

     

     

Resources