Jump to content

Recommended Posts

Posted

Hi guys

 

Not sure this is in the right section but here goes. I have a list of words, and wondered how to list every possible combination of them using Excel or similar.

 

For example, if the list contains Dog, Cat, Mouse, I need to produce another list of:

 

Dog

Cat

Mouse

Dog Cat

Dog Mouse

Cat Mouse

Cat Dog

Mouse Dog

Mouse Cat

Dog Cat Mouse

Dog Mouse Cat

Cat Mouse Dog

Cat Dog Mouse

Mouse Dog Cat

Mouse Cat Dog

.... and so on.

 

The trouble is, the list I have is much longer than this. Impossible task to do easily?

 

Help!!! :D

 

Thanks

Posted

this would be very easy in access.

 

First you put a table in with all the words, including one blank field.

 

Then you can create a query - include the table mupltiple times with the field that has the words as an output, once for each item in the list if you want every possible combination.

 

run the query and you will get a table with each combination in each row.

 

This will include repetition so Dog, Dog, Dog would come up as well as Cat, Dog, Mouse.

 

If you did not want this then it would just be a question of putting in conditions in the queries to say they must not match other columns.

 

But this does depend on how many words you have got, too many would probably make access fall over.

 

If it was me then I would probably do it with vb script - but this depends on how comfortable you are with script.

Posted (edited)

I think I'm correct with this...

 

Factorial - Wikipedia, the free encyclopedia

 

If your have 5 words in your list you will get 120 combinations,

6=720

7=5,040

8=40,320

and before you know it your into some massive numbers :eek:

 

Actually, not quite right, since your combinations will include ones that aren't made up of the full set and no repetition, but your still talking massive numbers.

Edited by Gerry
Posted
Excellent responses - thanks for all your help, I will have a look and try and work out what I'm doing (once I know exactly what's required from the list of course!).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...