Forum Discussion
anbarnes3
Apr 08, 2024Copper Contributor
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 ...
- Apr 08, 2024
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.
Patrick2788
Silver Contributor
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.
anbarnes3
Apr 08, 2024Copper Contributor
Patrick2788 thank you so much! I appreciate it.
- Patrick2788Apr 08, 2024Silver ContributorGlad to help. You're welcome!