<--- Return to Excel Statistics Guide
Solve Linear Equations in Excel, C++, RCPP, and R
Keith Greiner
August 9, 2020
Microsoft Excel, C++, RCPP, and R can all be used to solve multiple linear equations. Each has it's own advantage for the specific problem at hand. The pages that are linked from this page, present methods for solving multiple linear equations, based on the method. The method of Cramer’s Rule may be found in a pdf file at this link, while the method of Gauss-Jordan Elimination may be found in a pdf file at this link and the method of Matrix Inverse/ Multiplication may be found in an HTML file at this link. The Excel Statistics Guide may be found here.
The three files represent my inquiries into methods of solving linear equations having multiple coefficients, (m) related to multiple values of x. Based on the number of times these files have been accessed, it appears that the method of Cramer's Rule may have the most interest; perhaps because it is often discussed in classes on linear algebra. If that is true for you, look at this link. Do remember, however, that the C++ program presents a function that seemingly works well in all applications, and a second, legacy, function that appears to have limited applications. I left the legacy function in the file so you can play with it and learn more about why it did not work for all situations. The two are clearly marked.
If your purpose is to have a tool that allows you to solve linear equations, without worrying about how it's done, look at the file at this link.
Despite all the checks that I have made over the years, remember that the programs are not guaranteed in any way whatsoever. You are responsible for checking to determine whether the correct results are found in your application. Also the calculations are not presented so they can be easily copied and pasted into your editor. I find that learners will retain more if they enter the code themselves. that's another reason why the code cannot be guaranteed. You may make a mistake when entering the code into your spreadsheet or editing tool. Be sure to check, recheck, and recheck your work again and again to make sure it is correct.
-- 30 --