Search code examples
excelmatrixleast-squaresequations

How can I solve a system of linear equations in Excel


I am having some trouble finding a solution for a system of equations using excel.
The system is of the form Ax=b, with A a matrix and x and b vectors. Obviously, the goal is to find x.

The system does not necessarily have the same number of equations and unknowns. An exact solution is not always possible. Therefor I want to find the best approximation, possibly using least squares.

Are there standard methods in Excel to do that?
If not, can someone provide me with a macro that does that or explain how I can write my own?

Thanks


Solution

  • Check the LINEST() function.