Solve a equation with x in the second power

sibbles

New Member
Joined
Jan 10, 2006
Messages
18
Hello

Need help solving x out of this kind of equation:

x^2*234+x*123+2345=0

Any idea if I can use a simple command in excel to solve this, have looked over the normal fx statements and can´t find any solvers.

Regards
Atli F.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
If you just want to use basic Excel functions without loops, your equation would look something like this :-
Code:
=(A4*A4)*234+(A4*123)+2345
where A4 is the cell ref that contains your original number
Goal Seek may also be useful but would need a loop in VBA. Something like
Code:
while range("B4")<>0
Range("B4").GoalSeek Goal:=0, ChangingCell:=Range("A4")
wend
But that could take some thime as it will loop until you get an answer of zero (which could take forever!)
 
Upvote 0
Thanks for the reply

If you just want to use basic Excel functions without loops, your equation would look something like this :-
Code:
=(A4*A4)*234+(A4*123)+2345

This isn´t the code I´m looking for since I´m looking for the value of A4 (don´t know it and want excel to calculate it for me)

I just installed solver add on but can´t for the life of me figure it out, any help on that and the equation would be great.

P.s. I´m hoping I don´t have to resolve to VB :biggrin:

Than
 
Upvote 0
This is a simple quadratic. A4 will have two solutions, which can be calculated as:
=(-123+SQRT((123)^2-(4*234*2345)))/(2*234)
and:
=(-123-SQRT((123)^2-(4*234*2345)))/(2*234)

Any quadratic of the form ax^2+bx+c=0 has the following two solutions:
=(-b+SQRT((b)^2-(4*a*c)))/(2*a)
and:
=(-b-SQRT((b)^2-(4*a*c)))/(2*a)

This is basic maths. If Excel returns an error, it is because the roots (ie, the solutions) are imaginary. Google "quadratic equation" for more info.
 
Upvote 0
Just tried it in Solver and it isn't working for me either - looks like it will have to be VBA and a long wait unless anyone else has any other ideas.....
 
Upvote 0
Import these two functions into your workbook:

Code:
Public Function QuadSolvePlus(a, b, c As Double)

QuadSolvePlus = (-b + Sqr(b ^ 2 - (4 * a * c))) / (2 * a)

End Function


Public Function QuadSolveMinus(a, b, c As Double)

QuadSolveMinus = (-b - Sqr(b ^ 2 - (4 * a * c))) / (2 * a)

End Function


You can now put the formula =QuadSolvePlus(A,B,C) into A4 and it will return x. Note two quirks of quadratic equations: first, many have non-real solutions (ie, contain a multiple of the square root of -1) and some have convergent roots (ie., QuadSolvePlus and QuadSolveMinus give the same solution for x.
 
Upvote 0
Loose Cannon's (first post) formulas should work but, if you are trying to solve different equations with different coefficients, the the coefficients would need to be in different cells and his(?) formulas would need a, b, and c replaced by cell references. Note, too that the last formula given by Loose Cannon I think should start =(-b-SQRT...

We can use Goal Seek, but note that only approximate solutions will be obtained and only 1 solution when there might actually be two. Let's take a simpler quadratic equation to start with. X^2 + x - 6 = 0 This has solutions of 2 and -3. To get Goal Seek to find a solution, put this formula in B1:
=A1^2+A1-6
Now go Tools|Goal Seek|Set Cell B1|To Value 0|By changing cell A1|Ok
An (approximate) solution to the equation should appear in cell A1.

Here is my result:
Mr Excel.xls
ABCD
121.5911E-05
2
Equation
 
Upvote 0
Thanks Loose Canon and Peter

I knew the abc formula for calculating out the formula, just wondering if excel has a simular functuion as my calculator (Casio fx9750 Plus) that solves the formula if you enter it in the same fashion as in my first post, guess I will have to make excel calculate the abc formula manually, as in your posts.

Thanks alot for those formulas, this forum is really a neccessity when using excel.

P.s. Will let you know my final formula and the result I will get from it

Regards
Atli F.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top