TheSwamp
Code Red => VB(A) => Topic started by: sbattina on February 18, 2004, 03:26:53 PM
-
Hi guys:
Its crazy.. but I need a function in VBA that does:
inverse log (x) .
Is it possible? What are my options?
Can someone help me with this??
:shock:
Battina
-
Try This:
Private Function Test(Number As Double) As Double
Test = Log(Exp(Number))
End Function
I don't have VBA installed so I'm not 100% sure that'll work. However in VBA you can use the Log() and Exp() functions for what you're trying to do.
-
Tim is right ....
y = log(x)
'inverse
x = exp(y)
-
Thanks guys,
I am going to try it
Battina
-
I know this is a very old thread but I happened on it wanting to find the answer (VBA inverse log of x) and Google seems quite confident this thread answers the question. Others probably will find themselves here so I am taking the liberty of providing the proper conclusion for those yet to come this way . . .
The earlier answer neglects the important fact that the VBA logarithmic functions yield Natural (Naperian) logs. To calculate Common Logs and Inverse Common Logs use the following:
CommonLogx = Log(x) / Log(10)
InverseCommonLogX = Exp(x * Log(10))
-
I know this is a very old thread but I happened on it wanting to find the answer (VBA inverse log of x) and Google seems quite confident this thread answers the question. Others probably will find themselves here so I am taking the liberty of providing the proper conclusion for those yet to come this way . . .
Thank you very much! :)