Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109987

Re: Excel and VBA calculate the same formula differently

From GS <gs@v.invalid>
Newsgroups microsoft.public.excel.programming
Subject Re: Excel and VBA calculate the same formula differently
Date 2017-04-10 14:17 -0400
Organization A noiseless patient Spider
Message-ID <ocgi2v$gd$1@dont-email.me> (permalink)
References <672d43ea-8a3c-425c-9ff3-62a0e58aeb87@googlegroups.com>

Show all headers | View raw


> 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

Not sure why you get diffs! I get  0.596457635847984  for both your formulas!

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Excel and VBA calculate the same formula differently Ottmar Brandau <apex@blowmolding.org> - 2017-04-10 11:04 -0700
  Re: Excel and VBA calculate the same formula differently GS <gs@v.invalid> - 2017-04-10 14:17 -0400
  Re: Excel and VBA calculate the same formula differently "Auric__" <not.my.real@email.address> - 2017-04-10 19:58 +0000
  Re: Excel and VBA calculate the same formula differently Ottmar Brandau <apex@blowmolding.org> - 2017-04-10 13:38 -0700
    Re: Excel and VBA calculate the same formula differently "Auric__" <not.my.real@email.address> - 2017-04-11 06:09 +0000
  Re: Excel and VBA calculate the same formula differently cacuoc334465c <cacu123oc365a@gmail.com> - 2017-04-12 02:35 +0100
  Re: Excel and VBA calculate the same formula differently cacuoc334465c <cacu123oc365a@gmail.com> - 2017-04-12 06:39 +0100
  Re: Excel and VBA calculate the same formula differently cacuoc334465c <cacu123oc365a@gmail.com> - 2017-04-12 14:10 +0100
  Re: Excel and VBA calculate the same formula differently hoclaixenang <hoclaixenang@gmail.com> - 2017-04-12 16:46 +0100
  Re: Excel and VBA calculate the same formula differently cacuoc334465c <cacu123oc365a@gmail.com> - 2017-04-12 16:10 +0100

csiph-web