How to Solve for x in Excel (2 Simple Ways)

The following dataset has 4 equations, each successively increasing the power of x. We’ll find the value of x in these equations.

how to solve for x in excel


Method 1 – Using Goal Seek to Solve for x in Excel

Step 1 – Formulate the Equation to find F(x) Value  

  • Enter the following formula in cell C5.
=(20*D5)-307

Here, cell D5 refers to the cell of the X Value column.

  • Press Enter.

Using Goal Seek Feature to Solve For x in Excel

Note: We will be using the cells in Column D as the initial x value. Since there are no values in those cells, the initial x values will be 0 for all the cases.

  • You will see the following output in cell C5.

Formulating the Equation to find F(x) Value in Excel

  • Now, enter the following formula in cell C6 to find the F(x) Value for the second equation.
=(D6^2)-(7*D6)+2

Cell D6 represents the cell of the X Value column.

  • Hit Enter.

You will get the F(x) Value for the second equation.

  • Insert the corresponding formulas to get the F(x) Values for the rest of the equations.

Step 2 – Apply Goal Seek

  • Go to the Data tab.
  • Select the What-If Analysis option.
  • Choose the Goal Seek option from the drop-down.

Using Goal Seek Feature to solve for x in excel

  • The Goal Seek dialog box will open as shown in the following image.

  • Click on the box of Set cell and select cell C5.
  • Enter 0 in the To Value box

  • Click on the By changing cell box and choose cell D5.
  • Click on OK.

The Goal Seek Status dialog will confirm that it has found a solution.

  • Click OK.

  • You will get the x Value for the first equation as demonstrated in the following picture.

  • Repeat the same procedure for the rest of the values ,and you will get the x Values for other equations.

final output of method 1 to solve for x in excel

Read More: How to Solve an Equation for X When Y is Given in Excel 


Method 2 – Applying the Solver Add-in to Solve for x in Excel

Step 1 – Enable the Solver Add-in

  • Use the keyboard shortcut Alt + F + T to open Excel Options.

Utilizing Solver Add-in to Solve For x in Excel

  • Go to the Add-ins tab.
  • Click on the Go option below the list.

Enabling the Solver Add-in to solve for x in excel

  • Check the Solver Add-in option.
  • Click OK.

  • Go to the Data tab, and you will see that the Solver option is added to the Analyze group.

Step 2 – Formulate the Equation to find the F(x) Value

  • Use the procedure in Step 1 of Method 1 to get the F(x) Values for the equations.

Step 3 – Utilizing the Solver Add-in Option

  • Go to the Data tab.
  • Choose the Analyze option.
  • Select the Solver option from the drop-down.

Utilizing the Solver Add-in Option  to solve for x in excel

  • The Solver Parameters dialog box will open on your worksheet as shown in the following picture.

  • Click the arrow on the Set Objective box.

  • Choose cell C5 under F(x) Value.

  • In the Solver Parameters dialog box, choose the Value Of option and enter 0 in the box to the right.
  • Click on the By Changing Variable Cells arrow:

  • Select cell D7 and click on the arrow in the box.

  • Click on Solve.

Excel will confirm that the solver has found a solution.

  • Click on OK from the Solver Results.

  • You will find the x Value for the first equation.

Note: Here, the F(x) Value in cell C5 represents that the value is close to 0.

  • Repeat the process to get the x Values for the remaining equations.

final output of method 2 to solve for x in excel

Read More: How to Solve 2 Equations with 2 Unknowns in Excel


Practice Section

In the Excel workbook, we have provided a Practice Section on the right side of the worksheet so you can test these methods.

practice section to solve for x in excel


Download the Practice Workbook


Related Articles


<< Go Back to Excel Solve Equation | Excel Solver Examples | Solver in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Zahid Hasan
Zahid Hasan

Zahid Hassan, BSc, Industrial and Production Engineering, Bangladesh University of Engineering and Technology, has worked with Exceldmy for 1.5 years. He has written 95+ articles for Exceldemy. He has worked as an Excel & VBA Content Developer. He also worked as a VBA Developer for the Template team. Currently, he is working as a Junior Software Developer for the Excel Add-in project. He is interested in Software Development, Python, VBA, VB.NET, and Data Science, expanding his expertise in... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo