Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL: Example on Use of Solver


View products that this article applies to.

Summary

The Solver add-in that ships with Microsoft Excel is used to find solutions to "what-if" scenarios based on adjustable cells and constraint cells. This article gives an example of how to set up a model on a worksheet and how to use Solver to find a solution to the model based on the constraints in the model.

↑ Back to the top


More information

Follow these steps to create the model on a worksheet:
  1. Open a new worksheet.
  2. Type the following on the worksheet:
          A1: 1
          A2: -3
          A3:
          A4: =A1*A3^2+A2*A3+2
    						
  3. On the Tools menu, click Solver.

    NOTE: If Solver is not on the Tools menu, you need to make sure the Solver add-in is listed and selected in the Add-ins dialog box.
  4. In the Solver Parameters dialog box, in the Set Target Cell box, enter A4.
  5. Click Value Of and set the value to 0.
  6. In the By Changing Cells box, enter A3.
  7. Under Subject to the Constraints, click Add.
  8. Type A3 in the Cell Reference box, click ">=" in the list, and in the Constraint box, type 1.5. Click OK.
  9. Click Solve.
You should get the Solver Results dialog box stating that Solver found a solution and the value in cell A4 should now be 0, or very close to zero (1.04E-07, for example). Click OK to return to the worksheet.

↑ Back to the top


References

For more information about Solver, click Microsoft Excel Help on the Help menu, type solver in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

↑ Back to the top


Keywords: KB214263, kbhowto

↑ Back to the top

Article Info
Article ID : 214263
Revision : 4
Created on : 1/24/2007
Published on : 1/24/2007
Exists online : False
Views : 297