Listing combinations in excel
In article ,
Raigmore wrote:
I want to list in excel all the possible combinations that could result
from these matches.
So it is just 3 to the power of 7.
I would like them listed as 0,0,0,0,0,0,0 then 0,0,0,0,0,0,1 etc etc.
[ except with 3 instead of 2 for the third possible digit ]
This doesn't need macros; it can be done with functions.
You'll be filling a 7-column by 2187-row block with these. What follows
assumes that the top left corner will be at cell B3, so the bottom right
corner is in cell H2189.
Fill the first row cells, B3 through H3, with zeroes.
Next, in the rightmost column, start at the second row of the block, cell
H4, and put in the formula:
=IF(H3=0,1,IF(H3=3,0,1))
and copy it down, so it fills every cell of that right column. This cycles
0,1,3 all down the column.
Now, put the following formula (which is similar to that one, but with a
prefix) in the top right still-empty cell, G4:
=IF(H40,G3,IF(G3=0,1,IF(G3=3,0,1)))
and copy that to all the remaining cells, B4 thru G2189.
If I didn't screw any of that up, you now have what I think you asked for.
--
Randy Hudson
|