This function calculates the natural log (base e) of the specified number. The value that is returned is of a type double. To see an example of how to calculate the log of a base 10 see the snippets section.
Sub Main
Dim MyNumber As Integer
MyNumber = 15
MsgBox Log(MyNumber)
End Sub
Comments
AGreenman
Wed, 11/27/2019 - 14:25
Permalink
Log with base other than e
Is it possible to perform Log() with a base other than e?
Brian Element
Wed, 01/01/2020 - 13:19
Permalink
Yes you can, I found this
Yes you can, I found this article that outline it - https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/log-function
So this would be a function to a log 10
Function log10(x)
log10 = Log(x) / Log(10)
End Function