How to Solve Cubic Equation in Excel: 3 Easy Steps

You will learn how to solve cubic equation in Excel with only the coefficients of the equation entered. If you want to solve a cubic equation by hand, it may take a lot of time. However, it can be done in a few seconds if you use our awesome calculator.

The cubic equations can have roots that are imaginary, real, or both. There is no built-in way to get the roots in Excel. The Solver or the Goal Seek feature may be used to get a single root, but with our calculator you get all three roots of a cubic equation.

Let us consider our cubic equation is:

x3-16x2+64x-8=0

To find all three values of x, we will need to enter the coefficients of the equation in the calculator. Then, it will return all roots.

You can see a snapshot of the calculator below.

Overview of How to Solve Cubic Equation in Excel

Now, you can download the file from below and read through the article to see which formulas were used to create this magic!

Download Section

Solving Cubic Equations.xlsx

Solve Cubic Equation in Excel: 3 Easy Steps

There are 3 steps to solve a cubic equation in Excel. Firstly, the user needs to type the coefficients of the cubic equation. Then, the root type and the number of real and imaginary roots are determined using the discriminant. Finally, three formulas are used to calculate all three roots of the cubic equation.

Step I: Entering Coefficients

In the very first step, compare your cubic equation with the model cubic equation (ax3+bx2+cx+d=0). Then, enter the coefficients in cell range C8:C11.

Typing Coefficients into the Cells

Remember to arrange the equation according to the reference equation to avoid problems with the plus or minus signs.

Step II: Determining Root Types

Based on the value of the discriminant from the table below, we can deduce the root type of a cubic equation.

Discriminant Root Type
Negative Single Real Root
0 2 Equal Roots
Positive 3 Real Roots

Type the following formula to find a variable p. This is one of the two variables used to calculate the discriminant.

=C10-((C9)^2/3)

p Variable Calculation

After that, use another formula to get the other variable q.

=C11-((C9*C10)/3)+((2*(C9)^3)/27)

Calculating q Variable

Then, use this formula to calculate the discriminant of the cubic equation.

=-4*C13^3-27*C14^2

Discriminant Formula

At last, insert the formula below to return the root type of the equation.

=IF(C15=0,”2 Equal Roots”, IF(C15<0,”Single Real Root”,”All Real Roots”))

Root Type Calculation for Solve Cubic Equation in Excel

The above formula uses a nested IF function to determine the root type. To become proficient with this function, you can practice IF function exercises, which include 17 real-world examples for better understanding.

These results will be utilized in the next section to choose which function to use for getting the cubic roots.

Step III: Calculating Cubic Roots in Excel

There will be three formulas to determine the three roots of the cubic equation. The first formula combining the IF, SQRT, and ACOS functions to find the first root is as follows:

=IF(C16=”2 Equal Roots”,(-4*C14)^(1/3)-(C9/3),IF(C16=”Single Real Root”,((-C14/2)+SQRT((C13/3)^3+(C14/2)^2))^(1/3)+((-C14/2)-SQRT((C13/3)^3+(C14/2)^2))^(1/3)-(C9/3),2*SQRT(-C13/3)*COS((1/3)*ACOS((-C14/2)*(3/-C13)^(3/2)))-C9/3))

First Root Calculation Formula

Then to get the second root of the equation, we have combined the IF, IMSUB, COMPLEX, SQRT, ACOS, and PI functions. Here, the IMSUB and COMPLEX functions are there for the imaginary parts of a number.

=IF(C16=”2 Equal Roots”,(C14/2)^(1/3)-(C9/3),IF(C16=”Single Real Root”,IMSUB(COMPLEX(-0.5*(((-C14/2)+SQRT((C13/3)^3+(C14/2)^2))^(1/3)+((-C14/2)-SQRT((C13/3)^3+(C14/2)^2))^(1/3)),0.5*(((-C14/2)+SQRT((C13/3)^3+(C14/2)^2))^(1/3)-((-C14/2)-SQRT((C13/3)^3+(C14/2)^2))^(1/3))*SQRT(3)),COMPLEX(C9/3,0)),2*SQRT(-C13/3)*COS((1/3)*ACOS((-C14/2)*(3/-C13)^(3/2))+(2*PI()/3))-C9/3))

Second Root Calculation Formula

Finally, to get the last root of the equation, the following formula is used.

=IF(C16=”2 Equal Roots”,(C14/2)^(1/3)-(C9/3),IF(C16=”Single Real Root”,IMSUB(COMPLEX(-0.5*(((-C14/2)+SQRT((C13/3)^3+(C14/2)^2))^(1/3)+((-C14/2)-SQRT((C13/3)^3+(C14/2)^2))^(1/3)),-0.5*(((-C14/2)+SQRT((C13/3)^3+(C14/2)^2))^(1/3)-((-C14/2)-SQRT((C13/3)^3+(C14/2)^2))^(1/3))*SQRT(3)),COMPLEX(C9/3,0)),2*SQRT(-C13/3)*COS((1/3)*ACOS((-C14/2)*(3/-C13)^(3/2))+(4*PI()/3))-C9/3))

Third Root Calculation Formula

Thus the formulas are used in the cells to create the calculator to solve cubic equation in Excel. Now you can solve and cross-check large cubic equations with ease with this.

Frequently Asked Questions (FAQ)

01. How do I solve quadratic equations in Excel?

Firstly, you will need to list all the coefficients of your quadratic equation with reference to ax2+bx+c=0 equation. Then, you have to use a formula to get the two roots of the equation.

Suppose your coefficients are in the C5, C6, and C7 cells.  The formula for the first root is:

=(-C6+SQRT(C6^2-4*C5*C7))/(2*C5)

and for the second root is:

=(-C6-SQRT(C6^2-4*C5*C7))/(2*C5)

02. How do I solve linear equations in Excel?

Suppose you want to solve two linear equations: 6x+5y=35 & 7x+6y=36. Then you need to type the coefficients in the cells B5:D5 for the first equation and B6:D6 for the latter. Then, use the formula below to solve the linear equation in Excel. Press Ctrl+Shift+Enter for earlier Excel versions and Enter only for Excel 365.

=MMULT(MINVERSE(B5:C6),D5:D6)

03. How do I calculate cubic in Excel?
Let us say you want to calculate the cubic value of 5. You can use any of the following formulas to get the desired output.

=5^(1/3)

or

=POWER(5,1/3)

Things to Remember

  1. Make your cubic equation similar to the reference equation  and then input the values. This means the d coefficient must be on the left side of the equation.
  2. The cells other than B3 and C8:C11 are locked with the password excelpapa to disallow any accidental changes to the calculator.
  3. You should allow editing when opening the downloaded Excel file to make changes in it. Otherwise it will be in read-only mode.

Epilogue

You can contact us if you face any difficulty understanding how to solve cubic equation in Excel. You can read the article from Pearson to learn how we came up with the formulas. You can comment below, which will encourage me to create a similar useful calculator to solve cubic equation in Excel. Have a nice day, and thanks for reading. We wish you excel in your life!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *