Computer >> Computer tutorials >  >> Software >> Office

Solving Equations in Excel (5 Useful Examples)

Excel has many features that can perform different tasks. Besides performing different statistical, and financial analyses, we can solve equations in Excel. In this article, we will analyze a popular topic which is Solving Equations in Excel in different ways with proper illustrations.

How to Solve Equations in Excel

Before starting to solve equations in Excel, let’s see which kind of equation will be solved with which methods.

Types of Solvable Equations in Excel:

There are different kinds of equations exist. But all are not possible to solve in Excel. In this article, we will solve the following types of equations.

  • Cubic equation,
  • Quadratic equation,
  • Linear equation,
  • Exponential equation,
  • Differential equation,
  • Non-linear equation

Excel Tools to Solve Equations:

There are some dedicated tools to solve equations in Excel like Excel Solver Add-in and Goal Seek Feature. Besides, you can solve equations in Excel numerically/manually, using Matrix System, etc.

5 Examples of Solving Equations in Excel

1. Solving Polynomial Equations in Excel

A polynomial equation is a combination of variables and coefficients with arithmetic operations.

In this section, we will try to solve different polynomial equations like cubic, quadrature, linear, etc.

1.1 Solving Cubic Equation

A polynomial equation with degree three is called a cubic polynomial equation.

Here, we will show two ways to solve a cubic equation in Excel.

i. Using Goal Seek

Here, we will use the Goal Seek feature of Excel to solve this cubic equation.

Assume, we have an equation:

Y= 5X3-2X2+3X-6

We have to solve this equation and find the value of X.

📌 Steps:

  • First, we separate the coefficients into four cells.

Solving Equations in Excel (5 Useful Examples)

  • We want to find out the value of X here. Assume the initial value of X is zero and insert zero (0) on the corresponding cell.

Solving Equations in Excel (5 Useful Examples)

  • Now, formulate the given equation of the corresponding cell of Y.
  • Then, press the Enter button and get the value of Y.
=C5*C7^3+D5*C7^2+E5*C7+F5

Solving Equations in Excel (5 Useful Examples)

  • Then, press the Enter button and get the value of Y.

Solving Equations in Excel (5 Useful Examples)

Now, we will introduce the Goal Seek feature.

  • Click on the Data tab.
  • Choose the Goal Seek option from the What-If-Analysis section.

Solving Equations in Excel (5 Useful Examples)

  • The Goal Seek dialog box appears.

Solving Equations in Excel (5 Useful Examples)

We have to insert cell reference and value here.

  • Choose Cell H5 as the Set cell. This cell contains the equation.
  • And select Cell C7 as the By changing cell, which is the variable. The value of this variable will change after the operation.

Solving Equations in Excel (5 Useful Examples)

  • Put 20 on the To value box, which is a value assumed for the equation.

Solving Equations in Excel (5 Useful Examples)

  • Finally, press the OK button.

Solving Equations in Excel (5 Useful Examples)

The status of the operation is showing. Depending on our given target value, this operation calculated the value of the variable on Cell C7.

  • Again, press OK there.

Solving Equations in Excel (5 Useful Examples)

It is the final value of X.

ii. Using Solver Add-In

Solver is an Add-in. In this section, we will use this Solver add-in to solve the given equation and get the value of the variable.

Solver add-ins do not exist in Excel default. We have to add this add-in first.

📌 Steps:

  • We set the value of the variable zero (0) in the dataset.

Solving Equations in Excel (5 Useful Examples)

  • Go to File >> Options.
  • The Excel Options window appears.
  • Choose Add-ins from the left side.
  • Select Excel Add-ins and click on the Go button.

Solving Equations in Excel (5 Useful Examples)

  • Add-ins window appears.
  • Check the Solver Add-in option and click on OK.

Solving Equations in Excel (5 Useful Examples)

  • We can see the Solver add-in in the Data tab.
  • Click on the Solver.

Solving Equations in Excel (5 Useful Examples)

  • The Solver Parameters window appears.

Solving Equations in Excel (5 Useful Examples)

  • We insert the cell reference of the equation on the Set Object box.
  • Then, check the Value of option and put 20 on the corresponding box.
  • Insert the cell reference of the variable box.
  • Finally, click on Solver.

Solving Equations in Excel (5 Useful Examples)

  • Choose Keep Solver Solution and then press OK.

Solving Equations in Excel (5 Useful Examples)

  • Look at the dataset.

Solving Equations in Excel (5 Useful Examples)

We can see the value of the variable has been changed.

1.2 Solving Quadratic Equation

A polynomial equation with degree two is called a quadratic polynomial equation.  

Here, we will show two ways to solve a quadratic equation in Excel.

We will solve the following quadratic equation here.

Y=3X2+6X-5
i. Solve Using Goal Seek Feature

We will solve this quadratic equation using the Goal Seek feature. Have a look at the below section.

📌 Steps:

  • First, we separate the coefficients of the variables.

Solving Equations in Excel (5 Useful Examples)

  • Set the initial value of X zero (0).
  • Also, insert the given equation using the cell references on Cell G5.
=C5*C7^2+D5*C7+E5

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button now.

Solving Equations in Excel (5 Useful Examples)

We get a value of Y considering X is zero.

Now, we will use the Goal Seek feature to get the value of X. We already showed how to enable the Goal Seek feature.

  • Put the cell reference of variable and equation on the Goal Seek dialog box
  • Assume the value of equation 18 and put it on the box of the To value section.

Solving Equations in Excel (5 Useful Examples)

  • Finally, press OK.

Solving Equations in Excel (5 Useful Examples)

We get the final value of variable X.

ii. Using Solver Add-In

We already showed how to add Solver Add-in in Excel. In this section, we will use this Solver to solve the following equation.

📌 Steps:

  • We put zero (0) on Cell C7 as the initial value of X.
  • Then, put the following formula on Cell G5.

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button.

Solving Equations in Excel (5 Useful Examples)

  • Enter the Solver add-in as shown before.
  • Choose the cell reference of the equation as the object.
  • Put the cell reference of the variable.
  • Also, set the value of the equation as 18.
  • Finally, click on Solve option.

Solving Equations in Excel (5 Useful Examples)

  • Check the Keep Solver Solution option from the Solver Results window.

Solving Equations in Excel (5 Useful Examples)

  • Finally, click the OK button.

Solving Equations in Excel (5 Useful Examples)

2. Solving Linear Equations

An equation that has any variable with the maximum degree of 1 is called a linear equation.

2.1 Using Matrix System

The MINVERSE function returns the inverse matrix for the matrix stored in an array.

The MMULT function returns the matrix product of two arrays, an array with the same number of rows as array1 and columns as array2.

This method will use a matrix system to solve linear equations. Here, 3 linear equations are given with 3 variables x, y, and z. The equations are:

3x+2+y+z=8,

11x-9y+23z=27,

8x-5y=10

We will use the MINVERSE and MMULT functions to solve the given equations.

📌 Steps:

  • First, we will separate the coefficients variable in the different cells and format them as a matrix.
  • We made two matrices. One with the coefficients of the variable and another one of the constants.

Solving Equations in Excel (5 Useful Examples)

  • We add another two matrices for our calculation.

Solving Equations in Excel (5 Useful Examples)

  • Then, we will find out the inverse matrix of A using the MINVERSE function.
  • Insert the following formula on Cell C7.
  =MINVERSE(C5:E7)

Solving Equations in Excel (5 Useful Examples)

This is an array formula.

  • Press the Enter button.

Solving Equations in Excel (5 Useful Examples)

The inverse matrix has formed successfully.

  • Now, we will apply a formula based on the MMULT function on Cell H9.
=MMULT(C9:E11,H5:H7)

Solving Equations in Excel (5 Useful Examples)

We used two matrices of size 3x3 and 3x1 in the formula and the resultant matrix is of size 3x1.

  • Press the Enter button again.

Solving Equations in Excel (5 Useful Examples)

And this is the solution of the variables used in the linear equations.

2.2 Using Solver Add-In

We will use the Solver add-in to solve 3 equations with 3 variables.

📌 Steps:

  • First, we separate the coefficients as shown previously.

Solving Equations in Excel (5 Useful Examples)

  • Then, add two sections for the values of the variables and insert the equations.
  • We set the initial value of the variables to zero (0).

Solving Equations in Excel (5 Useful Examples)

  • Insert the following three equations on cells E10 to E12.
  =C5*C10+D5*C11+E5*C12    =C6*C10+D6*C11+E6*C12    =C7*C10+D7*C11+E7*C12 

Solving Equations in Excel (5 Useful Examples)

  • Now, go to the Solver feature.
  • Set the cell reference of the 1st equation as the objective.
  • Set the value of equation 8.
  • Insert the range of the variables on the marked box.
  • Then, click the Add button.

Solving Equations in Excel (5 Useful Examples)

  • The Add Constraint window appears.
  • Put the cell Reference and values as marked in the below image.

Solving Equations in Excel (5 Useful Examples)

  • Insert the second constraint.
  • Finally, press OK.

Solving Equations in Excel (5 Useful Examples)

  • Constraints are added. Press the Solve button.

Solving Equations in Excel (5 Useful Examples)

  • Look at the dataset.

Solving Equations in Excel (5 Useful Examples)

We can see the value of the variables has been changed.

2.3 Using Cramer’s Rule for Solving Simultaneous Equations with 3 Variables in Excel

When two or more linear equations have the same variables and can be solved at the same time are called simultaneous equations. We will solve the simultaneous equations using Cramer’s rule. The function MDETERM will be used to find out the determinants.

The MDETERM function returns the matrix determinant of an array.

📌 Steps:

  • Separate the coefficients into LHS and RHS.

Solving Equations in Excel (5 Useful Examples)

  • We add 4 sections to construct a matrix using the existing data.

Solving Equations in Excel (5 Useful Examples)

  • We will use the data of LHS to construct Matrix D.

Solving Equations in Excel (5 Useful Examples)

  • Now, we will construct Matrix Dx.
  • Just replace the coefficients of X with the RHS.

Solving Equations in Excel (5 Useful Examples)

  • Similarly, construct Dy and Dz matrices.

Solving Equations in Excel (5 Useful Examples)

  • Put the following formula on Cell F11 to get the determinant of Matrix D.
=MDETERM(C10:E12) 

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button.

Solving Equations in Excel (5 Useful Examples)

  • Similarly, find the determinants of Dx, Dy, and Dz by applying the following formulas.
  =MDETERM(C14:E16)   =MDETERM(C18:E20) =MDETERM(C22:E24) 

Solving Equations in Excel (5 Useful Examples)

  • Move to Cell I6.
  • Divide the determinant of Dx by D to get calculate the value of X.
=F15/F11

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button to get the result.

Solving Equations in Excel (5 Useful Examples)

  • In the same way, get the value of Y and Z using the following formulas:
=F19/F11  =F23/F11 

Solving Equations in Excel (5 Useful Examples)

Finally, we solve the simultaneous equations and get the value of the three variables.

3. Solving Nonlinear Equations in Excel

An equation with a degree of 2 or more than 2 and that does not form a straight line is called a non-linear equation.

In this method, we will solve non-linear equations in Excel using the Solver feature of Excel.

We have two non-linear equations here.

📌 Steps:

  • We insert the equation and variables into the dataset.

Solving Equations in Excel (5 Useful Examples)

  • First, we consider the value of the variable zero (0) and insert that into the dataset.

Solving Equations in Excel (5 Useful Examples)

  • Now, insert two equations on Cell C5 and C6 to get the value of the RHS.
  =C9^2+C10^2-25    =C9-C10^2

Solving Equations in Excel (5 Useful Examples)

  • We add a new row in the dataset for sum.
  • After that, put the following equation on Cell C12.
=SUM(C5:C6) 

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button and the sum of the RHS of both equations.

Solving Equations in Excel (5 Useful Examples)

  • Here, we will apply the Solver feature of Excel.
  • Insert the cell references on the marked boxes.
  • Set the Value of 0.
  • Then, click on Add button to add constraints.

Solving Equations in Excel (5 Useful Examples)

  • We add the 1st constraints as shown in the image.
  • Again, press the Add button for 2nd constraint.

Solving Equations in Excel (5 Useful Examples)

  • Input the cell references and values.
  • Finally, press OK.

Solving Equations in Excel (5 Useful Examples)

  • We can see constraints are added in the Solver.
  • Click the Solver button.

Solving Equations in Excel (5 Useful Examples)

  • Check the Keep Solver Solution option and then click on OK.

Solving Equations in Excel (5 Useful Examples)

  • Look at the dataset now.

Solving Equations in Excel (5 Useful Examples)

We get the value of X and Y successfully.

4. Solving an Exponential Equation

The exponential equation is with variable and constant. In the exponential equation, the variable is considered as the power or degree of the base or constant.

In this method, we will show how to solve an exponential equation using the EXP function.

The EXP function returns e raised to the power of a given number.

We will calculate the future population of an area with a target growth rate. We will follow the below equation for this.

Solving Equations in Excel (5 Useful Examples)

Here,

Po= Current or initial population

R= Growth rate

T= Time

P= Esteemed for the future population.

This equation has an exponential part, for which we will use the EXP function.

📌 Steps:

  • Here, the current population, target growth rate, and the number of years are given in the dataset. We will calculate the future population using those values.

Solving Equations in Excel (5 Useful Examples)

  • Put the following formula based on the EXP function on Cell C7.
  =ROUND(C4*EXP(C5*C6),0)

Solving Equations in Excel (5 Useful Examples)

We used the ROUND function, as the population must be an integer.

  • Now, press the Enter button to get the result.

Solving Equations in Excel (5 Useful Examples)

It is the future population after 10 years as per the assumed growth rate.

5. Solving Differential Equations in Excel

An equation that contains at least one derivative of an unknown function is called a differential equation. The derivative may be ordinary or partial.

Here, we will show how to solve a differential equation in Excel. We have to find out dy/dt, differentiation of y concerning t. We noted all the information in the dataset.

Solving Equations in Excel (5 Useful Examples)

📌 Steps:

  • Set the initial value of n, t, and y from the given information.

Solving Equations in Excel (5 Useful Examples)

  • Put the following formula on Cell C6 for t.
=C5+$G$5 

Solving Equations in Excel (5 Useful Examples)

This formula has been generated from t(n-1).

  • Now, press the Enter button.

Solving Equations in Excel (5 Useful Examples)

  • Put another formula on Cell D6 for y.
  =D5+(C5-D5)*$G$5

Solving Equations in Excel (5 Useful Examples)

This formula has been generated from the equation of y(n+1).

  • Again, press the Enter button.

Solving Equations in Excel (5 Useful Examples)

  • Now, extend the values to the maximum value of t, which is 1.2.

Solving Equations in Excel (5 Useful Examples)

We want to draw a graph using the value of t and y.

  • Go to the Insert tab.
  • Choose a graph from the Chart group.

Solving Equations in Excel (5 Useful Examples)

  • Look at the graph.

Solving Equations in Excel (5 Useful Examples)

It is a y vs. t graph.

  • Now, double-click on the graph and the minimum and maximum values of the graph axis. Resize the horizontal line.

Solving Equations in Excel (5 Useful Examples)

  • After that, resize the vertical line.

Solving Equations in Excel (5 Useful Examples)

  • After customizing the axis, our graph looks like this.

Solving Equations in Excel (5 Useful Examples)

Now, we will find out the differential equation.

  • Calculate the differential equation manually and put it on the dataset.

Solving Equations in Excel (5 Useful Examples)

  • After that, make an equation based on this equation and put that on Cell E5.
=-1+C5+1.5*EXP(-C5)

Solving Equations in Excel (5 Useful Examples)

  • Press the Enter button and drag the Fill Handle icon.

Solving Equations in Excel (5 Useful Examples)

  • Again, go to the graph and press the right button on the mouse.
  • Choose the Select Data option from the Context menu.

Solving Equations in Excel (5 Useful Examples)

  • Select Add option from the Select Data Source window.

Solving Equations in Excel (5 Useful Examples)

  • Choose the cells of the t column on X values and cells of the y_exact column on Y values in the Edit Series window.

Solving Equations in Excel (5 Useful Examples)

  • Again, look at the graph.

Solving Equations in Excel (5 Useful Examples)

Conclusion

In this article, we described how to solve different types of equations. I hope this will satisfy your needs in solving several equations in Excel. Please have a look at our website Exceldemy.com and give your suggestions in the comment box.