Tutorial: Using Excel for Linear Optimization Problems



Similar documents
USING EXCEL 2010 TO SOLVE LINEAR PROGRAMMING PROBLEMS MTH 125 Chapter 4

Solving Linear Programs in Excel

Using EXCEL Solver October, 2000

Microsoft Excel Introduction to Microsoft Excel 2007

Microsoft Excel 2013: Using a Data Entry Form

Sensitivity Report in Excel

Solving Linear Programs using Microsoft EXCEL Solver

Introduction to Microsoft Access 2003

Mail Merge Creating Mailing Labels 3/23/2011

Linear Programming Refining Transportation

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

Excel basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Notes on Excel Forecasting Tools. Data Table, Scenario Manager, Goal Seek, & Solver

Creating a Gradebook in Excel

A Guide to Using Excel in Physics Lab

Advanced Excel 10/20/2011 1

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Using Excel s Solver

EXCEL FINANCIAL USES

Preface of Excel Guide

Tommy B. Harrington 104 Azalea Drive Greenville, NC

E x c e l : Data Analysis Tools Student Manual

Instructions for creating a data entry form in Microsoft Excel

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Excel 2010: Create your first spreadsheet

Pivot Tables & Pivot Charts

In This Issue: Excel Sorting with Text and Numbers

Calc Guide Chapter 9 Data Analysis

PortfolioCenter Export Wizard in Practice: Evaluating IRA Account Holder Ages and Calculating Required Minimum Distribution (RMD) Amounts

Here is a Trial Balance sample, generated and exported into an Excel spreadsheet, by an accounting software*

EXCEL SOLVER TUTORIAL

Graphing Parabolas With Microsoft Excel

Using Excel to find Perimeter, Area & Volume

Step Sheet: Creating a Data Table and Charts

How To Analyze Data In Excel 2003 With A Powerpoint 3.5

Microsoft Excel 2007 and Tools for Statistical Analysis David R. Anderson, Dennis J. Sweeney, and Thomas A. Williams

Company Setup 401k Tab

Using MS Excel to Analyze Data: A Tutorial

Excel 2007 Basic knowledge

Excel Guide for Finite Mathematics and Applied Calculus

As in the example above, a Budget created on the computer typically has:

Excel Modeling Practice. The Svelte Glove Problem Step-by-Step With Instructions

Sage Intelligence Report Designer Add-In

Overview of sharing and collaborating on Excel data

Word 2010: Mail Merge to with Attachments

Excel s Business Tools: What-If Analysis

Importing TSM Data into Microsoft Excel using Microsoft Query

Microsoft Excel 2013: Macro to apply Custom Margins, Titles, Gridlines, Autofit Width & Add Macro to Quick Access Toolbar & How to Delete a Macro.

How to make a line graph using Excel 2007

Call Centre Helper - Forecasting Excel Template

Overview What is a PivotTable? Benefits

Converting an Excel Spreadsheet Into an Access Database

Microsoft Excel Tutorial

Chapter 9 Creating Reports in Excel

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

To create a histogram, you must organize the data in two columns on the worksheet. These columns must contain the following data:

TIPS FOR DOING STATISTICS IN EXCEL

Step 3: Go to Column C. Use the function AVERAGE to calculate the mean values of n = 5. Column C is the column of the means.

Images of Microsoft Excel dialog boxes Microsoft. All rights reserved. This content is excluded from our Creative Commons license.

The Center for Teaching, Learning, & Technology

Microsoft Excel - XP Intermediate

How To Use Excel To Compute Compound Interest

Microsoft Excel 2007 Consolidate Data & Analyze with Pivot Table Windows XP

Intro to Excel spreadsheets

Instructions for Creating an Outlook Distribution List from an Excel File

Instructions for applying data validation(s) to data fields in Microsoft Excel

Microsoft Excel v5.0 Database Functions

GUIDE FOR SORTING RX HISTORY REPORTS IN MICROSOFT EXCEL

Produced by Flinders University Centre for Educational ICT. PivotTables Excel 2010

Microsoft Excel 2010 and Tools for Statistical Analysis

bbc Creating a Purchase Order Form Adobe LiveCycle Designer ES2 November 2009 Version 9

Linear Programming. Solving LP Models Using MS Excel, 18

Excel Tutorial. Bio 150B Excel Tutorial 1

Spreadsheets and Laboratory Data Analysis: Excel 2003 Version (Excel 2007 is only slightly different)

1. Go to your programs menu and click on Microsoft Excel.

Microsoft Excel Tips & Tricks

Performing Simple Calculations Using the Status Bar

Microsoft Excel 2010 Part 3: Advanced Excel

INTRODUCTION TO EXCEL

International Monetary Fund. The Integrated Correspondence System Instructions for Editing Excel-Based Report Forms

Microsoft Project 2013

Excel Math Project for 8th Grade Identifying Patterns

Working with Spreadsheets

Creating a PowerPoint Poster using Windows

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

This activity will show you how to draw graphs of algebraic functions in Excel.

Use Mail Merge to create a form letter

warpct.com Working with MS Excel 2003 Workbook courseware by WARP! Computer Training

Creating a Participants Mailing and/or Contact List:

Merging Labels, Letters, and Envelopes Word 2013

FOR PREPARING THE CALL REPORT EXCEL DATA FILE AND ELECTRONIC SUBMISSION OF THE CRS AND E-DATA

Task Force on Technology / EXCEL

EXCEL EXERCISE #8: Consolidating and Linking Spreadsheets

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

Advanced Microsoft Excel 2010

Microsoft Excel 2013 Splitting Windows and Fixing Panes (Level 3)

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

Transcription:

Tutorial: Using Excel for Linear Optimization Problems Part 1: Organize Your Information There are three categories of information needed for solving an optimization problem in Excel: an Objective Function, Decision Variables, and Constraints. It is simplest to organize these on paper before you start working with the spreadsheet. For tutorial purposes we will follow an example, The Cargo Problem, from start to finish: A shipping company has the capacity to move 100 tons of cargo per day by air. The company charges $250/ton for air freight. Besides the weight constraint, the company can only move 50,000 ft 3 of cargo per day because of limited volume of aircraft storage compartments. The following amounts of cargo are available for shipping each day: Cargo Weight (tons) Volume (ft 3 /ton) 1 30 550 2 40 800 3 50 400 Maximize the profit for the shipping company. Set up this problem: Objective Function: Profit = 250*(Cargo1 + Cargo2+ Cargo3) ($/week) Decision Variables: Cargo 1 (weight in tons) Cargo 2 Cargo 3 Constraints: Weight: Cargo1 + Cargo2 + Cargo3 100 Volume: 550*Cargo1 + 800*Cargo2 +400*Cargo3 50000 Amount 1: Cargo1 30 Amount 2: Cargo2 40 Amount 3: Cargo3 50 *Do not forget to include the trivial constraints! Trivial 1: Cargo1 0 Trivial 2: Cargo2 0 Trivial 3: Cargo3 0

Part 2: Set Up the Problem in the Excel Spreadsheet Solver is an Add-in for Microsoft Excel which is typically not enabled during the initial installation of Excel. If Solver does not appear on the Tools menu in Excel, then you need to enable it as follows: Select the Tools menu in Excel, and then choose Add-ins. Check the box titled Solver Add-ins and then click OK. Solver should then appear as an item on the Tools menu. In order to enter your data and work with it in the most straightforward way it is best to stay organized by using consistent labels and columns. Refer to the following figure as one example for setting up this problem in a spreadsheet. Enter the names of the Objective Function, Decision Variables and Constraints into cells in column A the more descriptive the labels are, the easier it is to keep track of the relationships among the variables and constraints. For the Decision Variables, you can enter a 0 into each of the corresponding cells in column B or you can leave them blank Solver will calculate the optimum values for these variables. In the cell in column B corresponding to the Objective Function, enter the formula determined above, where the names of each of the Decision Variables (e.g. Cargo1, Cargo2, and Cargo3) are replaced with their corresponding cell locations (here, B9, B10, and B11). Refer to the following example. For each Constraint, enter the formula for the left hand side of the inequality/equation in the cell in column B, and enter the Constraint value into the corresponding cell in column C. Column A Column B Profit = 250*(B9 + B10 + B11) Variable Name Formula Constraint Value weight = B9 + B10 + B11 = 100

The final spreadsheet should look as follows when you are ready to run Solver: Part 3: Running Solver Under Tools in the menu bar select Solver. The following dialog box will appear: In Set Target Cell enter the cell corresponding to your Objective Function and choose the appropriate outcome under Equal To: (maximize, minimize, or set to a specific value). NOTE: You can enter cells into any of these target boxes by selecting them on the spreadsheet using the cursor; it s easier than typing in cell addresses.

If you know that your function is linear you can check the Linear Solution box under Options to speed up the solver process. For most problems this is not necessary. Select the cells in column B corresponding to all of your Decision Variables in the By Changing Cells: target box. To set up the Constraints, select Add under Subject to the Constraints: The following dialog box opens: Enter the cell location (in column B) for each Constraint into the left hand box ( Cell Reference: ) and the cell location (in column C) of the Constraint value into the right hand box. Use the pull-down menu in the middle to select the appropriate inequality relation. Continue to click the Add button until all of your Constraints are entered, then select OK. NOTE: You can later change or delete these Constraints from the Solver dialog box if necessary. Click OK. This will return you to the Solver dialog box. When all the targets and constraints have been entered, select Solve. The following dialog box will appear: At this point you have the option to generate any of three reports: Answer, Sensitivity, and Limits. These are inserted as new workbooks in the Excel file. Select any you wish to have included. If Solver was able to find a solution, it will notify you that all constraints and optimality conditions were satisfied. You may elect to Keep the Solver Solution or Restore the Original Values. NOTE: If you choose to generate an Answer Report, you can still select Restore Original Values to continue working with the unaltered spreadsheet; the results from Solver will be saved in the Answer Report. Click OK. You are then returned to the spreadsheet. HINT: The last set of target and constraints used in the Solver dialog box will be saved with each worksheet in the Excel file, and will be copied with the worksheet if you need to duplicate it. So you can repeatedly run Solver in the sheet to investigate the effects of changing Constraint values or relationships.

Part 4: Interpreting the Results Until you become familiar with each report and the information it holds you may wish to generate all possible reports to ensure you do not miss any required information. The following is an example of the answer report generated for this Cargo Problem. Answer Report The Answer Report identifies the names, the corresponding cells, the initial and optimal (final) values of the Target (i.e. the Objective Function), and the values of Adjustable Cells (i.e. the Decision Variables) that produced it. In the Constraint section the status column indicates if a Constraint was binding or not. For nonbinding Constraints, the slack column shows how far from the Constraint your results are. Microsoft Excel 10.0 Answer Report Worksheet: [Book2]Sheet1 Report Created: 11/10/2004 6:01:18 PM Target Cell (Max) Cell Name Original Value Final Value $B$5 Profit 0 24218.75 Adjustable Cells Cell Name Original Value Final Value $B$9 cargo 1 0 30 $B$10 cargo 2 0 16.875 $B$11 cargo 3 0 50 Constraints Cell Name Cell Value Formula Status Slack $B$15 weight 96.875 $B$15<=$C$15 Not Binding 3.125 $B$16 volume 50000 $B$16<=$C$16 Binding 0 $B$17 amount1 30 $B$17<=$C$17 Binding 0 $B$18 amount2 16.875 $B$18<=$C$18 Not Binding 23.125 $B$19 amount3 50 $B$19<=$C$19 Binding 0 $B$20 trivial 1 30 $B$20>=$C$20 Not Binding 30 $B$21 trivial 2 16.875 $B$21>=$C$21 Not Binding 16.875 $B$22 trivial 3 50 $B$22>=$C$22 Not Binding 50

Example: The answer report indicates that the value for total weight of cargo (cell B15) in the optimal solution is 96.875 lbs, which is 3.125 lbs below the 100 lb constraint. Sensitivity Report The Sensitivity Report gives the final optimal values of both the Decision Variables and the Constraints, along with the Lagrange multiplier (i.e. shadow prices) of the binding Constraints. Adjustable Cells Final Reduced Cell Name Value Gradient $B$9 cargo 1 30 0 $B$10 cargo 2 16.875 0 $B$11 cargo 3 50 0 Constraints Final Lagrange Cell Name Value Multiplier $B$15 weight 96.875 0 $B$16 volume 50000 0.3125 $B$17 amount1 30 78.125 $B$18 amount2 16.875 0 $B$19 amount3 50 125 $B$20 trivial 1 30 0 $B$21 trivial 2 16.875 0 $B$22 trivial 3 50 0 Example: The shadow price for Volume is $0.31 which tells us that our optimal profit will increase by 31 cents for each additional cubic foot of space we can manage to secure. In other words, the value of 1 cubic foot of shipping space is $0.31 profit. Limits Report The Limits Report holds some interesting information. It has the upper and lower limits of the decision variables given all the constraints of the problem. In the Cargo problem we have lower limits of zero for each decision variable indicating that we can have no cargo shipped, the upper limits are the optimal values for the function. The target result for each lower limit tells us what value the objective function will take on if that particular constraint drops to the lower limit and all other constraints remain at the optimal value. The target result for the maximum column tells us the profit that is realized if all decision variables are at their optimal values.

Microsoft Excel 10.0 Limits Report Worksheet: [Cargo Problem.xls]Limits Report 1 Report Created: 22/10/2004 17:10:57 Target Cell Name Value $B$5 Profit 24218.75 Adjustable Lower Target Upper Target Cell Name Value Limit Result Limit Result $B$9 cargo 1 30 0 16718.75 30 24218.75 $B$10 cargo 2 16.875 0 20000 16.875 24218.75 $B$11 cargo 3 50 0 11718.75 50 24218.75 Example: In the cargo problem if the amount of cargo 1 drops to zero and we still ship 50 tons of cargo 3 and 16.875 tons of cargo 2 we realize a profit of $16 718.75.