ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Incorrect logic evaluation (https://www.excelbanter.com/new-users-excel/195344-incorrect-logic-evaluation.html)

Terry Plampin

Incorrect logic evaluation
 
I have a worksheet that returns TRUE when comparing a blank or zero entry to
the criteria. Other worksheets in the same workbook return correctly FALSE
when the contents of the cell do not match the criteria exactly. How can I
fix this problem?
--
Terry Plampin

Bernard Liengme

Incorrect logic evaluation
 
You have bee sparse on details. Are you comparing numbers? Are you familiar
with round-off errors results from the decimal to binary conversion that all
computer apps must do?
If you want to compare a value in A1 with the number like 2.5 use
=ROUND(A1,12)=2.5, or if you are working with less precision
=ROUND(A1,6)=2.5
To see if two cells have the same value use =ABS(A1-A2)=<1E-12
which test to see if they differ by less than 1 over 1 billion
best wishes
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Terry Plampin" wrote in message
...
I have a worksheet that returns TRUE when comparing a blank or zero entry
to
the criteria. Other worksheets in the same workbook return correctly FALSE
when the contents of the cell do not match the criteria exactly. How can I
fix this problem?
--
Terry Plampin




Terry Plampin

Incorrect logic evaluation
 
I'll try to be more precise.
I am looking for a text string, for example =IF(A1="K",1,0). I expect, and
have recieved on other worksheets, FALSE, when anything, other than K,
including nothing and 0, is in the cell. The problem is that on this
particular worksheet, I get TRUE for the condition when the cell is empty or
contains a zero. This is messing up more complicated counting formulas I want
to use.
--
Terry Plampin


"Bernard Liengme" wrote:

You have bee sparse on details. Are you comparing numbers? Are you familiar
with round-off errors results from the decimal to binary conversion that all
computer apps must do?
If you want to compare a value in A1 with the number like 2.5 use
=ROUND(A1,12)=2.5, or if you are working with less precision
=ROUND(A1,6)=2.5
To see if two cells have the same value use =ABS(A1-A2)=<1E-12
which test to see if they differ by less than 1 over 1 billion
best wishes
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Terry Plampin" wrote in message
...
I have a worksheet that returns TRUE when comparing a blank or zero entry
to
the criteria. Other worksheets in the same workbook return correctly FALSE
when the contents of the cell do not match the criteria exactly. How can I
fix this problem?
--
Terry Plampin





Niek Otten

Incorrect logic evaluation
 
Hi Terry,

<for example =IF(A1="K",1,0)

Is this an example or is this your exact formula? Please supply your exact formula, not some mockup.

The formula you posted returns either 0 or 1, not TRUE or FALSE, as you suggest.

So what exactly are your formulas, argument values and results?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"Terry Plampin" wrote in message
...
| I'll try to be more precise.
| I am looking for a text string, for example =IF(A1="K",1,0). I expect, and
| have recieved on other worksheets, FALSE, when anything, other than K,
| including nothing and 0, is in the cell. The problem is that on this
| particular worksheet, I get TRUE for the condition when the cell is empty or
| contains a zero. This is messing up more complicated counting formulas I want
| to use.
| --
| Terry Plampin
|
|
| "Bernard Liengme" wrote:
|
| You have bee sparse on details. Are you comparing numbers? Are you familiar
| with round-off errors results from the decimal to binary conversion that all
| computer apps must do?
| If you want to compare a value in A1 with the number like 2.5 use
| =ROUND(A1,12)=2.5, or if you are working with less precision
| =ROUND(A1,6)=2.5
| To see if two cells have the same value use =ABS(A1-A2)=<1E-12
| which test to see if they differ by less than 1 over 1 billion
| best wishes
| Bernard V Liengme
| Microsoft Excel MVP
| http://people.stfx.ca/bliengme
| remove caps from email
|
| "Terry Plampin" wrote in message
| ...
| I have a worksheet that returns TRUE when comparing a blank or zero entry
| to
| the criteria. Other worksheets in the same workbook return correctly FALSE
| when the contents of the cell do not match the criteria exactly. How can I
| fix this problem?
| --
| Terry Plampin
|
|
|



Ron Rosenfeld

Incorrect logic evaluation
 
On Thu, 17 Jul 2008 12:49:29 -0700, Terry Plampin
wrote:

I'll try to be more precise.
I am looking for a text string, for example =IF(A1="K",1,0). I expect, and
have recieved on other worksheets, FALSE, when anything, other than K,
including nothing and 0, is in the cell. The problem is that on this
particular worksheet, I get TRUE for the condition when the cell is empty or
contains a zero. This is messing up more complicated counting formulas I want
to use.
--
Terry Plampin


You are terribly imprecise in what you write. Your formula cannot possibly
return FALSE, only 1 or 0. Also, you fail to mention what version of Excel you
are using, as that makes a difference as to whether you really mean "worksheet"
or "workbook".

But it may be that you have given us an incorrect formula, or that you meant 0
when your wrote FALSE.

It may be that you are using Excel 2007, or that you are using 2003 or earlier
and meant workbook instead of worksheet.

This is important in telling you how to fix things; but it is likely that you
have Transition Formula Evaluation selected. Exactly where to find this
depends on the version of Excel you are using.

If you indeed mean sheet instead of book, then select the office button in the
upper left hand corner; Excel Options at the bottom and go to the Advanced
option. Then scroll down to the bottom looking for Lotus compatibility
settings for this particular sheet.

It's in a different place if you are using 2003.
--ron


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

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