# How to use System of Linear Equations in Excel

Nov 06, 2020 • edited Nov 07, 2020

This example shows you how to solve a system of linear equations in Excel. For example, we have the following system of linear equations:

``````<td width="20" align="left">5x</td>

<td width="10">+</td>

<td width="20">1y</td>

<td width="10">+</td>

<td width="20">8z</td>

<td width="15">=</td>

<td width="20">46</td>
``````
``````<td align="left">4x</td>

<td>-</td>

<td>2y</td>

<td></td>

<td></td>

<td>=</td>

<td>12</td>
``````
``````<td align="left">6x</td>

<td>+</td>

<td>7y</td>

<td>+</td>

<td>4z</td>

<td>=</td>

<td>50</td>
``````

In matrix notation, this can be written as AX = B

``````<!-- A -->

<td width="60"></td>

<td width="5" style="border-left:1px solid; border-top:1px solid"></td>

<td width="20">5</td>

<td width="20">1</td>

<td width="20">8</td>

<td width="5" style="border-right:1px solid; border-top:1px solid"></td>

<!-- X -->

<td width="15"></td>

<td width="30"></td>

<td width="5" style="border-left:1px solid; border-top:1px solid"></td>

<td width="20">x</td>

<td width="5" style="border-right:1px solid; border-top:1px solid"></td>

<!-- B -->

<td width="15"></td>

<td width="30"></td>

<td width="5" style="border-left:1px solid; border-top:1px solid"></td>

<td width="20">46</td>

<td width="5" style="border-right:1px solid; border-top:1px solid"></td>
``````
``````<!-- A -->

<td align="left">with A =</td>

<td style="border-left:1px solid"></td>

<td>4</td>

<td>-2</td>

<td>0</td>

<td style="border-right:1px solid"></td>

<!-- X -->

<td>,</td>

<td>X =</td>

<td style="border-left:1px solid"></td>

<td>y</td>

<td style="border-right:1px solid"></td>

<!-- B -->

<td>,</td>

<td>B =</td>

<td style="border-left:1px solid"></td>

<td>12</td>

<td style="border-right:1px solid"></td>
``````
``````<!-- A -->

<td></td>

<td style="border-left:1px solid; border-bottom:1px solid"></td>

<td>6</td>

<td>7</td>

<td>4</td>

<td style="border-right:1px solid; border-bottom:1px solid"></td>

<!-- X -->

<td></td>

<td></td>

<td style="border-left:1px solid; border-bottom:1px solid"></td>

<td>z</td>

<td style="border-right:1px solid; border-bottom:1px solid"></td>

<!-- B -->

<td></td>

<td></td>

<td style="border-left:1px solid; border-bottom:1px solid"></td>

<td>50</td>

<td style="border-right:1px solid; border-bottom:1px solid"></td>
``````

If A-1 (the inverse of A) exists, we can multiply both sides by A-1 to obtain X = A-1B. To solve this system of linear equations in Excel, execute the following steps.

1. Use the MINVERSE function to return the inverse matrix of A. First, select the range B6:D8. Next, insert the MINVERSE function shown below. Finish by pressing CTRL + SHIFT + ENTER.

Note: the formula bar indicates that the cells contain an array formula. Therefore, you cannot delete a single result. To delete the results, select the range B6:D8 and press Delete.

2. Use the MMULT function to return the product of matrix A-1 and B. First, select the range G6:G8. Next, insert the MMULT function shown below. Finish by pressing CTRL + SHIFT + ENTER.

3. Put it all together. First, select the range G6:G8. Next, insert the formula shown below. Finish by pressing CTRL + SHIFT + ENTER.

#Tutorial#How To#Functions#Array Formulas

How to use Switch function in Excel

How to use Tax Rates in Excel