Forum Discussion

anbarnes3's avatar
anbarnes3
Copper Contributor
Apr 08, 2024

No duplicate cells.

Let's say I create a list of 1,000 people and use the function "randbetween" to assign each person their own special code. How can I also make sure, if I were to include new people on my list in the ...
  • Patrick2788's avatar
    Apr 08, 2024

    anbarnes3 

    One approach is to generate more numbers than needed, remove dupes, and take the first 1000.

     

     

    =LET(numbers, RANDARRAY(4000, , 1000, 9999, 1), TAKE(UNIQUE(numbers), 1000))

    Randarray generates 4,000 numbers betweeen 1000-9999. The 1 is to return whole numbers with no decimals.

     

Resources