Random Number between two fields

  • Thread starter jarjar_82 - ExcelForums.com
  • Start date
J

jarjar_82 - ExcelForums.com

I need to know if this is possible i want to get a random number
generated between two figures.

Example.

A1 = 20
B1 = 30
C1 = i want this figure to be a random number between cell A1 and B1
i.e 24

Thank you.
 
B

Bernd Plumhoff

If you want an integer:
=MIN($A$1,$B$1)+INT(RAND()*(MAX($A$1,$B$1)-MIN($A$1,$B$1)+1))

HTH,
Bernd
 
M

Max

Another way is to use RANDBETWEEN()

For example: =RANDBETWEEN(A1,B1)
would generate random integers between and inclusive of
the values in A1 and B1

Note that 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
 

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