Solver is a built-in Excel tool that finds the best answer to a problem by testing different values

Solver is an add-in that comes with Excel but is not turned on by default. Once you enable it, Solver lets you set a goal (like "maximize profit" or "minimize cost"), tell it which numbers can change, and it will test combinations automatically until it finds the best result. You use it when you have a spreadsheet with formulas and you want to know what input values produce the outcome you want — rather than guessing or changing cells by hand.

Solver works by starting with your current numbers, then systematically adjusting the cells you choose until it reaches the target you set. It is useful for budgets, pricing decisions, resource allocation, and any situation where small changes in one part of your spreadsheet ripple through formulas to affect a final number you care about.

Key Takeaways

  • Solver is included with Excel but must be turned on in the Add-ins menu before you can use it.
  • You need three things set up before running Solver: a target cell with a formula, cells that can change, and a goal (maximize, minimize, or reach a specific value).
  • Solver appears in the Data tab once it is enabled, and you access it by clicking the Solver button.
  • The tool works best when your spreadsheet has clear formulas linking inputs to outputs, and when the problem has a realistic solution.

Enable Solver in Excel on Windows

Open Excel and go to File in the top left. Click Options at the bottom of the menu. In the Excel Options window, select Add-ins from the left sidebar. 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 dialog box titled "Add-ins" will open. Look for Solver Add-in in the list and check the box next to it. Click OK. Excel will load Solver, and you should now see a Solver button in the Data tab at the top of the ribbon. If you do not see it, close and reopen Excel.

Enable Solver in Excel on Mac

Open Excel and click Tools in the menu bar at the top. Select Add-ins from the dropdown. In the Add-ins window, find Solver in the list, check the box, and click OK. The Solver button will now appear in the Data tab.

On some Mac versions, you may need to restart Excel for the button to show up. If Solver still does not appear after restarting, check that you are running a recent version of Excel — older versions may not include Solver or may require a separate installation.

Set up your spreadsheet before opening Solver

Before you run Solver, your spreadsheet needs to be organized in a specific way. You need a target cell — the cell with a formula that produces the number you want to optimize. This might be total profit, total cost, or any other outcome. You also need variable cells — the cells that Solver is allowed to change to reach your goal. These are usually input values like price, quantity, or hours worked.

For example, if you are pricing a product, your target cell might be a formula that calculates profit (revenue minus cost). Your variable cell would be the price you set. Solver will test different prices to find the one that maximizes profit. Make sure your formulas are correct before you start, because Solver only works with the math you have already built in.

Open Solver and enter your target, variables, and goal

Click the Data tab and find the Solver button. The Solver Parameters dialog will open. In the "Set Objective" field, click the cell reference box and then click the target cell in your spreadsheet — the one with the formula you want to optimize. You can also type the cell address directly (for example, C15).

Below that, choose whether you want to Maximize, Minimize, or set the target to a Value Of (a specific number). If you choose "Value Of," type the number you want the target cell to reach. Then, in the "By Changing Variable Cells" field, click and select all the cells that Solver is allowed to adjust. You can select multiple cells by holding Ctrl (or Cmd on Mac) and clicking each one, or by typing their addresses separated by commas.

You can also add constraints — rules that limit how much Solver can change things. For example, you might say "price must be at least $10" or "total hours cannot exceed 40." Click the "Add" button under "Subject to the Constraints" to set these up. Most straightforward problems work without constraints, so you can skip this step if you are just starting out.

Run Solver and review the results

Once you have entered your target cell, variable cells, and goal, click the Solve button. Solver will run and test different combinations of values. Depending on the complexity of your spreadsheet, this might take a few seconds or longer. When it finishes, a dialog will appear showing whether it found a solution.

If Solver found a result, you will see "Solver found a solution" at the top of the dialog. You have two choices: click Keep Solution to accept the result and update your spreadsheet with the new values, or click Restore Original Values to undo the changes and go back to where you started. You can also click Save Scenario to store this result under a name so you can compare it to other scenarios later.

If Solver says it could not find a solution, it usually means the problem as you set it up has no answer, or the constraints you added are impossible to meet. Check that your formulas are correct, that your variable cells are actually linked to your target cell through formulas, and that your constraints make sense.

Common reasons Solver does not work the way you expect

The most common issue is that the variable cells are not connected to the target cell through a formula. If you change a variable cell and the target cell does not change, Solver has nothing to work with. Make sure your target cell contains a formula that references your variable cells, either directly or through other formulas.

Another issue is setting constraints that contradict each other. For example, if you tell Solver to maximize profit but also require that price be less than cost, there is no solution. Review your constraints and make sure they are realistic. You can also try running Solver without constraints first to see if it finds a solution at all. If Solver keeps giving you the same answer no matter what you change, it may be because the problem is linear (the relationship between inputs and outputs is a straight line) and Solver has already found the best answer. This is not a problem — it means Solver is working correctly.

Frequently Asked Questions

Can I use Solver if I have Excel Online or Excel in Microsoft 365?

Solver is available in Excel for Microsoft 365 on both Windows and Mac, and you enable it the same way. Excel Online (the browser version) does not include Solver. If you need Solver, you must use the desktop version of Excel.

What is the difference between Solver and Goal Seek?

Goal Seek is simpler and only changes one cell at a time to reach a target. Solver can change multiple cells at once and can handle constraints. Use Goal Seek for straightforward "what if" questions with one variable, and Solver when you need to optimize across several inputs.

Can Solver handle negative numbers or very large numbers?

Yes, Solver works with negative numbers, decimals, and large numbers. However, if your numbers are extremely large (in the billions) or extremely small (near zero), Solver may have trouble finding a precise answer. Scaling your numbers to a more moderate range can help.

What happens if I close Excel without saving after Solver runs?

If you clicked "Keep Solution," the new values are in your spreadsheet but not saved to the file. If you close Excel without saving, those changes will be lost and your spreadsheet will revert to the values it had when you last saved. Always save your file after running Solver if you want to keep the results.

Can I run Solver multiple times with different goals?

Yes. You can run Solver, save the scenario, change your goal or constraints, and run it again. This is useful for comparing different outcomes — for example, "what if I maximize profit" versus "what if I minimize cost." Each time you run Solver, you can choose to keep or discard the results.