Sie sind auf Seite 1von 4

Using Excels Solver

General use of solver


Solver is used to minimize, maximize or drive a cells value to one you manually select. It is
therefore applicable in cases such as optimization and solving equations or systems of
equations. Each of these are accomplished in their own way, but the premise is very similar.

Concept application in Excel


When working with a system of linear equations, you may move all expressions to one side of
the equation in each equation. In doing so, each side should therefore equal zero. To solve for
the zeroes of the equation(s), one could do algebra, which can get tedious in large sets of
equations, or guess and check in simpler cases.
Solver uses an algorithm to drive the value of a cell to a certain value, or a minimum or
maximum, and therefore can be used to solve these equations. The setup involves creating a
set of variable cells which are to be representative of the variables in the equation(s). Then for
each equation, it is necessary to have a cell which contains the expression for the left hand side
and another cell for the right hand side. The values in these cells should be input by using the
variable cells mentioned before. Solver will be able to manipulate the variable cells
independently. Continuing from the concept before, the left hand side cell minus the right
hand side cell, or vice versa should equal zero. If you create a cell expressing this by making it
equal to the right hand side cell minus the left hand side cell, solver will be able to find the
values of the variable cells which makes the difference zero, solving the equation. Below, this is
shown in a simple example.

A
1

value of x

value of y

LHS

RHS

LHS-RHS

2
3
4

2x+y=9

=2*B2+C2

=9

=B4-C4

3x-y=16

=3B2-C2

=16

=B5-C5

sum:

=SUM(D4:C4)

In this example we would drive D6 to zero by allowing Solver to change the values of the cells
for variables x and y, thereby solving the equations.
Verifying that solver is enabled
1. The first step in using solver for any application is checking to see that you have
the add-in enabled in Excel
2. This is done by going to the Data tab in Excels Ribbon.
3. Under this tab, solver will be located in the Data Analysis section.
4. If add-in is already enabled, skip to the section titled Basic Example Walk
Through
5. If the add-in is not enabled, it must now be activated through the following steps:
a. Begin by going to the File, or Office tab and then going to the
options section.
b. From here, look for the name Solver Add-in under the name
column.
c. If this does not appear, select the Analysis Toolpak
d. Select the add-in by clicking it, and then press go.
e. Upon the pop-up of the dialog box, click the check-mark box next
to Solver Add-in and press ok.
f. Return to the Data tab in Excels ribbon to be sure that the addin has been enabled.

Basic example walk through


1. Once you have the solver add-in, download the Excel file from this link to follow
along with http://www.megafileupload.com/6ce3/Instructables_Excel_Zero_Fit.xlsx
2. Open the solver add-in, upon opening you should see the following dialog box:

3. First, set the objective by clicking in the text box next to set objective and then
clicking the target cell, in this case it is the cell just to the right of sum
4. Next, we will set what we want solver to drive the value of this cell to. In this
case, we are driving the cell to zero to solve the equation(s). Select the To: option to
Min. or select Value of: and enter a zero into the number box next to the statement.

Since it is a squared difference, we can simply minimize the value since it will always be
positive.
5. Lastly for this specific case, we must select the cell(s) which we want Excel to
change to drive the cell to zero. For this, click in the By Changing Variable Cells: box
and then highlight the empty cells highlighted in green, to the right of value.
6. After selecting these cells for solver, click the Solve button
7. If the value in the objective cell is correct, or nearer to what you are driving
towards, select Keep Solver Solution and press OK
If the answer seems incorrect or irrational, you may select, Restore Original
Values and press OK
Repeat steps 2-8 and correct anything which may have affected your answer, if
this does not work, check the content of your cells for errors.
---------------------------------------------------------------------------------------------------------------------------Most problems with solver are typically easily solvable and noticeable, as you will be unable to
arrive at a correct solution, or you will receive notification of what occurred. Most problems can
be resolved in one of the following ways:

Ensuring your left hand side and right hand side cells contain the correct

expressions, and the variables are expressed via the variable cells.
Ensuring that Solver is driving the goal cell to the correct value.
Entering values that are guesses into the variable cells to help guide solver to
the correct values.

Das könnte Ihnen auch gefallen