Solver is an add-in you turn on in Excel settings, then access from the Data tab

Solver is a tool built into Excel that finds the best answer to a problem by testing different values. It comes with Excel but is turned off by default, so you have to switch it on before you can use it. Once enabled, Solver appears as a button on the Data tab in the ribbon.

Solver works by changing numbers in cells you choose until it reaches a goal you set. For example, you might tell Solver to find the lowest price you can charge while still making a certain profit, or the combination of ingredients that costs the least. It saves you from manually trying dozens of combinations yourself.

The process takes two steps: first, turn Solver on in your Excel settings. Second, set up your spreadsheet with the cells Solver will change and the goal you want to reach. Then Solver does the work.

Key Takeaways

  • Solver is disabled by default in Excel and must be turned on through the Add-ins menu in File settings before you can use it.
  • After enabling Solver, you find it on the Data tab in the ribbon, labeled "Solver" in the Analyze group.
  • Before running Solver, your spreadsheet needs a target cell with a formula (the goal), variable cells that Solver will change, and any constraints you want to set.
  • Solver works on Windows Excel and Mac Excel, but the steps to turn it on differ slightly between the two versions.

Turning on Solver in Windows Excel

Open Excel and go to File in the top left. Click Options at the bottom of the menu. In the Excel Options window, click Add-ins on the left side. At the bottom of the window, you will see a dropdown that says "Manage:" with "Excel Add-ins" selected. Click the Go button next to it.

A small window opens showing available add-ins. Look for Solver Add-in in the list and check the box next to it. Click OK. Solver is now turned on. You can close the Options window.

To confirm it worked, open a spreadsheet and click the Data tab in the ribbon. Look in the Analyze group on the right side of the ribbon. You should see a Solver button. If you do not see it, repeat the steps above and make sure the Solver Add-in box is checked.

Turning on Solver in Mac Excel

Open Excel and click Excel in the menu bar at the top. Select Preferences. In the Preferences window, find and click Add-ins. Click the See All button or look for Solver Add-in in the list. Select Solver Add-in and click the Enable button if it appears, or make sure it is checked.

Close the Preferences window. Open a spreadsheet and click the Data tab. Solver should now appear in the ribbon. If you do not see it, go back to Preferences and confirm Solver Add-in is enabled.

Setting up your spreadsheet before using Solver

Solver needs three things to work: a target cell with a formula that calculates your goal, variable cells that Solver is allowed to change, and optionally constraints that set limits on what Solver can do.

The target cell is where your goal lives. If you want to find the lowest cost, the target cell contains a formula that adds up all costs. If you want to reach a certain profit, the target cell calculates profit. This cell must contain a formula, not just a number you typed in.

Variable cells are the numbers Solver will adjust to reach your goal. If you are finding the best price, the variable cell is the price. If you are mixing ingredients, the variable cells are the amounts of each ingredient. Solver changes these cells over and over until it finds the answer.

Constraints are optional rules. For example, you might tell Solver "the price cannot be less than $10" or "we can only use 50 pounds of flour." Constraints keep Solver from finding an answer that breaks your real-world limits.

Opening Solver and entering your problem

Click the Data tab and click Solver. The Solver Parameters window opens. In the "Set Objective" field, click the cell reference box and then click the target cell in your spreadsheet (the one with your goal formula). You can also type the cell address directly, like B5.

Below that, choose what you want Solver to do: select "Max" to find the highest value, "Min" to find the lowest, or "Value Of" to reach a specific number you enter. For example, if your target cell calculates profit, choose Max. If it calculates cost, choose Min.

In the "By Changing Variable Cells" field, click the cell reference box and select the cells Solver is allowed to change. You can select one cell or a range. If you have multiple separate ranges, hold Ctrl (or Cmd on Mac) and click each range.

If you have constraints, click the Add button. A small window opens where you enter the constraint. For example, you might say "B3 must be greater than or equal to 10" or "C2 must be less than or equal to 100." Click Add to add another constraint, or OK when you are done adding them.

Running Solver and reading the results

Once your target cell, variable cells, and constraints are set, click the Solve button. Solver runs and tests different values in your variable cells. This can take a few seconds or longer depending on how complex your problem is. When it finishes, a Results window appears.

The Results window tells you whether Solver found an answer. If it says "Solver found a solution," the variable cells now hold the values Solver calculated. You can click OK to keep these values in your spreadsheet, or click Cancel to undo and go back to your original numbers.

If Solver says it could not find a solution, it means the problem as you set it up has no answer that meets all your constraints. Check that your constraints are not contradictory (for example, asking for a number that is both greater than 100 and less than 50). You can also try changing your constraints to be less strict and run Solver again.

Common reasons Solver does not work the way you expect

Solver sometimes finds a local answer instead of the best answer. This happens when your problem has multiple peaks and valleys. Solver stops at the first good answer it finds, not necessarily the absolute best one. If you suspect this, try running Solver multiple times with different starting numbers in your variable cells.

Another common issue is forgetting that the target cell must contain a formula. If you typed a number directly into the target cell instead of a formula, Solver has nothing to work with. Check that your target cell starts with an equals sign (=) and references your variable cells or other cells in the spreadsheet.

Solver also needs at least one variable cell to change. If you do not enter any variable cells, Solver cannot run. Make sure you have filled in the "By Changing Variable Cells" field before clicking Solve.

Frequently Asked Questions

Do I have to turn on Solver every time I open Excel?

No. Once you enable Solver through Add-ins, it stays on. You only turn it on once. If Solver disappears from your Data tab, it usually means Excel was updated or reinstalled. Go back to Add-ins and re-enable it.

Can I use Solver on a Mac?

Yes. Solver is available in Excel for Mac. The steps to turn it on are slightly different (through Preferences instead of Options), but the tool works the same way once it is enabled.

What is the difference between Solver and Goal Seek?

Goal Seek is simpler and only changes one cell to reach a target number. Solver is more powerful and can change multiple cells at once while respecting constraints. Use Goal Seek for simple one-variable problems and Solver for complex ones.

Can Solver handle text or just numbers?

Solver works with numbers. Your formulas can reference text, but the cells Solver changes and the target cell must contain or calculate numbers. Solver cannot optimize text values.

What if Solver takes a very long time to run?

Complex problems with many variable cells and constraints can take longer. If Solver seems stuck, you can press Escape to stop it. Try simplifying your problem by removing unnecessary constraints or reducing the number of variable cells, then run Solver again.