In cells G8:G11, we've entered the available amount of each type of resource (corresponding to the right hand side values of the constraints). (The dollar signs in $B$4:$E$4 specify that this cell range stays constant, while the cell range B8:E8 becomes B9:E9, B10:E10, and B11:E11 in the copied formulas.) The formulas in cells F8:F11 correspond to the left hand side values of the constraints. We can copy this formula to cells F9:F11 to compute the total amount of pressing, pine chips, and oaks chips used. With these values in place, we can enter a formula in cell F8 to compute the total amount of glue used for any number of pallets produced:įormula for cell F8: =SUMPRODUCT(B8:E8,$B$4:$E$4) These numbers come directly from the formulas for the constraints shown earlier. For example, the value 15 in cell C9 means that 15 hours of pressing is required to produce a pallet of Pacific style panels. In cells B8:E11, we've entered the amount of resources needed to produce a pallet of each type of panel. Notice that the profit for each pallet of panels ($450, $1,150, $800 and $400) was entered in cells B5, C5, D5 and E5, respectively. This allows us to compute the objective in cell F5 as:įormula for cell F5: =B5*B4+C5*C4+D5*D4+E5*E4įormula for cell F5: =SUMPRODUCT(B5:E5,B4:E4) (Click on the worksheet for a full-size image.) The Solver will determine the optimal values for these cells. In the worksheet below, we have reserved cells B4, C4, D4 and E4 to represent our decision variables X 1, X 2, X 3, and X 4 representing the number of pallets of each type of panel to produce. Step 4: Now check the box Solver Add-in and click on, Ok. Step 3: At the bottom chooses Excel Add-Ins and click on Go. Step 2: In Excel Options window choose Add-Ins. Because decision variables and constraints usually come in logical groups, you'll often want to use cell ranges in your spreadsheet to represent them. To use SOLVER in excel first, we need to enable this option. Creating an Excel WorksheetĪssuming that you have organized the data for the problem in Excel, the next step is to create a worksheet where the formulas for the objective function and the constraints are calculated. In general, your goal should be to create a spreadsheet that communicates its purpose in a clear and understandable manner. Within this overall structure, you have a great deal of flexibility in how you choose cells to hold your model's decision variables and constraints, and which formulas and built-in functions you use. Run the Solver to find the optimal solution.Use the dialogs in Excel to tell the Solver about your decision variables, the objective, constraints, and desired bounds on constraints and variables.Create a formulas in cells to calculate the left hand sides of each constraint.
Create a spreadsheet formula in a cell that calculates the objective function for your model.Choose a spreadsheet cell to hold the value of each decision variable in your model.Organize the data for your problem in the spreadsheet in a logical manner.To define an optimization model in Excel you'll follow these essential steps: