In excel solver,i need a variable to either be zero or lie between 50% of max to 100%. i.e it should not lie between 0 to 50% but can be zero. how to add a constraint like this?
Asked
Active
Viewed 2,188 times
1
-
Without knowing your situation it's very difficult to give a solution. I've just two idea: 1: if you have only one variable with this behaviour, then simply run solver twice with the two value / range and use the better results. 2: adjust your formulas so they consider attribute value 50 as it would be 0. – Máté Juhász May 19 '17 at 07:03
-
Something like "NOT(0% < a ≤ 50%)"? – May 20 '17 at 09:43
1 Answers
-1
Add a dummy variable in another cell with a formula that returns a 1 when the primary variable is 0 or 0.5-1, and returns 0 any other time.
Then put a constraint on this dummy variable, so that it must be 1 in an accepted solution.
Sir Adelaide
- 4,969
- 2
- 13
- 36
-
seems logical, but I'm afraid how solver can manage such a variable. Have you tested this approach already? – Máté Juhász May 19 '17 at 07:46
-
You are correct that solver doesn't like variables that suddenly switch state. But depending on you problem, it may still solve. – Sir Adelaide May 22 '17 at 01:21