Finding what numbers added together equal 2 sums

bowers2000

New Member
Joined
May 16, 2008
Messages
8
I had a quick question for the math/excel experts on here.

I have 10 numbers. Call it 1,2,3,4,5,6,7,8,9,10.

If you add 4 of the numbers (2+4+8+10) you get 24. If you add the other six remaining numbers (1+3+5+6+7+9) you get 31.

I need a way to figure out which numbers added together equal the sum. So in this example. I would only have the list of the 10 available numbers and the two sums. 24 and 31. I would know that 4 of them added together equal 1 sum and 6 together equal another sum. I need to find out which ones added to together produce the sum.

The numbers will not be sequential like they are in the example above.

I will always have the 2 sums. The total of the 2 sums (55) and the numbers that can be added to get to those totals. I just won't know which ones were used in which total.

Any suggestion on how to use solver and constraints or some other method to figure this out? I'm at a loss.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Thanks for the response. It is similar to what I want but I can't get it to work. I tried the basic problem I posted. (i.e. data set 1-10) Target value 24.

It did find me three numbers that equal 24. (7+8+9). I wanted 4 numbers though. So I set-up an additional contraint in the solver. I added a CountIf statement to count numbers selected. I set a constraint = 4.

When I tried that it failed to produce any answers.

Suggestions? Am I using it wrong?
 
Upvote 0
Nevermind. I got it to work. The sample set data the user was giving me was bad. The solver worked great. Thanks a million.
 
Upvote 0

Forum statistics

Threads
1,224,617
Messages
6,179,914
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top