Sub topic 10
Solver in Practice: Product Mix, Funding Mix, and Capital Allocation
This chapter assumes you know basic Excel formulas, cell references, financial statements, and functions such as PMT, NPV, and IRR. It also assumes you can install or enable the Excel Solver add-in. The focus here is applying Solver to decisions with several changing cells and business constraints.
A product-mix model
Suppose a factory makes products X and Y. Each product uses machine hours and earns a contribution margin. Contribution margin is selling price minus variable cost.
| Product | Profit per unit | Machine hours | Maximum demand |
|---|---|---|---|
| X | $20 | 2 | 40 |
| Y | $30 | 4 | 40 |
The factory has 100 machine hours. The total number of units sold cannot exceed 40 because of the market.
Create two changing cells:
B2: units of XC2: units of Y
Then calculate:
- Total profit:
=20*B2+30*C2 - Machine hours:
=2*B2+4*C2 - Total units:
=B2+C2
In Solver, configure the model as follows:
- Set Objective: the total profit cell
- To: Max
- By Changing Variable Cells:
B2:C2 - Subject to constraints:
- Machine hours
<= 100 - Total units
<= 40 B2:C2 >= 0
The solution is 30 units of X and 10 units of Y. Profit is $900. Both the machine-hour limit and the total-unit limit are fully used.
Funding mix and capital allocation
The same structure applies to financing decisions. For example, changing cells might represent the dollars raised through debt, preferred shares, and common equity. The objective could minimize annual financing cost.
Typical constraints include:
- Total funding must equal the required amount.
- Debt must stay below a percentage of total capital.
- Interest coverage must remain above a minimum.
- Each funding source may have a minimum or maximum amount.
For capital allocation, changing cells can represent investment amounts across projects. The objective might maximize net present value (NPV), subject to a cash budget, project limits, and strategic requirements. If projects must be either fully accepted or rejected, use binary constraints such as 0 or 1. If partial investment is allowed, use continuous variables instead.
The model should distinguish these roles clearly:
| Role | Example |
|---|---|
| Objective | Maximize total NPV |
| Variable cells | Investment in projects A, B, and C |
| Constraints | Budget, risk limit, minimum allocation |
| Checks | Funding balance and return calculation |
Verify the result outside Solver
A separate calculation can confirm the product-mix answer. Python's linprog minimizes by default, so use negative profits to represent maximization.
from scipy.optimize import linprog
# Maximize 20*x + 30*y by minimizing its negative.
profit = [-20, -30]
resource_limits = [
[2, 4], # machine hours
[1, 1], # total units
]
limits = [100, 40]
result = linprog(
profit,
A_ub=resource_limits,
b_ub=limits,
bounds=[(0, None), (0, None)],
)
if not result.success:
raise RuntimeError(result.message)
print("Units of X and Y:", result.x)
print("Maximum profit:", -result.fun)Independent verification should recalculate the objective and every constraint from the reported variable values. A Solver result is useful only when it also makes business sense.
Exercise
A product-mix model returns 25 units of X and 10 units of Y, but the machine-hours formula shows 110 hours against a 100-hour limit. What should you do?
Show answer
Reject the result and inspect the Solver constraint, the machine-hours formula, and the referenced variable cells. The reported solution is infeasible until the calculation and constraint agree.