Hi everyone,
I'm looking for some help regarding creating/modifying code for combinations. I would like to be able to find all possible combinations of X amount of numbers that equal a target sum. I have used Tushar Mehta's code that can be found online (http://www.tushar-mehta.com/excel/te.../match_values/) and it works great except for the fact it returns all combinations, regardless of how many numbers it takes to equal the target.
His code allows the user to first enter the desired number of combinations, then the target sum, then a list of numbers used to get to the sum. In my head, I would love one more cell where I can enter exactly how many numbers will be used to equal the target.
Any help would be appreciated!
Bookmarks