PC Review


Reply
Thread Tools Rate Thread

logical expression help please

 
 
KRK
Guest
Posts: n/a
 
      16th Mar 2009
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

 
Reply With Quote
 
 
 
 
KRK
Guest
Posts: n/a
 
      16th Mar 2009

"KRK" <(E-Mail Removed)> wrote in message
news:ONCF%(E-Mail Removed)...
> 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 (1>2>3) evaluates to TRUE, though it would seem to be
false.

K

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      16th Mar 2009
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" <(E-Mail Removed)> wrote in message
> news:ONCF%(E-Mail Removed)...
> > 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 (1>2>3) evaluates to TRUE, though it would seem to be
> false.
>
> K
>
>

 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      16th Mar 2009
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" <(E-Mail Removed)> wrote in message
> news:ONCF%(E-Mail Removed)...
> > 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 (1>2>3) evaluates to TRUE, though it would seem to be
> false.
>
> K
>
>

 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      17th Mar 2009
On Mar 16, 6:07*am, "KRK" <tre...@yeleek.nospam.freeserve.co.uk>
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 (1>2>3) 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)

 
Reply With Quote
 
KRK
Guest
Posts: n/a
 
      19th Mar 2009
Shane,

OK thanks but...In that case why does 1>2>3 return TRUE ?.

1>2 is FALSE,

giving FALSE>3

= TRUE ?????

why is FALSE>3 True ?

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

K


"Shane Devenshire" <(E-Mail Removed)> wrote in message
news:9F6C6B89-5CEB-4733-9FCA-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:ONCF%(E-Mail Removed)...
>> > 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 (1>2>3) evaluates to TRUE, though it would seem to
>> be
>> false.
>>
>> K
>>
>>


 
Reply With Quote
 
KRK
Guest
Posts: n/a
 
      19th Mar 2009
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" <(E-Mail Removed)> wrote in message
news:044f3b69-d4a1-4b5c-aa43-(E-Mail Removed)...
On Mar 16, 6:07 am, "KRK" <tre...@yeleek.nospam.freeserve.co.uk>
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 (1>2>3) 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)

 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      19th Mar 2009
On Mar 19, 4:45*am, "KRK" <tre...@yeleek.nospam.freeserve.co.uk>
wrote:
> why does 1>2>3 return TRUE ?.
> 1>2 is FALSE, giving FALSE>3
> = TRUE ?????
> why is FALSE>3 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.
--(A1>A2)), 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 TRUE>FALSE, FALSE<TRUE, TRUE=TRUE and
FALSE=FALSE are TRUE.

Apparently, we can only meaningfully compare logic values with other
logic values.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! - logical function for someone not very logical ECH123 Microsoft Excel Worksheet Functions 6 11th May 2009 04:14 PM
Help!!! - logical function for someone not very logical ECH123 Microsoft Excel Worksheet Functions 0 11th May 2009 10:22 AM
several logical partitions or several mounted logical partitions? =?Utf-8?B?MmRvZ3M=?= Windows XP General 6 4th Oct 2005 12:19 PM
several logical partitions or several mounted logical partitions =?Utf-8?B?MmRvZ3M=?= Windows XP Basics 6 3rd Oct 2005 11:35 PM
Help! Anyone! Please Please Please Please Please Please =?Utf-8?B?UmFuZHk=?= Microsoft Access Macros 2 17th May 2004 07:16 PM


Features
 

Advertising
 

Newsgroups
 


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