Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF just STOPS WORKING

Excel 2007 has different ways of guessing whether a difference is zero.
It's one of its known problems, and you'll see frequent reports in the
archives of this and other excel newsgroups.
--
David Biddulph

"Gee" wrote in message
...
OK, all that said and my subsequent confusion, I never had a problem with
this kind of thing in '03, only in '07 and I'm still working on another
problem with it but the 13 decimal places solved the Yes/No problem just
fine.
Thanks so much for your help.

....

"JoeU2004" wrote:

....
But using ROUND in comparisons with numbers with decimal fractions is
okay,
when done correctly. For example:

=if(and(400.5<=round(HI2,1),round(HI2,1)<402.5), "YES", "NO")

This is okay because ROUND ensures that the internal binary
representation
of its result exactly matches a constant with the same number of decimal
places. For example, if A1 is =10.1-10, =(A1=0.1) returns FALSE, but
=(round(A1,1)=0.1) returns TRUE. The reason is: the binary
representation
of 10.1-10 is not close enough to the binary representation of the
constant
0.1 for Excel to consider them equal.

In contrast, if A1 is =0.1+2^-56, =(A1=0.1) returns TRUE even though the
binary representations of A1 and 0.1 are not the same. Likewise, =A1-0.1
returns zero. But =(A1-0.1) returns non-zero, namely about 1.39E-17.
And
=IF(A1-0.1=0,TRUE) returns FALSE, which flies in the face of reason
considering the result of =A1-0.1, until we understand Excel's dubious
heuristic for determining "close enough".

....


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default IF just STOPS WORKING

"David Biddulph" <groups [at] biddulph.org.uk wrote:
Excel 2007 has different ways of guessing whether a
difference is zero. It's one of its known problems,
and you'll see frequent reports in the archives of
this and other excel newsgroups.


Oh? I do not remember seeing any threads where the root cause was found to
be a difference in the way that Excel 2007 interprets arithmetic results.
Can you point me to one, for my edification?

I do remember many threads related to some functions (XIRR, NPV, YIELD, even
EDATE!) returning errors reportedly in Excel 2007, but not in Excel 2003,
allegedly with no changes other than to open the workbook in Excel 2007. I
do not believe the root cause was ever agreed upon. For example, see
http://www.google.com/url?url=http:/...0NeOfRxIe2h2jg .

Is that you're thinking of?

I'm not trying to impugn your statement. I'm just very curious about this,
having spent a lot of time reverse-engineering the dubious heuristic as it
is implemented in Excel 2003.


----- original message -----

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Excel 2007 has different ways of guessing whether a difference is zero.
It's one of its known problems, and you'll see frequent reports in the
archives of this and other excel newsgroups.
--
David Biddulph

"Gee" wrote in message
...
OK, all that said and my subsequent confusion, I never had a problem with
this kind of thing in '03, only in '07 and I'm still working on another
problem with it but the 13 decimal places solved the Yes/No problem just
fine.
Thanks so much for your help.

...

"JoeU2004" wrote:

...
But using ROUND in comparisons with numbers with decimal fractions is
okay,
when done correctly. For example:

=if(and(400.5<=round(HI2,1),round(HI2,1)<402.5), "YES", "NO")

This is okay because ROUND ensures that the internal binary
representation
of its result exactly matches a constant with the same number of decimal
places. For example, if A1 is =10.1-10, =(A1=0.1) returns FALSE, but
=(round(A1,1)=0.1) returns TRUE. The reason is: the binary
representation
of 10.1-10 is not close enough to the binary representation of the
constant
0.1 for Excel to consider them equal.

In contrast, if A1 is =0.1+2^-56, =(A1=0.1) returns TRUE even though the
binary representations of A1 and 0.1 are not the same. Likewise,
=A1-0.1
returns zero. But =(A1-0.1) returns non-zero, namely about 1.39E-17.
And
=IF(A1-0.1=0,TRUE) returns FALSE, which flies in the face of reason
considering the result of =A1-0.1, until we understand Excel's dubious
heuristic for determining "close enough".

...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup stops working??? Steve Peel Excel Worksheet Functions 0 September 19th 08 07:08 PM
VLOOKUP stops working at row 13 Ann Scharpf Excel Worksheet Functions 4 August 23rd 07 03:45 PM
Autofilter Stops Working Vliegveld Excel Worksheet Functions 7 September 7th 05 01:19 AM
Validation List Stops working Brian Matlock Excel Discussion (Misc queries) 2 August 19th 05 08:07 PM
Hyperlink stops working Jami's Mom Excel Worksheet Functions 0 December 20th 04 05:17 PM


All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"