How to solve optimization problems with Excel and Solver
Whether it's minimizing costs or maximizing returns, this excerpt from the book Data Smart shows you how to use Excel's Solver add-in
An optimization problem is one where you have to make the best decision (choose the best investments, minimize your company's costs, find the class schedule with the fewest morning classes, or so on). In optimization models then, the words "minimize" and "maximize" come up a lot when articulating an objective.
In data science, many of the practices, whether that's artificial intelligence, data mining, or forecasting, are actually just some data prep plus a model-fitting step that's actually an optimization model. We'll start with a little practice with optimization now. Just a taste.
In Excel, optimization problems are solved using an Add-In that ships with Excel called Solver.
On Windows, Solver may be added in by going to File (in Excel 2007 it's the top left Windows button) > Options > Add-ins, and under the Manage drop-down choosing Excel Add-ins and pressing the Go button. Check the Solver Add-In box and press OK.
On Mac, Solver is added by going to Tools then Add-ins and selecting Solver.xlam from the menu.
A Solver button will appear in the Analysis section of the Data tab in every version.
All right! Now that Solver is installed, here's an optimization problem: You are told you need 2,400 calories a day. What's the fewest number of items you can buy from the snack stand to achieve that? Obviously, you could buy 10 ice cream sandwiches at 240 calories a piece, but is there a way to do it for fewer items than that?
Solver can tell you!
To start, download a copy of the Calories spreadsheet from the book's companion website at www.wiley.com/go/datasmart -- use the download link for chapter 1. Make a copy of the Calories sheet in the Concessions.xlsx Excel workbook, name the sheet Calories-Solver, and clear out everything but the calories table on the copy. If you don't know how to make a copy of a sheet in Excel, you simply right-click the tab you'd like to copy and select the Move or Copy menu.
To get Solver to work, you need to provide it with a range of cells it can set with decisions. In this case, Solver needs to decide how many of each item to buy. So in Column C next to the calorie counts, label the column How many? (or whatever you feel like), and you can allow Solver to store its decisions in this column.
- Best iPhone, iPad Business Apps for 2014
- 14 Tech Conventions You Should Attend in 2014
- 10 Desktop Apps to Power Your Windows PC
- How to Add New Job Skills Without Going Back to School
- Slideshow: 7 security mistakes people make with their mobile device
- iOS vs. Android: Which is more secure?
- 11 sure signs you've been hacked
- The value of smarter oil and gas fields With global energy requirements continuing to rise, the exploration, development and production of new oil and gas resources are shifting to increasingly challenging...
- Smarter Environmental Analytics Solutions: Offshore Oil and Gas Installations Example This IBM Redbooks® Solution Guide describes a solution for implementing smarter environmental monitoring and analytics for oil and gas industries. The solution implements...
- Piecing Together the Business Intelligence Puzzle Business intelligence (BI) technology collects and analyzes company data, delivering relevant information to corporate decision-makers in an effort to produce favorable outcomes.
- Harness IT -- An Introduction to Business Intelligence Solutions Learn the key selection criteria required to provide your organization with the capability to address structured data, unstructured data and mobile demands so...
- Live Webcast Increasing the Value of Your Reports and Dashboards Learn how incorporating other analytical capabilities such as predictive modeling and visualization can increase the value of your reports and dashboards by providing...
- The Software-Defined Data Center: Is your ADC ready? Data center transformation is accelerating beyond virtualization to next-generation cloud architectures and software-defined data centers, bringing new challenges for application performance, scalability and...
- Application Acceleration: Optimize the End-User Experience Watch this on-demand webcast and learn how you can optimize your web content, accelerate performance across any device and browser combination, and offload... All Business Intelligence/Analytics White Papers | Webcasts