Yes. Excel can calculate the roots of a quadratic equation with the quadratic formula: enter the coefficients a, b, and c in A2, B2, and C2, then use one formula for each root. With a in A2, b in B2, and c in C2, the first root is =(-B2+SQRT(B2^2-4*A2*C2))/(2*A2). With the same cell layout, the second root is =(-B2-SQRT(B2^2-4*A2*C2))/(2*A2). These formulas return real roots when they exist; the sections below explain how to handle other cases and check the result.
What a quadratic equation means
A quadratic equation is an equation in which the highest power of the unknown is two. Its standard form has three coefficients: a multiplies the squared term, b multiplies the term to the first power, and c is the constant. The value of a must not be zero; if it is zero, the equation is linear rather than quadratic.
The quadratic formula gives the values of x that make the equation true. A quadratic can have two different real roots, one repeated real root, or no real roots. It can also have two complex roots, which include an imaginary component. Excel can evaluate the formula directly, but the ordinary SQRT function only returns real square roots, so a negative value under the square root needs separate treatment.
Excel does not have a built-in function named QUADRATIC or a dedicated quadratic-equation solver. The practical approach is to enter the formula as a worksheet formula, using cell references for the three coefficients. You do not need Solver for this calculation.
Set up the coefficient cells
Start with a small, clearly labeled input area. In a blank worksheet, enter the labels a, b, and c in A1:C1, then enter the corresponding coefficient values in A2:C2. For example, a value of 2 for a goes in A2, not in the label row. Keeping inputs together makes the formulas easy to read and lets you change the equation without rewriting them.
- A2: the coefficient of the squared term, a
- B2: the coefficient of the first-power term, b
- C2: the constant term, c
- D2 and E2: convenient output cells for the two roots
In Microsoft Excel for Microsoft 365 on Windows, select an output cell, type an equals sign and the formula, then press Enter. Excel recalculates the result when you change any coefficient. The same formulas work in Excel for Mac and Excel for the web; the ribbon and keyboard shortcuts can differ, but no special add-in is needed. In some regional settings Excel uses semicolons rather than commas between function arguments. The formulas here contain no function arguments separated by commas, so that setting does not affect them.
Enter formulas for both roots
The expression beneath the square root is called the discriminant. It determines the type of roots and appears in both root formulas. The plus and minus versions are both important: using only one gives only one of the possible answers.
With a in A2, b in B2, and c in C2, enter this formula in D2 to calculate the root that uses the plus sign:
=(-B2+SQRT(B2^2-4*A2*C2))/(2*A2)
With the same inputs, enter this formula in E2 to calculate the root that uses the minus sign:
=(-B2-SQRT(B2^2-4*A2*C2))/(2*A2)
Excel uses the caret symbol for exponentiation, so B2^2 means b squared. The parentheses matter: they keep the full numerator together and divide it by 2a. The multiplication symbols are explicit, which makes the formula easier to inspect and avoids relying on implicit multiplication that Excel does not support.
To reuse the calculation for another equation, replace the values in A2:C2. You can also copy the formulas down a table, provided each equation has its a, b, and c coefficients in the corresponding row. For instance, a second equation in A3:C3 needs formulas that refer to A3, B3, and C3.
Worked example: solve 2x² − 3x − 2 = 0
For this example, enter 2 in A2, −3 in B2, and −2 in C2. The discriminant is 25: the b-squared part is 9, and subtracting four times 2 times −2 adds 16. Its square root is 5, so the plus version gives (3 + 5) divided by 4, or 2. The minus version gives (3 − 5) divided by 4, or −0.5.
With those example coefficients in A2:C2, the formula in D2 returns 2. With the same cells and coefficients, the formula in E2 returns -0.5. Both results satisfy the original equation: putting 2 into it gives 8 − 6 − 2, which is zero; putting −0.5 into it gives 0.5 + 1.5 − 2, also zero.
This example also shows why both roots are useful. A quadratic curve can cross the x-axis at two places, and each crossing corresponds to a root. A result of zero or a very small value after substitution is a practical check that a calculated root is correct.
Use the discriminant to understand the result
It can be helpful to calculate the discriminant in its own cell rather than repeat the expression inside each root formula. With coefficients a, b, and c in A2:C2, enter this formula in F2:
=B2^2-4*A2*C2
A positive result means there are two distinct real roots. A result of zero means the two roots coincide, so both root formulas return the same value. A negative result means there are no real roots. In that case, Excel’s SQRT function returns the #NUM! error because it cannot take the real square root of a negative number.
A negative discriminant does not mean the equation has no solution at all; it means it has no real-number solution. The solutions are complex conjugates. Their real part is −b divided by 2a, and their imaginary parts have magnitude equal to the square root of the negative discriminant divided by 2 times the absolute value of a. If you only need real solutions, report that there are none rather than treating #NUM! as a valid root.
For a worksheet intended for other people, label the discriminant cell and add a note that the root formulas assume a nonnegative discriminant. That makes the limitation visible and helps prevent someone from interpreting an error as a calculation mistake.
Check inputs and avoid common errors
The most important input check is that a is not zero. If A2 is zero, both root formulas divide by zero, and the equation is not quadratic. Solve that resulting linear equation separately when b is nonzero; if both a and b are zero, the equation may have no solution or may be true for every x, depending on c.
Other common issues include:
- Missing parentheses: Put the complete numerator in parentheses before dividing by 2a. A misplaced parenthesis changes the order of operations and therefore changes the answer.
- Wrong coefficient signs: Enter negative coefficients with a minus sign in the cell. Do not change the signs again in the formula; the formula already accounts for them.
- Text stored as input: Coefficients should be numeric values. A number with an apostrophe before it, or other text in the coefficient cells, may cause an error or an unexpected result.
- One root only: The plus and minus formulas are separate. Copying the same formula into both output cells will not calculate both roots.
- Rounding too early: Keep full precision in the cells and use number formatting to show fewer decimal places. Rounding the coefficients or intermediate discriminant can alter a result, especially when the discriminant is close to zero.
If Excel displays a formula as text instead of calculating it, check that the cell is not formatted as Text. Change its number format to General, then re-enter the formula. Also confirm that the entry begins with an equals sign and that calculation is set to Automatic under Formulas > Calculation Options if results are not updating.
Verify roots and present the answer clearly
A useful independent check is to substitute each calculated root back into the original left side. With a, b, and c in A2:C2 and the first root in D2, enter this check formula in G2:
=A2*D2^2+B2*D2+C2
For the example, G2 returns 0. With the same coefficients and the second root in E2, place =A2*E2^2+B2*E2+C2 in another check cell; it also returns 0. For roots with decimal approximations, Excel may display a tiny residual instead of exactly zero because of floating-point precision. A value extremely close to zero is expected in that situation.
To make a reusable worksheet, format the coefficient and result cells consistently, label the outputs Root 1 and Root 2, and keep the discriminant visible if users need to distinguish real from non-real roots. Avoid rounding the actual formula results just to make the display shorter; adjust the displayed decimal places instead.
Quadratic formula versus Goal Seek and Solver
The direct formula is usually the best choice when the equation is a standard quadratic and you want both roots. It is quick, transparent, and recalculates immediately when coefficients change. Goal Seek is intended to adjust one input until a formula reaches a target value; it can find a root iteratively, but it generally finds one solution near its starting value and does not provide both roots as directly.
Solver is useful for more general optimization problems with constraints or many changing cells, not for a basic quadratic equation whose roots have a closed-form formula. A graph can help visualize where the curve crosses zero, but graphing alone may only provide approximate readings. For a quadratic, use the formula for exact-form calculation and a graph or substitution check when you want an additional way to understand or verify the result.
Frequently Asked Questions
Can Excel solve a quadratic equation automatically?
Excel does not offer a dedicated quadratic-solving command, but the two worksheet formulas above calculate both roots directly from the coefficients. For a standard quadratic, this is simpler than using Solver.
What if the quadratic formula returns #NUM! in Excel?
Check the discriminant. If it is negative, there are no real roots, and SQRT returns #NUM! for the negative value. If you expected real roots, also verify the coefficient signs and the cell references.
Can Excel show complex roots?
The standard formulas shown here calculate real roots only. When the discriminant is negative, the equation has a pair of complex conjugate roots. You can report their real and imaginary parts using the discriminant relationships described above, or use Excel’s complex-number functions for a more specialized worksheet.
Why do both answers sometimes match?
When the discriminant equals zero, its square root is zero, so the plus and minus versions produce the same repeated root. This is a legitimate result, not a duplicate-formula error.
Do I need Excel Solver or an add-in?
No. The formulas use basic cell references, arithmetic operators, and the built-in SQRT function, so no add-in is required. Solver may be appropriate for other optimization tasks, but it is unnecessary for this calculation.
Related
- Excel Slicer Formatting: Styles, Size, Layout, and Use
- Excel Slicers: What They Do and How to Use Them
- Excel Slicers: How to Create and Use Them
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Rank Low to High in Excel: Formulas, Sorting, and TipsYes. To assign ranks with the lowest value as rank 1, use Excel’s RANK.EQ function with its order…
- SUMIF Excel Sum Range: How It Works and ExamplesIn Excel, SUMIF adds values that meet a condition: its range argument is where Excel checks the condition,…
- Excel MAX of Filtered Data: Formula, Limits, and FixesIf your numbers are in B2:B100, use =SUBTOTAL(4,B2:B100) to return the largest value among rows currently shown by…
- Today’s Date in Excel: Number, Formula, and MeaningIn Microsoft Excel for Microsoft 365 on Windows, today’s date, November 3, 2026, is serial number 46329 in…
- Search Excel Cells for Specific Text: Methods and FormulasTo search Excel for specific text, press Ctrl+F on Windows (Command+F on Mac), type the text, and choose…
- How to Filter in Excel With Multiple CriteriaTo filter data by more than one condition in Excel, turn on filters for the full data range,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.