Random integers

N

nick

Is it possible to generate random integers between
certain numbers?

By using the RAND function and multiplying the number by
10 (or 100) it is possible to generate random integers
between 0-9 or 0-99, but is it possible to generate
random integers between, say, 1-8? or 1-50?

Any help would be much appreciated!
 
F

Frank Kabel

Hi
one way:
use RANDBETWEEN from the Analysis Toolpak add-in. e.g.
=RANDBETWEEN(1,87)

another way:
=INT((upperbound - lowerbound + 1) * RAND() + lowerbound)
 
M

Max

Try RANDBETWEEN()

For example: =RANDBETWEEN(1,50)
would generate random integers between 1 - 50

RANDBETWEEN requires the Analysis Toolpak* be
installed and activated

Check the "Analysis Toolpak" box via Tools > Add-Ins

Chip Pearson's page has details on the ATP at:
http://www.cpearson.com/excel/ATP.htm
 
A

Andrew

For between and including 1 and 8, I think =INT(RAND()*8)+1 will do th
trick. If you don't want to include 1 or 8, try =RANDBETWEEN(2,7). Th
RANDBETWEEN function requires the Analysis Toolpak
 

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