defining the zero's of function
I will make an assumption that you really meant:
a x^2 + bx + c = 0
rather than
a^x + x + c = 0
If you really meant the latter, then disregard.
You just need to implement the quadratic formula. Here is a quick
example - minimal error checking:
Handles a X^2 + bX + c = 0
Sub Quadratic()
Dim a As Double
Dim b As Double
Dim c As Double
Dim x As Double
Dim y As Double
a = 1 'coefficient of X^2 term
b = 0 'coefficient of X^1 term
c = -4 ' coeffient of X^0 term
x = b ^ 2
y = 4 * a * c
If (x - y) >= 0 Then
res1 = (-b + Sqr(x - y)) / (2 * a)
res2 = (-b - Sqr(x - y)) / (2 * a)
Else
res1 = "complex Number"
res2 = "complex Number"
End If
Debug.Print res1, res2
End Sub
Regards,
Tom Ogilvy
Quote:
>Hi everyone,
>I'm looking for the function in Excel (Visual Basic macro), with whom I can
>calculate the following function
>f(x) = a^x + x + c = 0
>I would like to calculte the value of x.
>regards,
>Vladimir