ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Intervals as logical statements (https://www.excelbanter.com/excel-worksheet-functions/52171-intervals-logical-statements.html)

xnadeau

Intervals as logical statements
 

I'm trying to get Excel to determine whether x<=y<=z is true or false,
but it always comes up false when written this way (even if x=1, y=2,
and z=3). I finally ended up with a formula that looked like this:
=if((and(a2<=b2,b2<=c2)),d2,b2). This worked, but there must be a
better way.


--
xnadeau
------------------------------------------------------------------------
xnadeau's Profile: http://www.excelforum.com/member.php...o&userid=28335
View this thread: http://www.excelforum.com/showthread...hreadid=479146


Bob Phillips

Intervals as logical statements
 
That is the syntax. What is wrong with conforming to the syntax?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"xnadeau" wrote in
message ...

I'm trying to get Excel to determine whether x<=y<=z is true or false,
but it always comes up false when written this way (even if x=1, y=2,
and z=3). I finally ended up with a formula that looked like this:
=if((and(a2<=b2,b2<=c2)),d2,b2). This worked, but there must be a
better way.


--
xnadeau
------------------------------------------------------------------------
xnadeau's Profile:

http://www.excelforum.com/member.php...o&userid=28335
View this thread: http://www.excelforum.com/showthread...hreadid=479146




MrShorty

Intervals as logical statements
 

How about the logical function =AND(A2<=B2,B2<=C2) and drop the IF
function completely?


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=479146


Bob Phillips

Intervals as logical statements
 
It gives a different result, TRUE or FALSE, not what is in B2 or D2

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MrShorty" wrote in
message ...

How about the logical function =AND(A2<=B2,B2<=C2) and drop the IF
function completely?


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile:

http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=479146





All times are GMT +1. The time now is 09:38 AM.

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