LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Function for combinations

Suppose I have all possible combinations of a set of 7
numbers chosen 5 at a time. (i.e 7-choose-5). There would
be a set of 21 total combos, which are listed below:

Combo #1) 1-2-3-4-5
Combo #2) 1-2-3-4-6
Combo #3) 1-2-3-4-7
Combo #4) 1-2-3-5-6
Combo #5) 1-2-3-5-7
Combo #6) 1-2-3-6-7
Combo #7) 1-2-4-5-6
Combo #8) 1-2-4-5-7
Combo #9) 1-2-4-6-7
Combo #10 1-2-5-6-7
Combo #11) 1-3-4-5-6
Combo #12) 1-3-4-5-7
Combo #13) 1-3-4-6-7
Combo #14) 1-3-5-6-7
Combo #15) 1-4-5-6-7
Combo #16) 2-3-4-5-6
Combo #17) 2-3-4-5-7
Combo #18) 2-3-4-6-7
Combo #19) 2-3-5-6-7
Combo #20) 2-4-5-6-7
Combo #21) 3-4-5-6-7

I'm trying to devise some sort of function that will associate a
unique identifier for each combination. So, if the combination of
"1 2 3 4 5" is given as input, then my function should return a "1"
(since this is the 1st combo in the list). If "1 3 4 5 7" is given as
input, then the number 12 should be returned, since that is the 12th combo
above. Does that make sense?

I'm basically trying to find a way to generate a unique identifier for any
5-combination that is given as input. It would be nice if the solution
could
be applied to a general set of combos, such as N-choose-5.

Does anyone have any ideas? I know this problem isn't really related to
VBA, but I trust the wisdom of everybody here.

Thanks everyone.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup plus other function/s combinations required? Twishlist Excel Worksheet Functions 5 January 24th 08 04:42 AM
Permutations or Combinations or some other function?? Mark Siler Excel Discussion (Misc queries) 4 December 23rd 06 04:22 PM
Function generating all possible combinations of set of numbers Lucia Excel Worksheet Functions 1 February 7th 05 10:41 PM
Keyboard Shortcuts combinations of function keys, c... FJM Excel Worksheet Functions 1 January 17th 05 11:35 PM
UDF's and Worksheet Function VBA Combinations Matt P.[_2_] Excel Programming 3 August 25th 04 09:37 PM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"