+ Reply to Thread
Results 1 to 6 of 6

Excel Solver – Constraints referencing another sheet

  1. #1
    Registered User
    Join Date
    05-27-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel Solver – Constraints referencing another sheet

    Hello everyone! I have a question regarding the Solver add-in for Excel.

    If I have a constraint dealing with values on different sheets of the same workbook, solver will not retain the workbook the cells are on.

    For example, this constraint:
    $A$1 <= Sheet2!$A$1

    If the solver window is closed and reopened the constraint will no longer reference Sheet 2 and will look like this:
    $A$1 <= $A$1

    Is there a fix for this? For large problems it can be more convenient to move some calculations off the active sheet to save space and it gets frustrating to rebuild the constraints every time the problem needs to be re-run.
    Thanks in advance!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel Solver – Constraints referencing another sheet

    interesting,i tried naming a cell on another worksheet with the same result,
    only way i can see is to use another cell on the same sheet that has =sheet2!a1 in it as your constraint value
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    05-27-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel Solver – Constraints referencing another sheet

    Thanks for the quick response.
    I feel better knowing that it’s not just me that gets this error.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Solver – Constraints referencing another sheet

    Solver requires all the referenced cells to be on the same sheet. You can put a simple formula in a cell to reference a cell on another sheet.
    Last edited by shg; 05-27-2012 at 10:32 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    05-27-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel Solver – Constraints referencing another sheet

    Quote Originally Posted by shg View Post
    Solver requires all the referenced cells to be on the same sheet. You can put a simple formula in a cell to reference a cell on another sheet.
    My problem is that Solver will allow references to another sheet, but will forget that it referenced that sheet the next time it is run. The only way I have found to deal with this is to use Solver’s “Load/Save” function because “Load/Save” will remember what sheets were referenced.
    My question is, if Solver can remember what sheets it referenced once, is there any way for it to do it every time Solver is opened?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel Solver – Constraints referencing another sheet

    My question is, if Solver can remember what sheets it referenced once, is there any way for it to do it every time Solver is opened?
    answer is afik NO, now as we have said ,you pick a cell on the sheet you are running solver on
    eg Z1 in it put =sheet2!a1 now put your constraint as
    $A$1 <= $Z$1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1