How to Solve Algebraic Equations with Multiple Variables (3 Easy Ways)

We have the following three equations.
2x + 5y + 2z = -38
3x – 2y + 4z = 17
-6x + y – 7z = -12
We’ll determine the value of the three variables, x, y, and z.


Method 1 – Applying Cramer’s Rule to Solve Algebraic Equations with Multiple Variables in Excel

Steps:

  • Write down the equations in cells in the B5:B7 range.

How to Solve Algebraic Equations with Multiple Variables

  • Make a simple data range like in the image below. In cells in the C11:E13 range, we inserted the Coefficients of the variables x, y, and z. In cells in the F11:F13 range, we input the Constants.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell C15 and put in the following formula.
=C11
  • Press the Enter key.

How to Solve Algebraic Equations with Multiple Variables

  • Drag the Fill Handle tool up to cell E17 both vertically and horizontally.

How to Solve Algebraic Equations with Multiple Variables

  • Select the cells in the C15:E17 range.
  • Press Ctrl + 1.

How to Solve Algebraic Equations with Multiple Variables

  • This opens the Format Cells dialog box.
  • Move to the Border tab.
  • Select the Style as shown in the picture below.
  • Choose two outside borders like in the image.
  • Click OK.

How to Solve Algebraic Equations with Multiple Variables

  • The data range looks like a determinant.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell C19 and insert the following formula.
=F11
  • Press Enter. We’re putting the Constants in the first column.

How to Solve Algebraic Equations with Multiple Variables

Note: In Dx, constants will sit in the first column. The coefficients of y and z will occupy the next two columns.

  • Put the coefficients of y and z in the next two columns.

How to Solve Algebraic Equations with Multiple Variables

  • In Dy, the constants will sit in the second column. The other two columns are occupied by the coefficients of x and z, respectively.

How to Solve Algebraic Equations with Multiple Variables

  • In Dz, the constants will sit in the third column. The other two columns are occupied by the coefficients of x and y, respectively.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell D16 and put the following formula in the Formula Bar.
=MDETERM(C15:E17)

The MDETERM function determines the determinant of an array.

  • Press Enter.

How to Solve Algebraic Equations with Multiple Variables

The determinant is -13.

  • Similarly, calculate the determinant of Dx, Dy, and Dz.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell G5 and paste the formula below.
=G20/G16
  • Press Enter.

How to Solve Algebraic Equations with Multiple Variables

That’s how we get the value of variable x.

  • Similarly, find the value of y and z by dividing their determinant (Dy; Dz) with the determinant D, respectively.

How to Solve Algebraic Equations with Multiple Variables

Read More: How to Solve an Equation for X When Y is Given in Excel 


Method 2 – Utilizing MINVERSE and MMULT Functions

Steps:

  • Create a simple data range containing the Coefficients and Constants of the three equations like Method 1.

How to Solve Algebraic Equations with Multiple Variables

  • Create the matrix A and matrix B as in the image below. The matrix A contains the coefficients of the variables. The matrix B includes the constants of the equations.

How to Solve Algebraic Equations with Multiple Variables

  • Create a space for the inverse matrix of A.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell C19, which is the first cell in this area, and enter the following:
=MINVERSE(C15:E17)

The MINVERSE function returns the inverse matrix of a matrix. The main matrix should be stored in an array.

  • Press Enter.

How to Solve Algebraic Equations with Multiple Variables

Note: If you are using any other version of Excel rather than Microsoft Excel 365, make sure to press CTRL+SHIFT+ENTER to get the result.

  • Select cell G5 and paste in the following formula:
=MMULT(C19#,H15:H17)

The MMULT function multiplies two matrices in array form. Then, it returns the product in an array form.

  • Hit the Enter key.

How to Solve Algebraic Equations with Multiple Variables

We get the values of the variables in cells in the G5:G7 range.

Read More: How to Solve 2 Equations with 2 Unknowns in Excel


Method 3 – Using the Solver Add-in to Solve Algebraic Equations with Multiple Variables in Excel

Steps:

  • Create a basic outline like in the image below, as in Method 1.

How to Solve Algebraic Equations with Multiple Variables

  • Construct a data range like the one below. It should contain the headings R.H.S and L.H.S horizontally and Equation 1, Equation 2, and Equation 3 vertically.

How to Solve Algebraic Equations with Multiple Variables

  • Go to the File tab.

How to Solve Algebraic Equations with Multiple Variables

  • Select Options from the menu.

How to Solve Algebraic Equations with Multiple Variables

  • The Excel Options window opens up.
  • Move to the Add-ins menu.
  • Select Excel Add-ins from the Manage drop-down list.
  • Click on Go.

How to Solve Algebraic Equations with Multiple Variables

  • This opens the Add-ins dialog box.
  • Check the box for Solver Add-in.
  • Click OK.

How to Solve Algebraic Equations with Multiple Variables

  • Create a data range like the picture below.

How to Solve Algebraic Equations with Multiple Variables

  • Select cell C16 and insert the following formula:
=SUMPRODUCT(C11:E11,C21:E21)

The SUMPRODUCT function returns the sum of the products of the corresponding values from all the arrays. It takes one or more arrays as an argument, multiplies the corresponding values of all the arrays, and then returns the sum of the products.

  • Hit the Enter key on your keyboard.

Applying Solver Add-in

Note: For your convenience, we highlighted the cell ranges of the arguments in the picture above.

  • Put the constant of Equation 1 in cell E16.

Applying Solver Add-in

  • Equivalently, fill up the fields of Equation 2 and Equation 3.

Applying Solver Add-in

  • Jump to the Data tab.
  • Select Solver in the Analyze group.

Applying Solver Add-in

  • The Solver Parameters wizard opens.
  • Put cell C16 in the Set Objective box.
  • Put the cells in the C21:E21 range in the By Changing Variable Cells box.
  • Click on the Add button.

Applying Solver Add-in

  • This opens the Add Constraint input box.
  • Give the reference of cell C16 into the Cell Reference box.
  • Select the equal sign (=).
  • Give the cell reference of cell E16 into the Constraint box.
  • Click on Add.

Applying Solver Add-in

  • Repeat the above steps for Equation 2 and Equation 3.
  • Click on the OK button.

Applying Solver Add-in

  • This returns us to the Solver Parameters window.
  • Untick the box for Make Unconstrained Variables Non-Negative.
  • Choose Simplex LP from the Select a Solving Method drop-down list.
  • Click on Solve.

Applying Solver Add-in

  • The Solver Results wizard will open.
  • Select the OK button.

Applying Solver Add-in

  • We can see the values of the variables in cells in the C21:E21 range.

Applying Solver Add-in

  • Move the answers to the top of the sheet to make them visible. We transferred them to the cells in the G5:G7 range.

Applying Solver Add-in

Read More: How to Solve System of Equations in Excel


Practice Section

We have provided a Practice section like below in each sheet on the right side.

Practice Section

Read More: How to Solve Polynomial Equation in Excel


Download the Practice Workbook


Related Articles


<< Go Back to Excel Solve Equation | Excel Solver Examples | Solver in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shahriar Abrar Rafid
Shahriar Abrar Rafid

Shahriar Abrar Rafid, BSc, Naval Architecture and Marine Engineering, Bangladesh University of Engineering and Technology, Bangladesh, has worked with the ExcelDemy project for more than 1 year. He has written over 100+ articles for ExcelDemy. He is a professional visual content developer adept at crafting scripts, meticulously editing Excel files, and delivering insightful video tutorials for YouTube channels. His work and learning interests vary from Microsoft Office Suites and Excel to Data Analysis, VBA, and Video recording and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo