Randbetween Function

D

Dominique Feteau

Can i be more specific on what random numbers Randbetween chooses?

Like it can choose any number between 1-26, but not 1,2,4,5,9 and 26.

Don't ask why cuz its tooooo complicated.

Thanx

niq
 
D

Dominique Feteau

Thanx Frank

I figured that was a bit of a stretch.

You're still cool.

lataz
 
F

Frank Kabel

Hi
I would create my own UDF to achieve this and filter our the not
desired results in a loop within this function. Though I'm not sure if
the resulting random numbers are still uniform distributed?
But for your purpose it should be sufficient. So you may try

Public Function my_random() As Integer
Dim ret_value
Dim test
While Not test
ret_value = Int(26 * Rnd + 1)
If ret_value = 1 Or ret_value = 2 _
Or ret_value = 4 Or ret_value = 5 _
Or ret_value = 9 Or ret_value = 26 Then
test = False
Else
test = True
End If
Wend
my_random = ret_value
End Function

call it in your worksheet with
=MY_RANDOM()
 
D

Dana DeLouis

Would something along this idea work?

=INDEX({3,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},RANDBETWEEN
(1,20))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top