I realized that I need a way to list out all permutations of a set of 7 numbers so I can apply a formula to the permutations. Is there a way that I can do this?
I realized that I need a way to list out all permutations of a set of 7 numbers so I can apply a formula to the permutations. Is there a way that I can do this?
You will need to use a macro. Lots of examples on the web. Such as this one: http://spreadsheetpage.com/index.php..._permutations/
Pauley
--------
If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).
Is there a way to do this without macros, preferably with formulas?
Start in A1 with
=mod(row(),7)
B1
=mod(roundup(row()/7,0),7)
C1
=mod(roundup(row()/7^2,0),7)
D1
=mod(roundup(row()/7^3,0),7)
And so on. Copy down and may be adjust formulas may be (row ()-1) will be better, may be rounding down, may be adding 1 to all furmulas to avoid zeros. ... Play with it a bit.
Best Regards,
Kaper
PS. this approach will generate repetitions ( 1 1 1 1 1 1 1 etc) too. see file sample.xls (copy cells A1:G1) down as needed.
Unfortunately, I do not know good appproach by formulas to generate just permutatuins (so without repetitions), while VBA is pretty easy.
Nevertheless - see second file (not mine it's based on https://sites.google.com/site/e90e50fx/ pages) sample2.xls
try with 4, 5, then 6 shall also go, but 7 will be probably too tough for Excel.
Thank you! This is exactly what I needed. I'll try to figure out a way to make it not crash at 7. Is there a way to make it so that the numbers of on permutation are spread out instead of all in one cell? That would be preferable but if not, this much more than I hoped for, so again thank you.
I'm not sure if it's that easy to change formula in sample2 to work on separate cells rather than all in one cell.
Have a look on such proposition:
- in sample2 write a small number (say4) in A5
- copy cell G2 down to G721
- in H2 write formula:Formula:Please Login or Register to view this content.
- copy it to H2:N721
- write 6 in A5
- wait for spreadsheet recalc
- select G2:N721, copy and paste special as values
- delete column G.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks