How to find all combinations that equal a given sum in Excel by either a formula or VBA

jbstream09

New Member
Joined
Oct 13, 2017
Messages
4
Hi, I'm trying to find a way to find all combinations that equal a given sum in Excel by either a formula or VBA.
I have column A, row A1 through A1750 with different amounts (some are negative amounts) and I need to find which rows add up to the sum of $213,448.63

Please help if you know a way..
Thanks,
JB
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
This is actually a pretty tough problem (as you can guess based on the few responses so far). I don't have anything personal to offer, but here's a link to a VBA macro that does what you ask:

http://www.mrexcel.com/pc09/

It's from a challenge on this forum from about 15 years ago. I don't know what your VBA skills are, but after I loaded the program into my version of Excel, I had to do some minor tweaking to get it to work. But it did work! So if you have some basic skills, you should be able to get it to work.

Good luck!
 
Upvote 0
Hi, I have a similar problem and looked at the link you provided. I tried all 3 methods in the post, but I could not make it work with my data. Do you know if there are example files of those 3 methods? That way I can see if I make some errors.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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