Excel and VBA calculate the same formula differently
On Monday, April 10, 2017 at 2:04:17 PM UTC-4, Ottmar Brandau wrote:
I have a strange phenomenon. In Excel the following expression: LN(8/PI()^2*280/125) equates to 0.596458. In VBA the code: Log(8/(4*Atn(1))^2*280/125 comes out to 0.554588, a difference of over 7%. I makes no difference to replace (4*Atn(1)) with 3.14, the difference is basically the same and it screws up my calculation. BTW, Log in VBA is the same as LN in Excel. Does somebody have an idea why this is and how to correct it? Thanks. Ottmar
Thanks guys. After seeing this I found an error in one of the variable that was mis-spelled. All good now.
|