Hi,
I really need your expert help...hope you can help me
If I have choice between either stocks or bonds (2 choices) and I have a period of 3 months, then how do I get Excel to list all possible combinations? 2 choices and 3 months give 2^3 = 8 possible combinations.
The possible combinations are (B=bonds, S=stocks):
BBB
BBS
BSB
BSS
SBB
SBS
SSB
SSS
BBB means that the investor invest in bonds in all three months and BBS means investment in bonds in two months and stocks in the last etc.
I want a cell for each letter. E.g. the combination BBB should be listed in cell
A1, A2 and A3
and the combinations BBS should be listed in cell
B1, B2 and B3
etc.
I have tried to write out a VBA-code but I cannot not get it to work, so I really hope you can help me.
Thank you in advance
Cheers
Cusuma
PS the choice between stocks and bonds should be a variable and so should the lenghts of the period, so I can change the choices e.g. to three assets and 10 months.
I really need your expert help...hope you can help me
If I have choice between either stocks or bonds (2 choices) and I have a period of 3 months, then how do I get Excel to list all possible combinations? 2 choices and 3 months give 2^3 = 8 possible combinations.
The possible combinations are (B=bonds, S=stocks):
BBB
BBS
BSB
BSS
SBB
SBS
SSB
SSS
BBB means that the investor invest in bonds in all three months and BBS means investment in bonds in two months and stocks in the last etc.
I want a cell for each letter. E.g. the combination BBB should be listed in cell
A1, A2 and A3
and the combinations BBS should be listed in cell
B1, B2 and B3
etc.
I have tried to write out a VBA-code but I cannot not get it to work, so I really hope you can help me.
Thank you in advance
Cheers
Cusuma
PS the choice between stocks and bonds should be a variable and so should the lenghts of the period, so I can change the choices e.g. to three assets and 10 months.