How do I calculate the number of combinations of ABCDEFGIJK and how do I write this out in Excel, also for larger groups?

I was able to find on this site how to calculate the number of combinations, eg number of comb. of 3, 4, OR 5 from ABCDEFGIJK

but how can I unsubscribe via a PC with EXCEL? If this concerns smaller groups, this can still be done by hand, but for larger groups this is impossible.

Asker: Iran, 53 years

Answer

Hi Iran,

There is no standard function in Excel to effectively write out the requested combination.
On the web (http://www.ozgrid.com/forum/showthread.php?p=148992) I did find code that does this. (tested and approved)
I do hope you are a little familiar with VBA in Excel?
Basically, this code adds a new function to Excel, which is “ListPermutationsOrCombinations’.

You use this function as follows:
– in A1 you write C if you want combinations or P for permutations
– in A2 you note the size of the combinations (eg 3)
– from A3 and each time 1 cell below you write down the input list (in your case: A3 = A, A4 = B, A5 = C etc.)

Calling ListPermutationsOrCombinations will then write out all combinations in a new sheet.

Again, if you are familiar with VBA you can easily adapt this code so that you can choose where the combinations should be written, for example.

How do I calculate the number of combinations of ABCDEFGIJK and how do I write this out in Excel, also for larger groups?

Answered by

Prof. dr. Dr Fabian Di Fiore

Informatics

Hasselt University
Agoralaan University Campus Building D BE-3590 Diepenbeek
http://www.uhasselt.be/

.

Recent Articles

Related Stories