Be the first user to complete this post

  • 0
Add to List

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

Description:

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.

Format:

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

In WorkSheet : LOG(number, [base])

Arguments:
  • 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)

Example:

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