![microsoft excel linear regression microsoft excel linear regression](https://www.lifewire.com/thmb/Cg7hmH_iLkB4ujUZSQKcOZEG1hQ=/1403x853/filters:no_upscale():max_bytes(150000):strip_icc()/how-to-run-regression-in-excel-4690640-9-188f311724e54786844b02c92f31abf6.png)
Regression Analysis in Excel with the Analysis Toolpak Add-In But that’s a topic for a completely different post. Using Solver, you can fit whatever kind of equation you can dream up to any set of data. We can use this same concept to do more complex multiple linear regression or non-linear regression analysis in Excel. In the case of a simple linear regression like we have here, Solver is probably complete overkill. After all, we have just done “manually” what the Trendline tool and LINEST do automatically. Exactly what was predicted by the chart trendline and LINEST. When we click “Solve”, the Solver does its thing and finds that the values m = 165.36 and b = -79.85 define the best-fit line through the data. When properly set up, the solver dialog should look like this:
![microsoft excel linear regression microsoft excel linear regression](https://cdn.ablebits.com/_img-blog/regression/excel-regression-formula.png)
![microsoft excel linear regression microsoft excel linear regression](https://www.pk-anexcelexpert.com/wp-content/uploads/2019/12/Forecasting-in-Excel-4.jpg)
Use the Solver to find values of the slope and intercept that minimize the total error.Calculate the error between the calculated y-values and the y-data.Calculate new y-values based on those guess values.Enter “guess-values” for the slope and intercept of the equation.It will also introduce you to the possibilities for more complicated curve fitting using Excel. I’ve included it here because it provides some understanding into the way that the previous linear regression methods work. Fortunately, it will probably be unnecessary to ever use this method for simple linear regression. This method is more complex than both of the previous methods. That means we can use them dynamically in a calculation somewhere else in the spreadsheet. This was obviously more work than using a trendline, but the real advantage here is that the slope and y-intercept values have been output to a cell.