All possible combinations

EconSean

Board Regular
Joined
Apr 21, 2002
Messages
129
Greetings all,

I have 5 unique states, call them A through E. Each respondent in the dataset can be in one or more states, including in all or in none. Being in a state is recorded as 1, and not being in the state is a 0.

I am trying to get at a list of all possible combinations of states. That is:

In A through E;
In A, but not in B through E;
In A and B, but not in C through E;
In B, D and E, but not in A or C;
In E, but not in A through D;
Not In A through E;
And so on.

Can anyone see a quick way to automate this to provide a listing of all the possible groupings?

I think that is would be sufficient if I could just get strings of 0's and 1's, such as

11111 - (i.e. In A through E);
00001 - (i.e. In E, but not in A through D);
10010 - (i.e. In A and D, but not in B, C, or E);
00000 - (i.e. Not in A through E).

My apologies if this isn't clear enough.

Thanks in advance for any assistance.

Kind Regards,

Sean
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
In a blank column enter the numbers 0 to 31 sequentially down the column (assume you start in T1. Then T1 contains 0, T2 contains 1, etc.

In column S put =DEC2BIN(T1,5) and copy down.

This is in the analysis tool pak add-in.
 
Upvote 0
Seti,

Thanks for the reply, that looks to have worked perfectly.

Juan Pablo, thanks for your time with this as well.

Regards,

Sean
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,792
Members
449,048
Latest member
greyangel23

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