Excel Digest

  Excel help for the rest of us

24 May

How to generate a random number within a given range

To generate a random number within a given range use the RANDBETWEEN function.

Syntax

RANDBETWEEN(bottom,top)

Bottom: is the smallest integer RANDBETWEEN will return.

Top: is the largest integer RANDBETWEEN will return.

Examples:

RANDBETWEEN (1,100) will generate numbers from 1 to 100

RANDBETWEEN (-15,2000) will generate numbers from -15 1 to 2000

Notes:

1. A new random integer number is returned every time the worksheet is calculated.

2. In Excel 2007 you can use RANDBETWEEN function directly, however in Excel 2003 (and may be earlier versions also) the function is part of the Analysis ToolPak add-in. If it is not available in your list of functions then you have to install the Analysis ToolPak. Check the following link for more help:

install and load the Analysis ToolPak add-in in Excel 2003

Print This Post Print This Post

Possibly Related Posts (automatically generated)

   
A macro to generate a list of random numbers 
Random Lookup Revisited 
Random lookup based on VLOOKUP function 

Leave a Reply

© 2010 Excel Digest | Entries (RSS) and Comments (RSS)

GPS Reviews and news from GPS Gazettewordpress logo