# How to Solve an Equation for X When Y is Given in Excel (2 Methods)

## Method 1 – Use of Solver Feature

Enable Solver Feature

• Go to theÂ FileÂ tab.

• SelectÂ Options.

• Click onÂ Add-insÂ and thenÂ Go.

• Check theÂ Solver Add-inÂ and clickÂ OK.

• Now, youâ€™ll find the Solver feature under theÂ DataÂ tab.

Solving the Equation

• Suppose we have the equation: (Y = 2X + 7), and the Y value is 5.

• In cell D5, enter the formula:
`=2*B5+7`

• Go to theÂ DataÂ tab and click onÂ Solver.

• In the Solver Parameters dialog, set the objective to cell \$D\$5 with a value of 5 (since Y = 5).
• Specify that cell \$B\$5 contains the X value.
• Uncheck Make Unconstrained Variables Non-Negative.
• ClickÂ Solve.

• A Solver Results dialog box will open like the image below.
• Click OK to Keep Solver Solution.

• The solved X value will appear in cell B5.

• You can repeat this process for different Y values.

## Method 2 – Manual Solution

Equation Setup

• In cell C6, enter the equation with the Y value inserted.

• Simplify the equation manually and enter the simplified version in cell C7.

Calculate X

• In cell C8, enter the formula:
`=(5-7)/2`
• Press Enter to calculate the X value.

## Things to Remember

• The Solver feature is quicker but automatic.
• Manual solving gives more flexibility but is time-consuming

## Related Articles

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

Get FREE Advanced Excel Exercises with Solutions!