Forum Discussion
Bob_Ed_Smith
Sep 07, 2023Copper Contributor
Need Excel Help for Finding Number Combinations
I am trying to write or find a formula for the following:
I have a large column (A) of numbers as currency to 2 decimal places. I have larger numbers as currency in smaller quantities in another column (C). I want to search column A for combinations of numbers that add up to one of the larger numbers I select in column C. I also want to highlight the cells containing the numbers in column A that add up to the larger value I select in column C. I have experimented with sumif and sumifs to no avail. Any help would be appreciated.
- mtarlerSilver ContributorThis sounds like the Knapsack problem: https://techcommunity.microsoft.com/t5/excel/solving-an-0-1-knapsack-problem-with-lambda/m-p/3782575#M186734
I recommend reading that thread and using some of those formulas/approaches. I think giving you the reference to that is better than trying to pick one because there is a lot of unknowns here including how many options you have and if/or how well those solutions will work in your case.- Bob_Ed_SmithCopper ContributorThank you.