Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value
Number which, when summed, equal a specific value Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Go Back  Xtreme Visual Basic Talk > > > Number which, when summed, equal a specific value


Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2017, 01:06 PM
Daigon Ali Daigon Ali is offline
Regular
 
Join Date: Aug 2014
Location: London
Posts: 59
Question Number which, when summed, equal a specific value


Hi Guys,

Does anyone have any code for identifying up to 34 (double) numbers in an array which, when summed, equal a given value?
Each number is only used once.

If no combination of the numbers can produce the specified value, then I'm not worried about finding a nearest match.

I've got as far as returning a "no-match" if the sum of all the numbers is less than the specified value.
But then you'd have to ascertain if one number match the specified value, then if the sum of two numbers..etc

I know you can do this in Excel using the Solver addin, but I'm not using Excel and have over 5000 given values, plus I'll need to run this with different arrays of up to 34 numbers.
Reply With Quote
  #2  
Old 10-20-2017, 08:24 PM
Kluz's Avatar
KluzNumber which, when summed, equal a specific value Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,445
Default

The Solver Add-in can be used independently without Excel being loaded. The Add-in will need to be added as a reference for its code to be visible to your app.
__________________
No the other right mouse click
Reply With Quote
  #3  
Old 10-23-2017, 06:57 AM
Daigon Ali Daigon Ali is offline
Regular
 
Join Date: Aug 2014
Location: London
Posts: 59
Default

Thanks Kluz, I will look into that!

I also found some useful code here.
https://bytes.com/topic/visual-basic...-find-sum-list
Reply With Quote
Reply

Tags
excel, specific, equal, summed


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
 
Number which, when summed, equal a specific value
Number which, when summed, equal a specific value
 
-->