Tuesday 25 April 2017

Excel - Microsoft Excel Rand Function

Description

The Excel Rand function generates a random real number between 0 and 1. 

The function takes no arguments and therefore, its syntax is : 

RAND( ) 

Although the number generated is between 0 and 1, you can use the function to generate a random real number between any two supplied limits a and b, using the formula: 

RAND( ) * (b - a) + a 


Rand Function Examples

The spreadsheet below shows three examples, in which the Excel Rand function is used to genrate random numbers between different limits. 

Note that the above formulas will return a different random number every time the spreadsheet recalculates. To force a recalculation at any time, press the F9 key. 

No comments:

Post a Comment