Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Logical test in IF statement returning incorrect result

I am trying to create a simple IF statement in Excel 2007. The logical test
in this case is true but the function returns a false. Looking in the
solution, the calculation is incorrect. The specifics a

if(e3-e15=0,"",e3-e15) In my case the result is 0, so I should be seeing a
blank cell. What I get is (0.00000000023283064) so the cell shows a (0)
rather than being blank. If I enter the formula e3-e15, not in part of the
function, the answer is 0.0000000000000000, which is the correct solution.
The only reason I'm showing all the decimal places is because the incorrect
solution has the result so far to the right of the decimal and that is the
only way I discovered why the statement was not resulting in a blank cell.

Can anyone tell me why I might be seeing the incorrect result? By the way,
other IF statements that do not have a calculation in the logical test are
returning the correct results.

thank you


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Logical test in IF statement returning incorrect result

Here is an explanation of the problem:

http://www.cpearson.com/Excel/rounding.htm

The fix is to round your test, e3-e15=0, depending on how many digits of
precision you need.

=IF(ROUND(E3-E15,5)=0,"",E3-E15)



--
Biff
Microsoft Excel MVP


"Isabel" wrote in message
...
I am trying to create a simple IF statement in Excel 2007. The logical
test
in this case is true but the function returns a false. Looking in the
solution, the calculation is incorrect. The specifics a

if(e3-e15=0,"",e3-e15) In my case the result is 0, so I should be seeing
a
blank cell. What I get is (0.00000000023283064) so the cell shows a (0)
rather than being blank. If I enter the formula e3-e15, not in part of
the
function, the answer is 0.0000000000000000, which is the correct
solution.
The only reason I'm showing all the decimal places is because the
incorrect
solution has the result so far to the right of the decimal and that is the
only way I discovered why the statement was not resulting in a blank cell.

Can anyone tell me why I might be seeing the incorrect result? By the
way,
other IF statements that do not have a calculation in the logical test are
returning the correct results.

thank you




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Logical test in IF statement returning incorrect result

Thank you very much, T. Vlako, this does provide a work around to the
dilemma. I believe I understand the issue and why it showed up in this
instance and not when I used the function in other situations..

with regards,
Isabel

"T. Valko" wrote:

Here is an explanation of the problem:

http://www.cpearson.com/Excel/rounding.htm

The fix is to round your test, e3-e15=0, depending on how many digits of
precision you need.

=IF(ROUND(E3-E15,5)=0,"",E3-E15)



--
Biff
Microsoft Excel MVP


"Isabel" wrote in message
...
I am trying to create a simple IF statement in Excel 2007. The logical
test
in this case is true but the function returns a false. Looking in the
solution, the calculation is incorrect. The specifics a

if(e3-e15=0,"",e3-e15) In my case the result is 0, so I should be seeing
a
blank cell. What I get is (0.00000000023283064) so the cell shows a (0)
rather than being blank. If I enter the formula e3-e15, not in part of
the
function, the answer is 0.0000000000000000, which is the correct
solution.
The only reason I'm showing all the decimal places is because the
incorrect
solution has the result so far to the right of the decimal and that is the
only way I discovered why the statement was not resulting in a blank cell.

Can anyone tell me why I might be seeing the incorrect result? By the
way,
other IF statements that do not have a calculation in the logical test are
returning the correct results.

thank you





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Logical test in IF statement returning incorrect result

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Isabel" wrote in message
...
Thank you very much, T. Vlako, this does provide a work around to the
dilemma. I believe I understand the issue and why it showed up in this
instance and not when I used the function in other situations..

with regards,
Isabel

"T. Valko" wrote:

Here is an explanation of the problem:

http://www.cpearson.com/Excel/rounding.htm

The fix is to round your test, e3-e15=0, depending on how many digits of
precision you need.

=IF(ROUND(E3-E15,5)=0,"",E3-E15)



--
Biff
Microsoft Excel MVP


"Isabel" wrote in message
...
I am trying to create a simple IF statement in Excel 2007. The logical
test
in this case is true but the function returns a false. Looking in the
solution, the calculation is incorrect. The specifics a

if(e3-e15=0,"",e3-e15) In my case the result is 0, so I should be
seeing
a
blank cell. What I get is (0.00000000023283064) so the cell shows a
(0)
rather than being blank. If I enter the formula e3-e15, not in part of
the
function, the answer is 0.0000000000000000, which is the correct
solution.
The only reason I'm showing all the decimal places is because the
incorrect
solution has the result so far to the right of the decimal and that is
the
only way I discovered why the statement was not resulting in a blank
cell.

Can anyone tell me why I might be seeing the incorrect result? By the
way,
other IF statements that do not have a calculation in the logical test
are
returning the correct results.

thank you







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
Lookup returning incorrect result btrotter Excel Worksheet Functions 1 June 7th 07 03:17 PM
SUMPRODUCT returning incorrect result sahafi Excel Worksheet Functions 7 September 22nd 06 11:36 PM
IF function returning incorrect result Hillary E. Excel Worksheet Functions 2 August 22nd 06 05:43 PM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM
If statement where the logical test is a range that equals a word Steve o Excel Worksheet Functions 8 June 27th 05 02:43 PM


All times are GMT +1. The time now is 11:46 AM.

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

About Us

"It's about Microsoft Excel"