Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Joe S
 
Posts: n/a
Default How do I use solver to find which cells add up to a certain amoun.

I know that you can use sumproduct to do it, but forgot how.
  #2   Report Post  
Ken Wright
 
Posts: n/a
Default

If you are looking for a solution (Not necessarily the only one) to a subset
of a group of numbers that will add up to a target number, then this can be
done quite simply with Solver.

Assuming range of numbers in A1:A30, add a set of 0s in B1:B30 and in say
B31 put

=SUMPRODUCT(A1:A30*B1:B30)

Now do Tools / Solver / Set Target Cell 'B31' to 'value of' and put in your
target number. Then, using the range selector under the 'By Changing cells'
section, select cells B1:B30 as the ones to change and hit enter which will
take you back to the first dialog box. Now hit the 'Add' button, and add
the constraint that B1:B30 must be 'bin' (Means binary as in 1 or 0, and
it's one of the dropdowns, so just hit the arrow and select 'bin') and just
hit Solve. You MUST ensure that in this example, when you add the 'bin'
constraint range, you do not inadvertantly include the formula cell B31,
else you will get an error message such as 'Binary Constraint cell reference
must include only adjustable cells'

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Joe S" <Joe wrote in message
...
I know that you can use sumproduct to do it, but forgot how.



  #3   Report Post  
Tushar Mehta
 
Posts: n/a
Default

Check
Find a set of amounts that match a target value
http://www.tushar-mehta.com/excel/ti...set-match.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , "=?
Utf-8?B?Sm9lIFM=?=" <Joe says...
I know that you can use sumproduct to do it, but forgot how.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 09:04 PM
Find all cells with a number and mulitply Jim Excel Discussion (Misc queries) 3 January 21st 05 02:28 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
How to find cells with links to other workbooks? Bathonian Excel Discussion (Misc queries) 1 December 21st 04 09:55 AM
Find Protected Cells Q John Excel Worksheet Functions 7 December 9th 04 11:49 PM


All times are GMT +1. The time now is 06:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"