Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

Excel- VBA/Formula: Math Functions – LOG()


The LOG function in MS excel returns the logarithm of a number to the given base.

NOTE: LOG function takes different parameters when it is used in WorkSheet and used as a VBA function.


As VBA Function : LOG(number) , default base is e = 2.71828183

In WorkSheet : LOG(number, [base])


  • Number
    • Mandatory
    • Type: Number
    • Number for which logarithm needs to be calculated
  • base (Needed only when used as VBA function)
    • Optional
    • Type: Number
    • Input provided here is considered to be the base .
    • Default Value: 10 (Base 10 is default)


Function getLOG()

Dim number1

Dim number2

number1 = 20

number2 = 10

strResult = "The Log of " & number1 & " And " & number2 & " are " & Log(number1) & " and " & Log(number2) & " respectively"

MsgBox strResult

End Function
LOG() - Functions

LOG() – Functions

Using Log() as Excel Formula

LOG() Formula

LOG() Formula


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: