In the Set Target Cell box, enter the cell reference for the objective function. In our case, enter B1. (Shortcut: Click on the Set Target Cell box, then click on cell B1 in the spreadsheet).
To have the value of the target cell be as large as possible, click Max.
To have the value of the target cell be as small as possible, click Min.
To have the target cell be a certain value, click Value of, and then type the value in the box.
In the By Changing Cells box, enter the cell references for each of the decision variables, separating nonadjacent references with commas. The adjustable cells must be related directly or indirectly to the target cell. You can specify up to 200 adjustable cells. In our example, enter A1:A2
To have Solver automatically propose the adjustable cells based on the target cell, click Guess.
In the Subject to the Constraints box, enter any constraints you want to apply. For each constraint do the following:
- Click Add. This will bring up the following dialog box:

- In the cell Reference box, enter the cell reference for the constraint.
- In the middle box choose one of <=, =, >=.
- In the Constraint box, enter the right hand side of the constraint.
- So for our first constraint, we would enter C1 in the Cell Reference box, choose <=, and enter 4 in the Constraint box.
- Click OK
- Repeat for each constraint. (Don't forget the bound constraints!)
When you are done specifying the constraints, the solver parameters box should look as follows:

Click Solve. You will then see the following box:

To keep the solution values on the worksheet, click Keep Solver Solution in the Solver Results dialog box. (This means that the values for your decision variables have been altered, with the corresponding changes to the cells defining the objective function and constraint functions.
To restore the original data, click Restore Original Values.
Finally, you can choose the reports you want to generate in the Reports box.