Labels

Tuesday, 19 July 2011

Generating Random Numbers

Generating Random Numbers

To generate random number in excel use following function.

=rand()
(This will create random decimal numbers each time the cell is refreshed)

If a specific range is required, the above formula can be amended as:


=rand()*(100-1)
(This will create random +ve decimal numbers between 1 and 100 each time the cell is refreshed. If -ve numbers are required the last part of the expression should be written as (1-100)

If only random integers are required, use the INT functions with the above formula as:

=INT(rand()*(100-1))

No comments:

Post a Comment