Excel Quadratic Equation Solver: A Practical Guide

How-to basics · Updated November 21, 2026

Excel does not have a dedicated quadratic-equation solver button, but you can solve a quadratic directly with the quadratic formula. Enter the coefficients a, b, and c in cells, calculate the discriminant, then use two formulas to return both roots; for equations with no real roots, Excel can also represent the complex solutions.

What Excel can solve

A quadratic equation has the standard form ax² + bx + c = 0, where a, b, and c are numbers and a is not zero. Its solutions, or roots, are the values of x that make the left side equal zero. The quadratic formula works for every quadratic, including ones with two real roots, one repeated real root, or two complex roots.

Excel is useful here because it can calculate the same solution repeatedly from changing coefficients. You can make a small worksheet for one equation or build a table that solves many equations, with a separate row for each set of coefficients. The important distinction is that Excel supplies the arithmetic and spreadsheet tools; you choose the mathematical method and arrange the inputs.

The discriminant, b² − 4ac, tells you what kind of roots to expect:

  • If it is greater than zero, there are two distinct real roots.
  • If it equals zero, there is one repeated real root.
  • If it is less than zero, there are no real roots, but there are two complex roots.

Set up the coefficient cells

In a blank worksheet, enter the coefficient labels in A1:C1 and their values in A2:C2. Use A1 for a, B1 for b, and C1 for c. For example, to solve 2x² − 3x − 2 = 0, enter 2 in A2, −3 in B2, and −2 in C2. A separate cell for each coefficient makes it easy to change the equation without editing the formulas.

Put a label such as Discriminant in D1. With the coefficients a, b, and c in A2, B2, and C2 respectively, enter this formula in D2:

=B2^2-4*A2*C2

For the example, D2 returns 25. The caret means “raised to the power of,” so B2^2 squares the b coefficient. Excel follows the usual order of operations; the multiplication signs and parentheses in the root formulas make the intended calculation clear.

Calculate both real roots

Put Root 1 and Root 2 in E1 and F1. With a in A2, b in B2, c in C2, and the discriminant already calculated in D2, enter this in E2 for the root using the plus sign:

=(-B2+SQRT(D2))/(2*A2)

With the same cell layout, enter this in F2 for the root using the minus sign:

=(-B2-SQRT(D2))/(2*A2)

For 2x² − 3x − 2 = 0, the two results are 2 and −0.5. The calculation is (3 ± √25) ÷ 4, which gives (3 + 5) ÷ 4 = 2 and (3 − 5) ÷ 4 = −0.5. The order of the two roots is not important.

SQRT returns the nonnegative square root of a nonnegative number. If D2 is negative, these real-root formulas return a #NUM! error. That error does not mean the equation has no solutions; it means it has no real solutions, and the complex-root method below is needed if you want to display them.

Handle repeated and complex roots

When the discriminant is zero, both root formulas return the same value, −b ÷ 2a. For example, x² − 6x + 9 = 0 has a discriminant of zero and a repeated root of 3. It is mathematically one distinct solution counted twice, even though the worksheet shows the value in both root cells.

When the discriminant is negative, Excel’s COMPLEX function can display the roots in a + bi form. This function returns a text representation of a complex number, rather than a regular numeric value suitable for ordinary arithmetic. With a in A2, b in B2, c in C2, and the negative discriminant in D2, use this for the root with the positive imaginary part:

=COMPLEX(-B2/(2*A2),SQRT(-D2)/(2*A2),"i")

With the same cell layout, use this for the other root:

=COMPLEX(-B2/(2*A2),-SQRT(-D2)/(2*A2),"i")

For x² + 1 = 0, with 1, 0, and 1 in A2:C2, the results are 0+i and 0−i, which are usually written as i and −i. The two roots are conjugates: they have the same real part and opposite imaginary parts. Do not use the real-root formulas for this case, because SQRT of a negative real number is not returned as a real value.

Check the answers in the worksheet

A useful check is to substitute each calculated root back into ax² + bx + c. For the example 2x² − 3x − 2 = 0, substituting x = 2 gives 2(2²) − 3(2) − 2 = 8 − 6 − 2 = 0. Substituting x = −0.5 gives 2(0.25) + 1.5 − 2 = 0. Both roots satisfy the original equation.

For a quick visual check, use another cell to evaluate the original expression at a real root. With the coefficients in A2:C2 and a tested root in E2, enter:

=A2*E2^2+B2*E2+C2

The result should be zero, or very close to zero for calculations involving decimal coefficients. Excel stores numbers with finite precision, so a tiny result such as 0.0000000001 can be a rounding effect rather than a wrong root. Displaying more decimal places can help distinguish that from a substantial residual. A displayed value rounded to 0 does not necessarily mean the underlying cell value is exactly zero.

Use Goal Seek for a numerical alternative

Goal Seek can find a value of x that makes an expression equal zero, without entering the quadratic formula. It is a numerical tool: it changes one input cell until a formula cell reaches a target. It generally finds one solution at a time, and the starting value can affect which root it approaches.

  1. Enter a trial value for x in a cell, such as E2.
  2. In another cell, calculate ax² + bx + c using that x value. For example, with a, b, and c in A2:C2 and x in E2, put =A2*E2^2+B2*E2+C2 in F2.
  3. On Windows, choose Data > What-If Analysis > Goal Seek. Set the formula cell to F2, set the target value to 0, and change the variable cell E2.
  4. Choose a starting value for E2 and run Goal Seek. To look for a different root, try another starting value and run it again.

On Excel for Mac, Goal Seek is also available through Data > What-If Analysis > Goal Seek in current Microsoft 365 versions, though the ribbon layout can differ slightly by release. Excel for the web does not provide the same full desktop Goal Seek workflow; use the formulas there or open the workbook in the desktop application. Goal Seek is handy when the expression is part of a larger model, but for a simple quadratic the direct formulas are more transparent and return both roots at once.

Common errors and edge cases

  • a equals zero: The equation is no longer quadratic. The root formulas divide by 2a, so they cannot be used. If b is nonzero, solve the linear equation bx + c = 0, giving x = −c ÷ b. If both a and b are zero, the equation is either always true when c is also zero, or has no solution when c is nonzero.
  • Coefficients entered with the wrong sign: For 2x² − 3x − 2, enter −3 and −2, not 3 and 2. A sign error changes the equation and its roots.
  • Negative discriminant: A #NUM! from SQRT indicates that the real-root calculation cannot proceed. Check D2 and decide whether you need complex roots instead.
  • Text or blank inputs: Make sure the coefficient cells contain numbers. Labels, spaces, or imported numeric-looking text can lead to unexpected results or errors.
  • Rounding the inputs too early: Keep the original coefficient values when possible. Formatting a cell to show fewer decimal places changes its display, not its stored value; rounding a coefficient with a formula changes the value used in the calculation.

If you want a formula to handle the a = 0 case, you can make a separate status or linear-solution cell. With coefficients a, b, and c in A2:C2, this formula reports when the equation is not quadratic, returns the linear root when appropriate, and distinguishes an identity from an impossible constant equation:

=IF(A2<>0,"Quadratic: use the quadratic formula",IF(B2<>0,-C2/B2,IF(C2=0,"Any x is a solution","No solution")))

Formula method or a spreadsheet solver?

For a quadratic, the formula method is usually the clearest choice: it is fast, deterministic, and returns both roots in separate cells. It also makes the discriminant visible, which helps explain why a particular equation has two, one, or no real roots. A chart of y = ax² + bx + c can provide a useful picture: real roots are where the curve crosses or touches the x-axis, though a chart is not a precise substitute for calculating them.

Goal Seek is useful when x is embedded in a more complicated spreadsheet calculation and an algebraic formula is inconvenient. However, it is an iterative search rather than a proof that every root has been found. For broader optimization problems, Excel’s Solver add-in can vary one or more cells subject to constraints, but it may need to be enabled and configured, and it is more machinery than a basic quadratic requires.

Frequently Asked Questions

Does Excel have a built-in quadratic equation function?
There is no dedicated standard worksheet function that takes a, b, and c and returns both quadratic roots. Use cell formulas based on the quadratic formula, or use Goal Seek for a numerical root.

What if the discriminant is zero?
The equation has one repeated real root, −b ÷ 2a. The two standard root formulas return the same number, so you can keep both cells or show just one distinct answer.

Can Excel solve a quadratic with complex roots?
Yes. Use COMPLEX to display the real and imaginary parts after calculating them from the negative discriminant. The output is text, so treat it as a displayed answer rather than a normal numeric value for further calculations.

Why does my quadratic formula return #NUM!?
A common cause is a negative discriminant passed to SQRT. That means there are no real roots, not necessarily that there are no roots. Check the coefficients and use the complex-root formulas if complex answers are required.

Can Goal Seek find both roots?
Not in one run. It changes one input toward one target and typically returns one root. Run it again with a different starting value to search for another; the direct quadratic formulas are simpler when both roots are needed.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.