-----Original Message-----
...
...
Yes, Y is known and I am trying to find X.
b is in the interval [-1,1]
Please provide both single cell solution and a multiple
one if possible.
A single cell result would require VBA. Simplistic example using binary search.
Function bs(f As String, yt As Double) As Variant
Const NMAX As Long = 100
Const YTOL As Double = 0.000000000001
Const XMAX As Double = 1000000000000#
Const LO As Long = 1, MP As Long = 2, HI As Long = 3
Dim x(LO To HI) As Double, y(LO To HI) As Double, n As Long
If Not f Like "*<>*" Then
bs = CVErr(xlErrRef)
ElseIf IsError(Evaluate(Application.Substitute(f, "<>", YTOL))) Then
bs = CVErr(xlErrValue)
Else
x(LO) = YTOL
y(LO) = Evaluate(Application.Substitute(f, "<>", x(LO)))
x(HI) = 1
y(HI) = Evaluate(Application.Substitute(f, "<>", x(HI)))
If yt > y(HI) Then
For n = 1 To NMAX
x(HI) = 2 * x(HI)
y(HI) = Evaluate(Application.Substitute(f, "<>", x(HI)))
If yt < y(HI) Or x(HI) > XMAX Then Exit For
Next n
End If
If yt < y(LO) Or yt > y(HI) Then
bs = CVErr(xlErrNum)
ElseIf Abs(y(LO) - yt) <= YTOL Then
bs = x(LO)
ElseIf Abs(y(HI) - yt) <= YTOL Then
bs = x(HI)
End If
End If
If Not IsEmpty(bs) Then Exit Function
x(MP) = (x(LO) + x(HI)) / 2
y(MP) = Evaluate(Application.Substitute(f, "<>", x(MP)))
Do While Abs(y(MP) - yt) > YTOL
If (y(MP) - yt) * (y(LO) - yt) > 0 Then
x(LO) = x(MP)
y(LO) = y(MP)
Else
x(HI) = x(MP)
y(HI) = y(MP)
End If
x(MP) = (x(LO) + x(HI)) / 2
y(MP) = Evaluate(Application.Substitute(f, "<>", x(MP)))
Loop
bs = x(MP)
End Function
With a, b and Y named ranges and given your functional form for Y as a function
of X, use the formula
=bs("=<>/(1+"&a&"*<>^"&b&")",Y)
to find the X value that gives the specified Y value. The first argument is a
string giving the functional form with <> denoting the independent (X) variable.
The multiple cell approach is basically the same thing. With the previous
assumptions as well as assuming A11:F1000 is empty and available for use, enter
the following.
A11:
1e-12
B11:
=(A11+C11)/2
C11:
1
D11:
=A11/(1+a*A11^b)-Y
and fill D11 right into E11:F11. Keep doubling C11 until E11 falls between D11
and F11. Then enter the following.
A12:
=IF(D11*E11>0,E11,D11)
B12:
=(A12+C12)/2
C12:
=IF(D11*E11>0,F11,E11)
and fill D11:F11 down into D12:F12. Now select A12:F12 and fill down until the
value in column E displays as 0 (zero). The corresponding column B value will be
your solution.