Solver constraints divisible by number

agelcer

New Member
Joined
Dec 12, 2019
Messages
5
I'm trying to use Solver to calculate some values, but I need the values that Solver spits out to be divisible by 22.

I've tried entering "MOD(A1,22) = 0" as a constraint, but Solver stops understanding it as linear.

Any ideas how I would achieve this?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
use 2 variables, the 1st is the double variable and the 2nd the integer.
There is one constraint with the 2nd <= the 1st.
in certain constraints you use the first, in others the second
That's the way.
Can you post or describe your problem ?
 
Last edited:
Upvote 0
mrexcel.png

Manage to solve the problem in a very easy way.

The model should MAX "Total profit" limiting "Total cost" to "Budget". Column "Decision" has the variable cells that Solver should adjust.

Group A is my previous work, where I was trying to force multiples using constraints.

Group B is the simple solution. I added column "Multiple" and, now, both total columns also multiply the "Multiple".

Thank you BSALV, your suggestion led me to this solution.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top