Jignesh Pandya
New Member
I need to draw a sample from population of random numbers. The numbers are in the range of say 10001 to 20000. But in that range also not all numbers are included - Thus, for example, the population range can be [10002, 10005, 10010, 10013, ....., 19993, 19996, 19999] with certain numbers skipped in the range. That population of numbers will be in the form of a csv file. Out of such a population range, I need to draw a sample of say 1000 random numbers (non repeating). Is there any formula in excel / power query or may be defined custom function in power query which can do that? I can easily use data science language like Python to achieve the result, but am curious about excel options. I tried to look through some functions like random(), randarray(), etc. but they give random numbers from anywhere - not within a particular range. Randbetween function does that but it requires complicated combination of other functions along with it to ensure that random numbers are not duplicated and also, randbetween() draws from a contiguous range not like the one I cited above.