How to Find Optimal Solution with Linear Programming in Excel

Linear Programming is very useful in terms of resource optimization.

Overview on how to find optimal solution in linear programming excel


In this article, we will demonstrate how to find an optimal solution in linear programming in Excel. We’ll use the Solver tool to find this solution. Solver is a Microsoft Excel tool that uses techniques from operations research in order to find optimal solutions for various kinds of decision problems.


Step 1 – Activating the Solver Add-in

Generally, you will find the Solver option in the Data tab on the Excel Ribbon, which is at the top of an Excel sheet.

Solver option in Data tab

If the option is not available, follow these steps to add Solver to your Data tab:

  • Click on the File menu.

Click on File to Add-in Solver option

The Options tab is at the bottom of the list.

Click on Options to Add-in Solver

  • Click the Options button and a tab will open like the one below.
  • Select Add-ins.

Add-ins option to add Solver

  • Click on Go.

 Add-in options to add Solver

The Add-ins window will appear.

Solver Add-in Option

  • Tick the Solver Add-in option and click OK.

Final step of Add-in Solver of how to find optimal solution in linear programming in excel.

We have successfully activated the Solver option on the Data tab.

Solver option in Data tab


Step 2 – Presenting the Problem Data in a Table

Now we’ll place a practical problem into a data table, in order to find the optimized result.

  • Suppose a manufacturer is producing two products (Product A and Product B) that need the same three types of raw materials, named Raw Material 1, Raw Material 2, and Raw Material 3.
  • To produce Product A, they need 10 units of Raw Material 1, 30 units of Raw Material 2, and 20 units of Raw Material 3.
  • For Product B, they use these materials in quantities of 15, 20, and 25 units.
  • It is mandatory to use a minimum amount of each material. The minimum quantities of Raw materials 1, 2, and 3 are 120, 90, and 70.
  • The market price of Product A is $400 and Product B is $500.

Let’s determine the optimized Quantity of Products A and B so that the company will gain maximum profit.

 dataset to find optimal solution in linear programming in excel.


Step 3 – Applying Formulas for Linear Programming

After preparing our table, we want to determine the optimal quantity to determine the maximum price. Therefore, we will apply some formulas to the cells to get the total price.

  • Enter the following formula in cell E6;
=($C$5*C6)+($D$5*D6)

This formula multiplies the unit price by the quantity for both products, then adds both prices to get the total price in cell E6.

 finding optimal solution in linear programming in excel by applying formula.

  • Copy the formula to cells E9 to E11 by using the AutoFill tool.

 finding optimal solution in linear programming in excel by applying formulas.


Step 4 – Using the Solver Add-in to Determine Optimized Value

This is the most important step, where the Solver is used.

  • Go to the Data tab and select Solver from the Analyze menu.

Inserting Solver Add-in to find optimal solution in linear programming in excel

The Solver Parameters window will appear.

Applying Solver Parameters to find optimal solution in linear programming in excel

  • Fill the values for these 3 options accordingly.

The set objective is cell $E$6.

  • As we want the minimum amount of materials to gain maximum profit, select the Min option.
  • Enter $C$5:$D$5.for the Variable cells, in which the optimized quantity of products will be determined.

Adding Solver parameters in to find optimal solution in linear programming in excel

Read More: How to Do Linear Programming in Excel 


Step 5 – Adding ‘Subject to the Constraints’ Conditions

The Solver needs some Subject to the constraints conditions in order to make a decision.

  • Below the Subject to the Constraints box, Add the conditions.

Adding Solver parameters to find optimal solution in linear programming in excel

Now we enter values for Cell Reference, Inequality sign, and Constraint.

Cell Reference, Inequality & Constraint to find optimal solution in linear programming in excel

  • Cell Reference is $C$5:$D$5, inequality is >= and Constraint will be 0. X and Y cannot both be zero.

Adding Cell Reference, Inequality & Constraint to find optimal solution in linear programming in excel

  • Click on Add again.

Adding Cell Reference, Inequality & Constraint to find optimal solution in linear programming in excel

  • Add the following: Cell Reference as $C$5:$D$5, inequality as >= and Constraint as $G$9:$G$11.

Adding Cell Reference, Inequality & Constraint to find optimal solution in linear programming in excel

  • Click OK.

Adding Constraints to find optimal solution in linear programming in excel


Step 6 – Finding the Optimal Solution to Maximize Profit

Now we can solve according to the given Solver Parameters.

  • Click Solve.

Clicking Solve button to find optimal solution in linear programming in excel

The Optimized Quantity of Product A and B are returned, which are 12 and 54 respectively. Moreover, the Total required units of each raw material and the optimized Price are also provided.

Result of optimal solution in linear programming in excel

Read More: How to Solve Integer Linear Programming in Excel


Download Practice Workbook


Related Articles


<< Go Back to Excel Linear Programming | Solver in Excel Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Mahfuza Anika Era
Mahfuza Anika Era

Mahfuza Anika Era graduated from the Bangladesh University of Engineering and Technology in Civil Engineering. She has been with ExcelDemy for almost a year, where he has written nearly 30 articles and reviewed many. She has also worked on the ExcelDemy Forum and solved 50+ user problems. Currently, she is working as a team leader for ExcelDemy. Her role is to guide his team to write reader-friendly content. Her interests are Advanced Excel, Data Analysis, Charts & Dashboards,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo