Random select 3 values per row from specific range without duplicates

wjeil

New Member
Joined
Feb 25, 2022
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hello,

Im trying to randomly assign products to a certain location randomly. Locations consist of 3 products and are either for an A, B or C product. Therefore it is not possible to have any duplictates. How can I randomly assign products to a certain location so that every product is stored and that there are not any duplicates?

Is there a solutions, VBA or just with formulas, to model this in Excel?

Regards,
Willem
 

Attachments

  • Check.PNG
    Check.PNG
    38.5 KB · Views: 16
sorry forgot to mention. I have 3 columns (3 product places)
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Still works for me with 3 columns
+Fluff 1.xlsm
ABCDEHIJ
1A1B1C1Product 1Product 2Product 3
2A2B2C2A34A7A29
3A3B3C3A49A40A16
4A4B4C4A24A1A12
5A5B5C5A60A56A2
6A6B6C6A41A22A59
7A7B7C7A17A57A51
8A8B8C8A6A26A19
9A9B9C9A32A39A20
10A10B10C10A53A44A35
11A11B11C11A30A5A61
12A12B12C12A18A52A8
13A13B13C13A23A13A15
14A14B14C14A46A14A31
15A15B15C15A63A36A43
16A16B16C16A50A21A58
17A17B17C17A38A45A55
18A18B18C18A11A3A10
19A19B19C19A62A4A47
20A20B20C20A25A48A37
21A21B21C21A54A33A9
22A22B22C22A27A42A28
23A23B23C23B55B56B15
24A24B24C24B52B58B27
25A25B25C25B62B81B40
26A26B26C26B5B33B84
27A27B27C27B48B13B1
28A28B28C28B51B44B70
29A29B29C29B9B12B61
30A30B30C30B74B53B80
31A31B31C31B21B7B57
32A32B32C32B88B68B79
33A33B33C33B20B67B95
34A34B34C34B63B26B77
35A35B35C35B6B17B14
36A36B36C36B37B38B75
37A37B37C37B31B45B78
38A38B38C38B41B30B18
39A39B39C39B85B76B24
40A40B40C40B23B49B86
41A41B41C41B4B47B93
42A42B42C42B2B72B29
43A43B43C43B35B89B25
44A44B44C44B8B73B11
45A45B45C45B60B19B69
46A46B46C46B54B82B32
47A47B47C47B83B22B36
48A48B48C48B34B59B94
49A49B49C49B66B42B50
50A50B50C50B91B43B64
51A51B51C51B10B92B46
52A52B52C52B39B71B16
53A53B53C53B90B87B28
54A54B54C54B65B3
55A55B55C55C61C185C126
56A56B56C56C78C91C182
57A57B57C57C121C24C20
58A58B58C58C30C117C85
59A59B59C59C34C89C57
60A60B60C60C188C122C49
61A61B61C61C100C114C179
62A62B62C62C3C176C134
63A63B63C63C74C72C22
64B64C64C143C2C14
65B65C65C155C40C79
66B66C66C19C28C119
67B67C67C181C41C159
68B68C68C154C7C39
69B69C69C111C31C23
70B70C70C62C190C96
71B71C71C175C5C43
72B72C72C67C115C136
73B73C73C105C81C166
74B74C74C48C112C18
75B75C75C44C36C69
76B76C76C17C140C108
77B77C77C120C158C145
78B78C78C99C160C1
79B79C79C9C87C77
80B80C80C92C32C59
81B81C81C133C129C167
82B82C82C152C38C6
83B83C83C142C149C4
84B84C84C174C153C75
85B85C85C193C83C10
86B86C86C66C63C35
87B87C87C192C135C71
88B88C88C51C65C146
89B89C89C27C47C172
90B90C90C151C191C80
91B91C91C110C131C144
92B92C92C127C139C26
93B93C93C29C183C68
94B94C94C82C90C102
95B95C95C94C98C156
96C96C58C186C33
97C97C8C101C106
98C98C60C52C56
99C99C116C64C124
100C100C161C147C12
101C101C173C93C171
102C102C132C128C55
103C103C169C50C46
104C104C178C180C73
105C105C13C177C11
106C106C25C113C118
107C107C138C84C123
108C108C76C86C109
109C109C15C148C95
110C110C37C104C103
111C111C97C162C130
112C112C42C88C189
113C113C163C70C184
114C114C141C164C16
115C115C54C170C137
116C116C107C168C53
117C117C157C125C187
118C118C150C45C21
119C119C165
120C120
Primary
Cell Formulas
RangeFormula
A1:A63A1="A"&SEQUENCE(63)
B1:B95B1="B"&SEQUENCE(95)
C1:C193C1="C"&SEQUENCE(193)
H2:J119H2=LET(a,A1#,b,B1#,c,C1#,Prod,3,ra,CEILING(ROWS(a),Prod),rb,CEILING(ROWS(b),Prod),rc,CEILING(ROWS(c),Prod),sProd,SEQUENCE(,Prod,0),s,SEQUENCE((ra+rb+rc)/Prod,,,Prod),IFERROR(IF(s<=ra,INDEX(SORTBY(a,RANDARRAY(ROWS(a))),s+sProd),IF(s<=ra+rb,INDEX(SORTBY(b,RANDARRAY(ROWS(b))),(s-ra)+sProd),INDEX(SORTBY(c,RANDARRAY(ROWS(c))),s-ra-rb+sProd))),""))
Dynamic array formulas.
 
Upvote 0
It works! I had to translate the ceilling function, and used the wrong one.

Thank you very much for all your help.
 
Upvote 0
Glad it's sorted & thanks for the feedback.
To translate formulae I tend to use this site, which is normally very good. Translator
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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