random numbers from a data of numbers?

M

MaryEng

Can anyone provide an effective Excel function for obtaining random numbers
based on a set of known random numbers?
 
N

Naz

1) Randbetween(lower,upper) formula
2) if You have a list of random numbers u could put a number to the left of
that column and the create a vlookup based on a random number to pull back
that number

=vlookup(randbetween(1,6),$A$1:$A$6,2,false)

A B
1 R1
2 R2
3 R3
4 R4
5 R5
6 R6

IF you have something else in mind post back

_______________________
Naz,
London
 
J

JE McGimpsey

Not sure what "obtaining random numbers based on a set of known random
numbers" means, exactly, but if you have a set of random numbers, you
can use the technique here:

http://www.mcgimpsey.com/excel/randint.html

to get a random sampling of them.

Say your randoms were in A1:A100. You could get a random sample of 10 by
array-entering

=INDEX(A:A,RANDINT(1,100))
 
B

Bernd Plumhoff

Your algorithm is still calculating nEnd - nStart + 1 random numbers and not
only the number of requested ones, I think.

I suggest to take my function UniqRandInt() at www.sulprobil.com.

Regards,
Bernd
 
J

JE McGimpsey

No. When array-entered, the function returns the same number of ints as
cells.

Perhaps I should have been explicit that the formula I gave

=INDEX(A1:A100,RandInt(1,100))

should be entered in 10 cells, as shown in the example on the referenced
site?
 
B

Bernd Plumhoff

Sorry, but: yes.

Your algorithm CALCULATES nEnd - nStart + 1 random numbers and RETURNS the
number of requested random ints.

So, if you array-enter 10 cells with =RANDINT(1,1000000), for example, your
algorithm calculates 1,000,000 random ints and finally returns 10. That's not
necessary, I thought.

Regards,
Bernd
 
Top