Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default logical expression help please

Hello,

What does the logical expression (A1<A2<A3<A4) return ?

How is the expression evaluated ?

I've tried various numbers in A1....A4, but cannot seem to make sense of
what the expression is doing ?


Thanks

KK

  #2   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default logical expression help please - for example ........


"KRK" wrote in message
...
Hello,

What does the logical expression (A1<A2<A3<A4) return ?

How is the expression evaluated ?

I've tried various numbers in A1....A4, but cannot seem to make sense of
what the expression is doing ?


Thanks

KK



For example, the expression (1<2<3) evaluates to FALSE (though it would
appear to be true, and (123) evaluates to TRUE, though it would seem to be
false.

K

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default logical expression help please - for example ........

You may be slightly backwards:
1<2<3
since clearly 2 is greater than 3 this is the same as:
1<1
which is false.

Since 1 cannot be less than either 0 or 1, this type of statement is ALWAYS
false.

--
Gary''s Student - gsnu200839


"KRK" wrote:


"KRK" wrote in message
...
Hello,

What does the logical expression (A1<A2<A3<A4) return ?

How is the expression evaluated ?

I've tried various numbers in A1....A4, but cannot seem to make sense of
what the expression is doing ?


Thanks

KK



For example, the expression (1<2<3) evaluates to FALSE (though it would
appear to be true, and (123) evaluates to TRUE, though it would seem to be
false.

K


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 857
Default logical expression help please - for example ........

Hi,

Here is what is going on:

Suppose =1<2<3 is your formula

Excel starts on the left and evaluates 1<2 which is TRUE, next it evalueates
TRUE<3 and returns FALSE. It never evaluates 2<3 in this example.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"KRK" wrote:


"KRK" wrote in message
...
Hello,

What does the logical expression (A1<A2<A3<A4) return ?

How is the expression evaluated ?

I've tried various numbers in A1....A4, but cannot seem to make sense of
what the expression is doing ?


Thanks

KK



For example, the expression (1<2<3) evaluates to FALSE (though it would
appear to be true, and (123) evaluates to TRUE, though it would seem to be
false.

K


  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,059
Default logical expression help please - for example ........

On Mar 16, 6:07*am, "KRK"
wrote:
What does the logical expression *(A1<A2<A3<A4) return ?

[....]
For example, the expression (1<2<3) evaluates to FALSE
(though it would appear to be true, and (123) evaluates
to TRUE, though it would seem to be false.


I suspect the logical expression you want is:

AND(A1<A2,A2<A3,A3<A4)

Alternatively:

(A1<A2)*(A2<A3)*(A3<A4)



  #6   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default logical expression help please - for example ........

Shane,

OK thanks but...In that case why does 123 return TRUE ?.

12 is FALSE,

giving FALSE3

= TRUE ?????

why is FALSE3 True ?

Sorry I must be daft I don't understand. What are the 'number values' of
TRUE and FALSE ??

K


"Shane Devenshire" wrote in message
...
Hi,

Here is what is going on:

Suppose =1<2<3 is your formula

Excel starts on the left and evaluates 1<2 which is TRUE, next it
evalueates
TRUE<3 and returns FALSE. It never evaluates 2<3 in this example.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"KRK" wrote:


"KRK" wrote in message
...
Hello,

What does the logical expression (A1<A2<A3<A4) return ?

How is the expression evaluated ?

I've tried various numbers in A1....A4, but cannot seem to make sense
of
what the expression is doing ?


Thanks

KK



For example, the expression (1<2<3) evaluates to FALSE (though it would
appear to be true, and (123) evaluates to TRUE, though it would seem to
be
false.

K



  #7   Report Post  
Posted to microsoft.public.excel.newusers
KRK KRK is offline
external usenet poster
 
Posts: 91
Default logical expression help please - for example ........

Hi, Thanks, yes I agree, that is where I started.

But I was surprised to find that the boolean (a1<a2<a3<a4) actually gives an
answer (rather than causing an error) and if I could understand how it
worked it might be a more elegant way of doing the job.

KK

"joeu2004" wrote in message
...
On Mar 16, 6:07 am, "KRK"
wrote:
What does the logical expression (A1<A2<A3<A4) return ?

[....]
For example, the expression (1<2<3) evaluates to FALSE
(though it would appear to be true, and (123) evaluates
to TRUE, though it would seem to be false.


I suspect the logical expression you want is:

AND(A1<A2,A2<A3,A3<A4)

Alternatively:

(A1<A2)*(A2<A3)*(A3<A4)

  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,059
Default logical expression help please - for example ........

On Mar 19, 4:45*am, "KRK"
wrote:
why does 123 return TRUE ?.
12 is FALSE, giving FALSE3
= TRUE ?????
why is FALSE3 True ?

Sorry I must be daft I don't understand. What are the
'number values' of TRUE and FALSE ??


If we convert the logic values TRUE and FALSE to numeric values (e.g.
--(A1A2)), we get 1 and 0 respectively.

But apparently, the reverse is not true. Try computing =(A1=FALSE)
and =(A1=TRUE), where A1 is any numeric or text value. The result is
always FALSE. And only TRUEFALSE, FALSE<TRUE, TRUE=TRUE and
FALSE=FALSE are TRUE.

Apparently, we can only meaningfully compare logic values with other
logic values.
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
value expression RayB Excel Worksheet Functions 7 January 17th 07 09:57 PM
need help with expression Peterpunkin Excel Discussion (Misc queries) 5 May 4th 06 05:56 PM
Expression gudway New Users to Excel 3 May 4th 06 01:12 PM
Can I use more complex logical expression for sumif as creteria? xwenx Excel Worksheet Functions 7 April 28th 06 12:53 AM
How do you determine if a field is blank in a logical expression. Van Excel Discussion (Misc queries) 2 December 5th 05 10:08 PM


All times are GMT +1. The time now is 04:49 PM.

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"