Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to Restrict Random Numbers?
How can I exclude certain numbers from the RANDBETWEEN() function? For
example, I might want to generate a random integer between 1 and 10 that isn't 2, 5 or 7. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to Restrict Random Numbers?
One way:
=CHOOSE(INT(RAND()*7)+1,1,3,4,6,8,9,10) In article , Mister wrote: How can I exclude certain numbers from the RANDBETWEEN() function? For example, I might want to generate a random integer between 1 and 10 that isn't 2, 5 or 7. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to Restrict Random Numbers?
Thanks, but this won't quite do what I need. I should have explained better.
You see, someone who uses this workbook will, ideally, be able to able to select with check box form controls which numbers will be excluded durning any given calculation. So they could select 2 and 9 to be excluded, calculate, then select 7, 8 and 10, calculate, and so on. "JE McGimpsey" wrote: One way: =CHOOSE(INT(RAND()*7)+1,1,3,4,6,8,9,10) In article , Mister wrote: How can I exclude certain numbers from the RANDBETWEEN() function? For example, I might want to generate a random integer between 1 and 10 that isn't 2, 5 or 7. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to Restrict Random Numbers?
Maybe something like this:
A2:A11 = 1,2,3,4,5,6,7,8,9,10 B2:B11 = checkboxes linked to the same cells as each checkbox is "in" C2:C11: =RAND() To get the random number try this array formula** : =INDEX(A2:A11,MATCH(MAX(IF(B2:B11=FALSE,C2:C11)),C 2:C11,0)) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER) Note that when you check/uncheck different checkboxes this will cause the random number to change since RAND is a volatile function. You may want to set calculation to manual and then hit F9 after you make your selections. -- Biff Microsoft Excel MVP "Mister" wrote in message ... Thanks, but this won't quite do what I need. I should have explained better. You see, someone who uses this workbook will, ideally, be able to able to select with check box form controls which numbers will be excluded durning any given calculation. So they could select 2 and 9 to be excluded, calculate, then select 7, 8 and 10, calculate, and so on. "JE McGimpsey" wrote: One way: =CHOOSE(INT(RAND()*7)+1,1,3,4,6,8,9,10) In article , Mister wrote: How can I exclude certain numbers from the RANDBETWEEN() function? For example, I might want to generate a random integer between 1 and 10 that isn't 2, 5 or 7. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
getting numbers divisible by 4 from random numbers in ascending order | Excel Worksheet Functions | |||
I want random numbers generated without repeating numbers | Excel Worksheet Functions | |||
Can Excel pick random numbers from 1-300 and not repeat numbers? | Excel Discussion (Misc queries) | |||
Non-random numbers generated by excel's data analysis random gener | Excel Worksheet Functions | |||
Non-random numbers generated by excel's data analysis random gener | Excel Discussion (Misc queries) |