Re: It doesn't add up - It's driving me crazy

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Tom Ogilvy (twogilvy_at_msn.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 13:15:42 -0500

At least have the courtesy to read the link. don't jump to conclusions. It
says rounding and precision in Excel. It explains how floating point
numbers are stored/represented and this is the root of your problem.

Here are a bunch more on the same or similar subjects:

http://support.microsoft.com/default.aspx?scid=kb;en-us;42980
(Complete) Tutorial to Understand IEEE Floating-Point Errors

http://support.microsoft.com/default.aspx?scid=kb;en-us;48606
XL: Comparison of Values Does Not Return Correct Result

http://support.microsoft.com/default.aspx?scid=kb;en-us;78113
XL: Floating-Point Arithmetic May Give Inaccurate Results

http://support.microsoft.com/default.aspx?scid=kb;en-us;165373
Rounding Errors In Visual Basic For Applications

http://support.microsoft.com/default.aspx?scid=kb;en-us;69333
HOWTO: Work Around Floating-Point Accuracy/Comparison Problems

-- 
Regards,
Tom Ogilvy
"Francis Hayes (The Excel Addict)"
<TheExcelAddict@discussions.microsoft.com> wrote in message
news:04AB7974-9424-44A3-83D9-43610653A8DE@microsoft.com...
> Rounding was the first thing I checked.
>
> The point I am making is these are 5 one decimal values (not formula
> results) where, according to my macro, .2+.2+.2+.2+.2 equals 1 but
> .3+.2+.2+.2+.1 does not equal 1.
>
> It seems that if the values are sorted in descending order with .1 as the
> last value that's when I have the problem. If I sort these values in
> ascending order it works fine.
>
> Thanks,
> Francis
>
>
> "Tom Ogilvy" wrote:
>
> > http://www.cpearson.com/excel/rounding.htm
> > Rounding And Precision In Excel
> >
> > -- 
> > Regards,
> > Tom Ogilvy
> >
> > "Francis Hayes (The Excel Addict)"
> > <TheExcelAddict@discussions.microsoft.com> wrote in message
> > news:401452F3-C187-4377-BDFE-739CAE74A9E2@microsoft.com...
> > > I need someone to tell me why my macro can't add.
> > >
> > > Try this:
> > > Enter the following information in a blank workbook...
> > > A1 = .2
> > >
> > >
> > >
> > > -- 
> > > Have a great day,
> > > Francis Hayes (The Excel Addict)
> > >
> > > http://www.TheExcelAddict.com
> > > Helping Average Spread*** Users
> > > Become Local Spread*** Experts
> >
> >
> >

Quantcast