View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ottmar Brandau Ottmar Brandau is offline
external usenet poster
 
Posts: 2
Default Excel and VBA calculate the same formula differently

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