+ Reply to Thread
Results 1 to 8 of 8

Solver Constraints

  1. #1
    Registered User
    Join Date
    06-02-2007
    Posts
    4

    Solver Constraints

    I am doing a maximize profit problem with excel. I would like one of my constraints to be only even numbers for the cells in the "by changing cells". How do I add this constraint?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Could you use data validation > Custom

    =MOD(E1,2)=0

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    06-02-2007
    Posts
    4
    I am not sure what that is. Would you mind explaining how I would use this to add an even constraint to a group of cells such as A1-A10? I don't understand what to type and where to type it.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

  5. #5
    Registered User
    Join Date
    06-02-2007
    Posts
    4
    I highlighted the cells I wanted to solve for even responses, went to data validation, chose custom and typed in "=MOD(E7,2)=0" in the formula box. What does this formula mean? I am still getting odd numbers spit out by solver. I appreciate the help.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Change E7 to the first cell of your range

    e.g your range is E1 to E7 then select the cells and then in data validation enter

    =MOD(E1,2)=0

    HTH


    VBA Noob

  7. #7
    Registered User
    Join Date
    06-02-2007
    Posts
    4
    My data set starts with cell E7. I get what is going on with the data validation. Excel will now not let me type in an odd number, but solver still uses odd numbers in the results. Any thoughts?

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    sorry for the confusion

    I don't have solver installed so can't help

    maybe these links will help

    http://office.microsoft.com/en-us/ex...118641033.aspx


    http://www.dailydoseofexcel.com/arch...sum-to-target/
    VBA Noob

+ 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