So, I have a formula ( =INDEX(Sheet1.A1:F15,RANDBETWEEN(1,15),RANDBETWEEN(1,6)) ) that returns a random number in the sheet. But, how to run the formula until the returned number is less than or equal to 25 ?
I thought of using for..next.. but couldn't get it how to run ...
Welcome!
As @thebusybee pointed out in his comment, a macro for this task is much easier than using built-in functions. As rightly pointed out @tohuwawohu, pre-filtering the values makes things a lot easier. The macro code could be, for example, like this
Just put a call to this function in a cell in the form
=GETRANDVALUE(A1:F15;-1;25)