How to Solve for X in Excel (Using Goal Seek & Solver Tools)

Sometimes, you need to find the missing piece in a calculation, like figuring out what value of x makes an equation true. Whether it’s a simple formula or a more complex expression, Excel can help you solve for x accurately. In this article, we will show you step-by-step how to solve for x using Goal Seek and Solver.

Key Takeaways

To solve for x in Excel using Goal Seek:

➤ Go to the Data tab, click What-If Analysis, and then select Goal Seek.
➤ From the Goal Seek dialog box, in the Set cell field, select cell (B2) containing your formula. Here, the cell holds the formula of your equation F(x) value.
➤ Enter the desired result (0) for your formula in the To value field, as it is our target value and we want that formula to equal.
➤ In the By changing cell field, enter the cell (C2) that holds the variable you want to adjust to reach your goal. Here, cell C2 contains the ‘x’ variable.
➤ Click OK, and Excel will find the value of x that makes the equation result equal to 0.

overview image

Download Practice Workbook
1

Using Goal Seek to Solve for X in an Equation

In this method, we will guide you through the process of using Goal Seek in Excel to solve various equations and find the value of ‘x’.

Suppose we have a list of equations in column A. For each equation, we will calculate an F(x) value in column B based on a hypothetical x value in column C. Our target is to use Goal Seek to determine the exact x value that makes the F(x) value for each equation equal to zero.

Using Goal Seek

Starting with, we will set up the formulas for our F(x) value.

➤ First, in cell B2, input the formula for the first equation and press ENTER.

=25*C2+12-137

Explanation
This formula rearranges the equation to equal zero: 25x+12−137=0. So, when Goal Seek finds the x value that makes this formula result in 0, it will be the solution to the original equation. Initially, with no value in cell C2, cell B2 will display -125.

Using Goal Seek

➤ Similarly, in cell B3, write down the formula for the second equation and hit ENTER.

=C3^3-125

Using Goal Seek

➤ Following the steps above, write down the corresponding formulas to get the F(x) values for the rest of the equations.

Using Goal Seek

To begin the Goal Seek process and find the x value for each equation.

➤ Click on the Data tab from the menu bar.
➤ In the Forecast group, click on What-If Analysis.
➤ From the dropdown menu, choose Goal Seek.

Using Goal Seek

The Goal Seek dialog box will appear. Here, we will define our objective, target value, and the cell to change.

For the first equation (25x + 12 = 137):

➤ In the Set cell field, enter B2, as this is the cell containing the formula for our F(x) value.
➤ In the To value field, enter 0, which is the desired result for the equation.
➤ In the By changing cell field, enter C2, as this is the cell where Goal Seek will find the x value.
➤ Click OK.

Using Goal Seek

As a result, Goal Seek will calculate the value in cell C2 that makes the formula in B2 result in 0.

➤ Repeat this Goal Seek procedure for each of the remaining equations (from B3 to B10).

Thus, column C will be populated with the x values that satisfy each equation, making their respective F(x) values in column B equal, or very close, to zero.

Using Goal Seek


2

Applying Solver Tool for Solving System of Equations

In this section, we will use Excel’s Solver to find the x value that solves a series of equations. While Goal Seek is excellent for single-variable problems, Solver provides a more robust approach. Solver is particularly useful when dealing with multiple variables or complex constraints, even for simple equations like these.

➤ Similar to the previous method, calculate the F(x) values for all the equations.

Applying Solver

➤ Click on the Data tab from the menu bar.
➤ In the Analyze group, click on Solver.

Applying Solver

The Solver Parameters dialog box will appear.

For the first equation (25x + 12 = 137):

➤ In the Set Objective field, enter B2, as this is the cell containing our formula.
➤ Choose the Value Of option and enter 0 in the adjacent field, as we want the rearranged equation to equal zero.
➤ In the By Changing Variable Cells field, enter C2, which is the cell Solver will adjust to find the solution.
➤ Finally, click Solve.

Applying Solver

Thus, Solver will find the x values for the equation, making the F(x) value close to 0.

Applying Solver

After running Solver for all equations, column C will be filled with the x values that make each F(x) value in column B equal, or very close, to zero, indicating that the equations have been solved.

Applying Solver


Frequently Asked Questions

Does Excel have a built-in algebra solver?

No, Excel is not a symbolic algebra tool like WolframAlpha or MATLAB. It works numerically. For exact symbolic solutions, you would need external tools.

Can Solver find x when there are constraints (e.g., x > 0)?

Yes, Solver is ideal for constrained problems. You can set constraints like x ≥ 0, x ≤ 100, etc., in the Solver settings.

Can I use Excel to solve for x in real-world problems like break-even analysis?

Absolutely! Many business problems (e.g., profit = cost, ROI = target) can be structured as equations in Excel. Use formulas + Goal Seek or Solver to find the input (x) that satisfies the target.


Concluding Words

Above, we have explored various methods for solving for x in Excel, including using Goal Seek and Solver. Using these tools, you can tackle a wide range of mathematical and real-world problems all within your spreadsheet. If you have any questions, feel free to leave them in the comments below.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply

Excel Insider
Logo