+ Reply to Thread
Results 1 to 6 of 6

Excel Solver Constraint Question

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Excel Solver Constraint Question

    I am trying to enter a constraint where "x OR y >= 1"

    Am I just missing something obvious here? Basically I need, for example, cell A1 OR cell A2 to be greater than 1.

    Any ideas? Thanks for the help!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    13,891

    Re: Excel Solver Constraint Question

    A few ideas/thoughts:

    1) Sometimes it is important to carefully define your constraint. For example, is this an "exclusive OR" type logic (either x or y >=1 but not both) or is it a simple OR logic (x or y or both >=1)? Are x and y real values or are they going to be integers only?
    2) When there isn't a way to enter the "combined" logic statement directly into a Solver constraint, then try to create a function in a worksheet cell that can represent the logic you want to constrain. For example, if, stated differently, your logic here means that one of those values will be 0, then you can have a cell with the function =PRODUCT(x,y), then, in Solver, constrain that cell to be 0.

  3. #3
    Registered User
    Join Date
    10-02-2009
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Excel Solver Constraint Question

    Thanks for the reply. I am trying to say that "x or y or both >=1". X and y are real values.

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

    Re: Excel Solver Constraint Question

    you could put in say c1
    =--OR(A1>=1,A2>=1)
    then have a criteria of c1=1
    "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

  5. #5
    Registered User
    Join Date
    10-02-2009
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Excel Solver Constraint Question

    @martindwilson

    That worked! Thank you so much!
    Last edited by Cutter; 09-19-2012 at 04:33 PM. Reason: Removed whole post quote

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Excel Solver Constraint Question

    @ Verna

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as an infrequent user of the forum, you may have forgotten (or may not be aware) that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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