RANDBETWEEN Function (Functions in Excel)
Low | High | Random | |
5 | 10 | 5 | =RANDBETWEEN(C4,D4) |
1 | 49 | 41 | =RANDBETWEEN(C5,D5) |
What Does It Do ? |
This function produces a random whole number between two specified numbers. |
The random number will change each time the spreadsheet is recalculated or F9 is pressed. |
Syntax |
=RANDOMBETWEEN(LowLimit,HighLimit) |
Formatting |
No special formatting is needed. |
Example |
The following table shows how the =RANDBETWEEN() has been used to generate six |
numbers to use for the National Lottery. |
Note that the function does not check to ensure all numbers are unique, the same number |
could be generated twice or more. |
Lottery Numbers | The Winning Ticket! | ||
1 | 49 | 3 | =RANDBETWEEN($C$24,$D$24) |
43 | =RANDBETWEEN($C$24,$D$24) | ||
Press function Key | 35 | =RANDBETWEEN($C$24,$D$24) | |
F9 to recalculate. | 40 | =RANDBETWEEN($C$24,$D$24) | |
32 | =RANDBETWEEN($C$24,$D$24) | ||
3 | =RANDBETWEEN($C$24,$D$24) | ||
18 | =RANDBETWEEN($C$24,$D$24) | ||
Duplicates! Spin again | |||
{=IF(SUM(1/COUNTIF(E24:E30,E24:E30))<>7,"Duplicates! Spin again","All OK")} | |||
This formula is used to determine whether all the numbers are different. | |||
It is entered as an array using Ctrl+Shift+Enter. |
0 comments:
Post a Comment