Author Topic: VBA math help  (Read 7535 times)

0 Members and 1 Guest are viewing this topic.

sbattina

• Guest
VBA math help
« 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??

Battina

TR

• Guest
VBA math help
« Reply #1 on: February 18, 2004, 06:31:23 PM »
Try This:

Code: [Select]
`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.

Keith™

• Villiage Idiot
• Seagull
• Posts: 16899
• Superior Stupidity at its best
VBA math help
« Reply #2 on: February 18, 2004, 10:32:08 PM »
Tim is right ....
Code: [Select]
`y = log(x)'inversex = exp(y)`
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am

Find me on https://parler.com @kblackie

sbattina

• Guest
thanks!
« Reply #3 on: February 19, 2004, 03:52:37 AM »
Thanks guys,
I am going to try it
Battina

MalFarrelle

• Guest
Re: VBA math help
« Reply #4 on: June 14, 2012, 09:43:31 AM »
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))

Mark

• Custom Title
• Seagull
• Posts: 28762
Re: VBA math help
« Reply #5 on: June 14, 2012, 10:34:14 AM »
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!
TheSwamp.org  (serving the CAD community since 2003)