Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Iım aware of the function ³=RAND()², that produces the numbers between 0 and
1, but Iım just trying to create a cell formula that produces an evenly distributed number between two arbitrary values .... Assuming I need between 1 and 10 (i.e., 1,2,3,4,5,6,7,8,9 or 10), how would I achieve this without getting a skewed result? I was thinking of =TRUNC((RAND()*10+1),0) ? Now thatıs just for between 1 and 10 Is there a better way of doing this * help! Brad.) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Brad,
Try using the formula =RANDBETWEEN(1,10) Enable this formula via Tools - Addins - Analysis Toolpak Cheers Dav -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, that approach is fine.
Jerry Brad wrote: I'm aware of the function "=RAND()", that produces the numbers between 0 and 1, but I'm just trying to create a cell formula that produces an evenly distributed number between two arbitrary values .... Assuming I need between 1 and 10 (i.e., 1,2,3,4,5,6,7,8,9 or 10), how would I achieve this without getting a skewed result? I was thinking of =TRUNC((RAND()*10+1),0) ? Now that's just for between 1 and 10 Is there a better way of doing this - help! Brad.) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Random Number GeneratorTo Add:
Just change the 1 and 10 to reflect the start number and the breadth/width of the range you want to generate =Trunc(rand()*(end-begin+1)+begin) As an example: If i wanted to generate Uppercase letters between A and Z code("A") = 65 code("Z") = 90 want to generate possible 26 letters starting with 65 (generate integers between 65 and 90 inclusive) =Char(Trunc(rand()*26+65) or =Char(Trunc(rand()*(90-65+1)+65)) or without having to figure it out: =CHAR(TRUNC(RAND()*(CODE("Z")-CODE("A")+1)+CODE("A"))) -- Regards, Tom Ogilvy "Brad" wrote in message ... I'm aware of the function "=RAND()", that produces the numbers between 0 and 1, but I'm just trying to create a cell formula that produces an evenly distributed number between two arbitrary values .... Assuming I need between 1 and 10 (i.e., 1,2,3,4,5,6,7,8,9 or 10), how would I achieve this without getting a skewed result? I was thinking of =TRUNC((RAND()*10+1),0) ? Now that's just for between 1 and 10 Is there a better way of doing this - help! Brad.) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For a random number between a and b inclusive, I use:
=INT(RAND()*(b-a+1))+a -- Brad wrote in message ... Iım aware of the function ³RAND()², that produces the numbers between 0 and 1, but Iım just trying to create a cell formula that produces an evenly distributed number between two arbitrary values .... Assuming I need between 1 and 10 (i.e., 1,2,3,4,5,6,7,8,9 or 10), how would I achieve this without getting a skewed result? I was thinking of TRUNC((RAND()*10+1),0) ? Now thatıs just for between 1 and 10 Is there a better way of doing this * help! Brad.) -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Random number Generator | New Users to Excel | |||
Random number generator | Excel Worksheet Functions | |||
random number generator | Excel Discussion (Misc queries) | |||
Random Number Generator | Excel Worksheet Functions | |||
random number generator | Excel Discussion (Misc queries) |