I am trying to use a UDF with the solver. The case shown below isa a slight modification of the video (
).
The only difference is that the expression for the goal B8 includes an additional factor, the value of the BIBI function.
It looks like the solver is ignoring the +BIBI(b1) component.
Any ideas?
Thank you.
see image attached
WHERE B8==3*B2+2*B3-B4+BIBI(B1) and
Function BIBI(X)
BIBI = X * X
End Function
The only difference is that the expression for the goal B8 includes an additional factor, the value of the BIBI function.
It looks like the solver is ignoring the +BIBI(b1) component.
Any ideas?
Thank you.
see image attached
WHERE B8==3*B2+2*B3-B4+BIBI(B1) and
Solver.xlsm | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | Variables | Solving Linear Programming Problem using Excel's Solver | |||||||||||||
2 | X1 | 9 | |||||||||||||
3 | X2 | 5 | |||||||||||||
4 | X3 | 0 | |||||||||||||
5 | |||||||||||||||
6 | Objective | ||||||||||||||
7 | 3*B2+2*B3-B4 | BIBI(B2) | 3*B2+2*B3-B4+BIBI(B1) | ||||||||||||
8 | Maximize | 37 | #NAME? | #NAME? | |||||||||||
9 | |||||||||||||||
10 | Constrants | ||||||||||||||
11 | Inequality | ||||||||||||||
12 | 1 | 24 | <= | 9 | |||||||||||
13 | 2 | 33 | >= | 2 | |||||||||||
14 | 3 | 17 | >= | 5 | |||||||||||
15 | 4 | 9 | >= | 0 | |||||||||||
16 | 5 | 5 | >= | 0 | |||||||||||
17 | 6 | 0 | >= | 0 | |||||||||||
VIDEO_CASE_WITH_FUNCTION |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F8 | F8 | =3*B2+2*B3-B4 |
H8 | H8 | =BIBI(B2) |
J8 | J8 | =F8+H8 |
B12 | B12 | =B2+3*B3+B4 |
B13 | B13 | =2*B2+3*B3-B4 |
B14 | B14 | =3*B2-2*B3+B4 |
B15:B17 | B15 | =B2 |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
solver_adj | =VIDEO_CASE_WITH_FUNCTION!$B$2:$B$4 | H8, F8, B12:B15 |
Function BIBI(X)
BIBI = X * X
End Function