Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I was wondering if anyone knows how to create samples in excel. I have a
list of 6 numbers and I want to list all possible random samples of 3. Is there a way to do it?? PLEASE HELP ME! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Assume your 6 numbers are in cells A1:F1. The following macro, starting from row 10, in columns A:C, will produce all the combinations of 3: Sub combos() rnum = 10 For i = 1 To 6 For j = i + 1 To 6 For k = j + 1 To 6 If i < j And i < k And j < k Then Cells(rnum, 1) = Cells(1, i) Cells(rnum, 2) = Cells(1, j) Cells(rnum, 3) = Cells(1, k) rnum = rnum + 1 End If Next k Next j Next i End Sub Write back if you need adjustments based on your original numbers' locations. HTH Kostis Vezerides On Mar 15, 8:22 pm, RL wrote: I was wondering if anyone knows how to create samples in excel. I have a list of 6 numbers and I want to list all possible random samples of 3. Is there a way to do it?? PLEASE HELP ME! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() "vezerid" wrote: Hi, Assume your 6 numbers are in cells A1:F1. The following macro, starting from row 10, in columns A:C, will produce all the combinations of 3: Sub combos() rnum = 10 For i = 1 To 6 For j = i + 1 To 6 For k = j + 1 To 6 If i < j And i < k And j < k Then Cells(rnum, 1) = Cells(1, i) Cells(rnum, 2) = Cells(1, j) Cells(rnum, 3) = Cells(1, k) rnum = rnum + 1 End If Next k Next j Next i End Sub Write back if you need adjustments based on your original numbers' locations. HTH Kostis Vezerides On Mar 15, 8:22 pm, RL wrote: I was wondering if anyone knows how to create samples in excel. I have a list of 6 numbers and I want to list all possible random samples of 3. Is there a way to do it?? PLEASE HELP ME! I'm sorry I really don't understand this, is there any other easier way? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|