Skip to main content

How To Use Excel Solver

What is Excel Solver

Excel Solver is a what-if analysis tool for optimization in Microsoft Office Excel. It is an add-in with Excel since Excel 97. Excel Solver helps to find an optimal value in one cell, called the Objective Cell (target cell), on your worksheet. It works by changing a group of cells related to the Objective Cell (target cell) to find an optimal value subject to the constraints that you set. You can use Solver, to solve Finance problem, Investment problem, Production problem, Distribution problem, Purchasing problem, Scheduling problem etc.

How To Install Excel Solver Add-in

The Excel Solver Add-in is not need to download and install. It's is available when you install Microsoft Office or Microsoft Excel. And, It's not load default, to use the Excel Solver Add-in, you first need to load it in Excel.

For Excel 2003

  1. Start Microsoft Excel 2003.
  2. On the Tools menu, click Add-Ins.
  3. In the Add-Ins available box, select the Solver Add-in check box, and then click OK. If Solver Add-in is not listed, click Browse to locate it.
  4. If you see a message that tells you the Solver Add-in is not currently installed on your computer, click Yes to install it.
  5. Click Tools on the menu bar. When you load the Solver Add-in, the Solver command is added to the Tools menu.

For Excel 2007

  1. Start Microsoft Excel 2007.
  2. Click the Microsoft Office Button, and then click Excel Options.
  3. Click Add-Ins, and then in the Manage box, select Excel Add-ins.
  4. Click Go.
  5. In the Add-Ins available box, select the Solver Add-in check box, and then click OK.
  6. After you load the Solver Add-in, the Solver command is available in the Analysis group on the Data tab.

For Excel 2010

  1. Start Microsoft Excel 2010.
  2. Click File tab, and then click Options.
  3. In the Excel Options window, Click Add-Ins from the left sidebar, and then in the Manage box (at the bottom of the window), select Excel Add-ins.
  4. Click Go.
  5. In the Add-Ins available box, select the Solver Add-in check box, and then click OK.
    1. If Solver Add-in is not listed in the Add-Ins available box, click Browse to locate the add-in.
    2. If you get prompted that the Solver Add-in is not currently installed on your computer, click Yes to install it.
  6. After you load the Solver Add-in, the Solver command is available in the Analysis group on the Data tab.

Before You Use It

Before you use the Excel Solver, it’s important to understand the basic concept of what it does and how it works. The Excel Solver has three primary components: the Objective Cell, the Variable Cells, and the Constraints.

  • Objective Cell (Target Cell). This is the cell that represents the goal or objective of the problem. We want to either minimize or maximize the target cell.
  • Variable Cells (Changing cells or Adjustable Cells) are the cells that can be modified or adjust to optimize the Objective cell.
  • Constraints. This are restrictions or limitations to what Solver can do to solve the problem.

Excel Solver Examples

Excel Solver Examples: Style Box

Style Box with Excel Solver

Range B2:D4 is a Style Box, you can copy A1:F6 to a new worksheet to understand this example. Now, we use Solver to fill with the Style Box in Excel 2010.

1
2
3
4
5
6
A B C D E F
Style Box Row Sum
1 2 3 =SUM(B2:D2)
4 5 6 =SUM(B3:D3)
7 8 9 =SUM(B4:D4)
Column Sum =SUM(B2:B4) =SUM(C2:C4)
=SUM(D2:D4) Diagonal Sum =SUM(B2,C3,D4)
=SUM(D2,C3,B4)
  1. click Data tab, then click Solver in the Analysis group.
  2. Then, the Solver Parameters window opens. This is where you enter the criteria needed to solve the Style Box problem. see below image.
    Style Box Solver Parameters
  3. set Objective: in this case, we don't need to set Objective, leave it blank.
  4. set Changing Variable Cells: Click and hold on cell B2 and drag-select to cell D4, or enter $B$2:$D$4.
  5. Constraints: In the constraint window, click the Add button, enter a constraint, then click Add button, this will add your constraint to the list, and then allow you to enter another Continue entering all the constraints, and after you have entered the final one on the list, click the Cancel button return to the main Solver window. In this example, we use the constraints listed below:
    • $B$5:$D$5 = 15
    • $F$2:$F$6 = 15
    • $B$2:$D$4 = AllDifferent
    • Tips: AllDifferent constraint is a new constraint in Excel 2010. It requires that these cells must be integers in the range 1 to N (N = 9 in this example), with each variable different from all the others at the solution.
  6. click Solver.
  7. Solver may take a few seconds, or a few minutes (Depending on how much memory your computer has and the processor speed). When it’s finished processing, Solver will return a solution. When Excel reports a successful run, select Keep the Solver Solution and then click OK.
    Solver Results
  8. Then, you will see the Style Box solver results.
    Style Box Solver Results
  9. If you change Objective in step 3, select a cell in range B2:D4, and set value to Max or Min, click Solver, it will return a different solution.
  10. You can download this example: Style Box with Excel Solver

Excel Solver Examples: Finance

Download Excel Solver Finance Examples for Excel 2007 or later

Download Excel Solver Finance Examples for Excel 2003 or earlier

Excel Solver Examples: Investment

Download Excel Solver Investment Examples for Excel 2007 or later

Download Excel Solver Investment Examples for Excel 2003 or earlier

Excel Solver Examples: Production

Download Excel Solver Production Examples for Excel 2007 or later

Download Excel Solver Production Examples for Excel 2003 or earlier

Excel Solver Examples: Distribution

Download Excel Solver Distribution Examples for Excel 2007 or later

Download Excel Solver Distribution Examples for Excel 2003 or earlier

Excel Solver Examples: Purchasing

Download Excel Solver Purchasing Examples for Excel 2007 or later

Download Excel Solver Purchasing Examples for Excel 2003 or earlier

Excel Solver Examples: Scheduling

Download Excel Solver Scheduling Examples for Excel 2007 or later

Download Excel Solver Scheduling Examples for Excel 2003 or earlier

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>

3 comments
  1. AD
    Aarya D

    Excellent article. I have a query. I am using Excel 2007. However, solver parameter is not showing the option of solving method. How do I enable this?

  2. SA
    sandeep

    gr8!
    Can we have a similar formula for 4*4 grid (using 1-16 nos.)?

  3. MU
    Mustafa

    Very helpful article, thank you very much