petkovst

New Member
Joined
Jul 1, 2016
Messages
2
Hello guys,
I have 18 numbers (not from 1 to 18) which I need to randomly combine with each other in groups of 6.
Will appreciate any help on that.

Have a good one!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi. You can achieve this with RAND or RANDBETWEEN on the worksheet but that's a volatile function so it will re-calculate the groups each time you change the value in any other cell. If that's not acceptable then you'll need to use VBA to create the groups. Which do you prefer?

WBD
 
Upvote 0
original 18 in column A, random combined in Col D in 3x6

try this


Excel 2012
ABCD
13650.01525418500
21080.46548611208
3750.3101416192
410.82649241
52650.691756422
62330.6327748265
770.46013712284
81920.8270333233
95000.9083091296
102080.887049224
112960.5895439108
123180.34369157
13240.49842710456
14660.3451261466
152840.667847318
164560.3942751375
174220.6935025140
181400.0796117365
Sheet1
Cell Formulas
RangeFormula
B1=RAND()
C1=RANK(B1,$B$1:$B$18)
D1=INDEX($A$1:$A$18,MATCH(ROW(C1),$C$1:$C$18,0))
 
Upvote 0

Book1
ABCDE
13650.224007114561
21080.03584617140
3750.0863521666
410.16426414208
52650.17973612233
62330.57320157
770.5106656318
81920.03219518284
95000.4033369500
102080.6702214422
112960.16613713365
123180.4761797265
13240.09018215296
14660.80328631
152840.43613824
164560.908631175
174220.3155310108
181400.8091282192
Sheet1
Cell Formulas
RangeFormula
B1=MyRand($E$1, ROW())
C1=RANK($B1,$B$1:$B$18)
D1=INDEX($A$1:$A$18,MATCH(ROW(),$C$1:$C$18,0))


Code:
Public Function MyRand(seed As Long, occurrence As Long)

MyRand = Rnd(-seed)
Do While occurrence > 1
    MyRand = Rnd
    occurrence = occurrence - 1
Loop

End Function

Change the value in E1 to generate a new list.

WBD
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,796
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top