Random Number between two fields

  • Thread starter Thread starter jarjar_82 - ExcelForums.com
  • Start date 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.
 
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
 
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
 
Back
Top