Combinations - multiplied sum of doubles, triples, quadruples.....
Hi. I need to find the multiplied sum of double, triple, quadruple...
combinations in a row, both separately and combined. e.g. 1 2 3 4 2 5 4 6 doubles (2*5)+(2*4)+(2*6)+(5*4)+(5*6)+(4*6) triples (2*5*4)+(2*5*6)+(2*4*6)+(5*4*6) ....and so on... Is there a way to do this in excel? many thanks |
Combinations - multiplied sum of doubles, triples, quadruples.....
e.g.
1 2 3 4 Hi. Others have posted "Permutation" type programs here, and especially over in the Excel Programming group. As a side note, if your numbers were consecutive, as in your first example, then maybe the following... If you had 1,2,...20, and you wanted to use a Subset size of 2, then perhaps: (A1 = 20) =((A1-1)*A1*(1 + A1)*(2 + 3*A1))/24 Returns: 20,615 Other sizes than 2 require different equation. I know this is not what you want, but your question got me thinking of a old recurrence problem. I went back and totally rewrote it based on some new programming ideas. Given the numbers 1,2,...5000, take all the subsets of size 4. Multiply each group of numbers, and add them up. We note that there are Combin(5000,4) = 26,010,428,123,750 such subsets. I got the time down to 0.0039 seconds. Yeah! :) Sub TestIt() Dim t, m, n m = 5000 n = 4 t = Timer Debug.Print StirlingFirst(m + 1, m + 1 - n) Debug.Print FormatNumber(Timer - t, 6) End Sub Returns a very large number: 1,016,438,775,060,761,172,309,114,625 0.003906 = = = = Dana DeLouis "To understand recurrence, one must first understand recurrence." = = = = gotthejazz wrote: Hi. I need to find the multiplied sum of double, triple, quadruple... combinations in a row, both separately and combined. e.g. 1 2 3 4 2 5 4 6 doubles (2*5)+(2*4)+(2*6)+(5*4)+(5*6)+(4*6) triples (2*5*4)+(2*5*6)+(2*4*6)+(5*4*6) ....and so on... Is there a way to do this in excel? many thanks |
All times are GMT +1. The time now is 07:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com