Solver Function

If you just need to solver function and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel for Windows desktop: enable it under File ▸ Options ▸ Add-ins ▸ Manage: Excel Add-ins ▸ Go ▸ tick Solver Add-in — a Solver button then appears at the right end of the Data tab.

On this page7
▤Annotated stepsExcel
1

File ▸ Options ▸ Add-ins, set Manage to Excel Add-ins, click Go, tick Solver Add-in, OK. On Mac: Tools ▸ Excel Add-ins.

2

Build the model so one cell computes the objective from the cells Solver is allowed to change.

3

Data ▸ Analyze ▸ Solver. Set Objective to that cell and pick Max, Min or Value Of.

4

Set "By Changing Variable Cells" to the input cells — they must be values, not formulas.

5

Add constraints one at a time with the Add button; use int or bin in the operator list for whole-number or yes/no decisions.

6

Pick the solving method: Simplex LP for a linear model, GRG Nonlinear for smooth curves, Evolutionary when the model contains IF or lookups.

7

Click Solve, then choose Keep Solver Solution and optionally produce the Answer and Sensitivity reports.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

Solver is an optimiser: you give it a target cell, a set of cells it may change, and constraints, and it finds the values that maximise, minimise or hit a target. It ships with Excel but is off by default. It goes further than Goal Seek, which changes one input to hit one target with no constraints. Three solving methods are offered: Simplex LP for linear problems (fastest and guaranteed optimal), GRG Nonlinear for smooth curved ones, and Evolutionary for problems with IF, VLOOKUP or other non-smooth logic. Choosing Simplex LP on a nonlinear model produces an error; choosing GRG on a nonlinear model finds a local optimum that depends on the starting values. Before you run it on a workbook other people depend on, try it on a copy or a few rows first. Undo only reaches back through the current session, so a quick trial run is the cheapest way to see exactly what will change before the file is saved and shared. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “solver function”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the outcome you expected before you touch the real workbook. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

A production mix: profit per unit in B2:C2, hours per unit in B3:C3, total hours available 400 in E3. Units to make sit in B5:C5 (currently 0) and total profit in E5 as =SUMPRODUCT(B2:C2,B5:C5). Data ▸ Solver ▸ Set Objective: $E$5 ▸ To: Max ▸ By Changing Variable Cells: $B$5:$C$5 ▸ Add constraints: $E$3<=400 and $B$5:$C$5>=0, tick "Make Unconstrained Variables Non-Negative" ▸ Select a Solving Method: Simplex LP ▸ Solve. Solver writes the optimal units into B5:C5. Product mix, staff rostering, blending, transport routing and portfolio allocation are all the same shape of problem, and Solver answers them in one dialog instead of a week of trial and error. When the result is not what you expected, undo straight away rather than repairing it by hand — undo restores the sheet exactly, while manual fixes tend to leave small inconsistencies behind that surface later.

In Google Sheets

Solver is a Microsoft Excel add-in: load it with File ▸ Options ▸ Add-ins on Windows or Tools ▸ Excel Add-ins on Mac. Those steps do not apply to Google Sheets, which has no Excel Solver Add-in; optimisation in Sheets needs a separately installed Google Workspace Marketplace add-on (OpenSolver is one), with its own setup, options and limits. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. Treat “solver function” as a routine rather than a one-off. Once you know which setting or command controls it, the same few steps handle every workbook where it comes up in Excel, and you can explain them to a colleague in a sentence.

Common mistakes

  • Putting a formula in a changing cell — Solver overwrites it with a number and the model breaks.
  • Choosing Simplex LP for a model containing IF, MAX or a lookup, which reports that the linearity conditions are not satisfied.
  • Leaving out a non-negativity constraint and getting an "optimal" answer that makes minus 300 units.
  • Accepting a GRG Nonlinear result as the global optimum; it finds a local one, so re-run from different starting values.
  • Expecting Solver in Excel for the web or on mobile, where the add-in does not exist.

Frequently asked questions

How do I add Solver to Excel?

File ▸ Options ▸ Add-ins ▸ set Manage to Excel Add-ins ▸ Go ▸ tick Solver Add-in ▸ OK. On Mac use Tools ▸ Excel Add-ins. The button appears on the Data tab.

What is the difference between Solver and Goal Seek?

Goal Seek changes one input to make one cell hit one value, with no constraints. Solver changes many inputs, respects constraints, and can maximise or minimise rather than only hitting a target.

Which solving method should I pick?

Simplex LP when the objective and constraints are all linear — it is fastest and gives the true optimum. GRG Nonlinear for smooth curved models. Evolutionary when the model uses IF, MAX, MIN or lookups.

Why does Solver say the linearity conditions are not satisfied?

The model contains something non-linear — often an IF, a lookup or a multiplication of two changing cells — while Simplex LP is selected. Switch to GRG Nonlinear or Evolutionary.