combinations generater?

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
hi!
i have 4 numbers in 4 cells:
a1=1 b1=2 c1=3 d1=4
(could be also 1-2-3-3)
how to generate all possible combinations of 4 numbers
out of 8 (1-2-3-4-5-6-7-8)
with repeats
and two out of the 4's (can be3's too)
need to be from the original range (a1:d1),
like 2-1-7-7 or 4,4,8,6 ?

very favorable by formula/s if possible

p.s
order not important (like 2-1-3-4 and also 3-2-1-4)
 
Not pretty, with a formula
Fluff.xlsm
ABCD
13473
2
31133
41134
51137
61143
71147
81173
91174
101233
111234
121237
131243
141247
151273
161274
171313
181314
191317
201323
211324
221327
231331
241332
251333
261334
271335
281336
291337
301338
Data
Cell Formulas
RangeFormula
A3:D1631A3=LET(s,BASE(SEQUENCE(8^4,,0),8,4)+"1111",m,--MID(s,{1,2,3,4},1),a,IFERROR(REPLACE(s,FIND(A1,s),1,""),s),b,IFERROR(REPLACE(a,FIND(B1,a),1,""),a),c,IFERROR(REPLACE(b,FIND(C1,b),1,""),b),d,IFERROR(REPLACE(c,FIND(D1,c),1,""),c),FILTER(m,LEN(d)<3))
Dynamic array formulas.
 
Last edited:
Upvote 0
Solution

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Not pretty, with a formula
why not pretty? it's works!!!

you should consider to make it possible to mark 2 maybe 3 answers as the right ones,
sorry i can't marks yours too!
Thanks Fluff !!
 
Upvote 0
lol.... i was sure i marked gordon's answer...

so now which one i'll marked?
the first correct one but not working for me
or
the later one but works for me

🤔
 
Upvote 0
If you are referring to the formula in post#9 that didn't work.
 
Upvote 0
Nor did that one.
I think the only two that worked are post#16 & post#21
 
Upvote 0
although #16 works, i'm more comfortable with all in one formula
thank you!
 
Upvote 0
Thanks for letting us know. (y)
 
Upvote 0

Forum statistics

Threads
1,215,539
Messages
6,125,403
Members
449,222
Latest member
taner zz

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