ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Logical test in IF statement returning incorrect result (https://www.excelbanter.com/excel-worksheet-functions/169449-logical-test-if-statement-returning-incorrect-result.html)

IsaBeL

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



T. Valko

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





IsaBeL

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






T. Valko

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









All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com