Find Combinations that Sum to "X"

JonesyUK

Board Regular
Joined
Oct 11, 2005
Messages
190
Office Version
  1. 365
Platform
  1. Windows
Dear Experts,

I have the following list of numbers in cells A1 to A21 of sheet1:

60,839.64
64,340.83
66,785.86
69,943.82
73,861.63
76,001.87
78,284.47
80,012.83
87,498.18
88,548.04
89,484.91
97,662.06
97,666.53
105,572.28
105,600.35
107,288.25
108,846.57
110,407.36
125,648.42
131,501.42
146,520.93

I need to find a combination of the above numbers that totals 333,173.77 (if any)....

Can you please help me with some kind of solution to be able to do this....

Many thanks!

JonesUK
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
drclintjones,

See:

Which numbers add up to a specific total
http://www.tech-archive.net/Archive...cel.worksheet.functions/2009-01/msg04130.html
VBA Sub by Harlan Grove.
There seems to be one flaw: if the table is sorted ascending and the first n numbers sum up to the required value exactly,
it will miss that combination. I don’t know if this has been corrected later.
Note the requirements for your settings documented in the code itself
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

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