Forum Discussion

rawlc's avatar
rawlc
Copper Contributor
May 18, 2021
Solved

In VBA how a create a 'log' calculation?

Hi, so I want to create a function in excel VBA that is it: '= 1.16650 - 0.07063 log (CX + SI+ SB)'   But I don't know how to make 'log' work, because I can't simply digit 'log', it will not allow,...
  • HansVogelaar's avatar
    HansVogelaar
    May 18, 2021

    rawlc 

    Keep in mind that the Log function in VBA is the natural logarithm (base e = 2.7172...). It corresponds to the worksheet function LN, not to the worksheet function LOG (base 10).

    If you need to use the 10-based logarithm, use

     

    ... = 1.1665 - 0.07063 * Log(CX + SI + SB) / Log(10)

Resources