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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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