All Combinations of Lists with an addition

bjorgen

New Member
Joined
Aug 23, 2011
Messages
33
I would like to output all the permutations of a list.

I can do this by just dumping each field and setting unique to yes, however I'd like to be able to include an "ALL" value for each field as the first value.

Any input here is greatly appreciated!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,

What kind of list do you have? Is it data in a single column?
Also it is usually necessary to determine beforehand how many results you will get - some folks post questions like this and need 50 combinations. Others are looking for 500,000,000 combinations (!). Can you provide some context?

ξ
 
Upvote 0
Hi,

What kind of list do you have? Is it data in a single column?
Also it is usually necessary to determine beforehand how many results you will get - some folks post questions like this and need 50 combinations. Others are looking for 500,000,000 combinations (!). Can you provide some context?

ξ

Hi xenou,

Thanks for the quick response. I will likely have 3-4k combinations and that is expected. The problem is that i need an ALL data tied to each unique record combination. The data is 4 fields
ie
ALL ALL ALL ALL
ALL AAA ALL ALL
ALL AAA BBB ALL
ALL AAA BBB CCC
ALL AAA BBB DDD
111 ALL ALL ALL

etc.

let me know if i can clarify things anymore.
 
Upvote 0
Just to clarify, you already have a query that gives you this result:

ALL ALL ALL
AAA ALL ALL
AAA BBB ALL
AAA BBB CCC
AAA BBB DDD
ALL ALL ALL

And now you only need the "ALL" added as the first field:

ALL ALL ALL ALL
ALL AAA ALL ALL
ALL AAA BBB ALL
ALL AAA BBB CCC
ALL AAA BBB DDD
111 ALL ALL ALL


BTW How did that 111 sneak in at the last row ... does that mean something?
 
Upvote 0
Just to clarify, you already have a query that gives you this result:

ALL ALL ALL
AAA ALL ALL
AAA BBB ALL
AAA BBB CCC
AAA BBB DDD
ALL ALL ALL

And now you only need the "ALL" added as the first field:

ALL ALL ALL ALL
ALL AAA ALL ALL
ALL AAA BBB ALL
ALL AAA BBB CCC
ALL AAA BBB DDD
111 ALL ALL ALL


BTW How did that 111 sneak in at the last row ... does that mean something?

I meant the 111 as a specific value, as opposed to ALL.
 
Upvote 0
You need to give some more information I think.

How many records do you have?

How many fields?

How many values etc?

These are all factors that need to be taken into consideration with this sort of thing.

By the way, is the 3-4K what you expect or what you want?

If it's the latter how are you calculating it?
 
Upvote 0
Okay, we've got a problem as this doesn't fit your original specification in post #1:
I can do this by just dumping each field and setting unique to yes, however I'd like to be able to include an "ALL" value for each field as the first value.

Sorry if I'm just being dull here but I think you will need to restate the problem to include this case with the 111's (I don't know what you mean by a specific value as opposed to an ALL).

Further suggestions: it may help to create a simple version of the data and the expected results (if you can do so with some small data set of just a few rows). It also may help to say how the query you have now works (the one that gets the unique values without the ALL's in the first field). I don't know for sure if that will clarify or confuse but usually more information is better.
 
Upvote 0
Okay, we've got a problem as this doesn't fit your original specification in post #1:


Sorry if I'm just being dull here but I think you will need to restate the problem to include this case with the 111's (I don't know what you mean by a specific value as opposed to an ALL).

Further suggestions: it may help to create a simple version of the data and the expected results (if you can do so with some small data set of just a few rows). It also may help to say how the query you have now works (the one that gets the unique values without the ALL's in the first field). I don't know for sure if that will clarify or confuse but usually more information is better.

Vertical Medium Partner CostModel
ALL ALL ALL ALL
ALL SEO ALL ALL
ALL SEO Google ALL
ALL SEO Google Free
ALL SEO Google Paid
Insurance ALL ALL ALL
Insurance SEO Google ALL
Insurance SEO Google Free

etc.

Does that clarify it at all?
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

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