|  

» Adjusting Values Returned by the RAND Function

Problem:

Retrieving two random numbers between 0 and 30, ensuring that the first number (Num1) is always greater than the second one (Num2).

Solution:

Step 1:

To retrieve Num1, use the INT and RAND functions in the following formula in cell A2:
=INT(RAND()*30)+1
This ensures an upper limit of 30 for the number generated.

Step 2:

To retrieve Num2, use the INT and RAND functions in the following formula in cell B2:
=INT(RAND()*A2)
This ensures the number generated is smaller than Num1.


Rate This Tip
12 34 5
Rating: 3.00     Views: 11524
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments