ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Returning true if a number fits between a range (https://www.excelbanter.com/excel-programming/318698-returning-true-if-number-fits-between-range.html)

David

Returning true if a number fits between a range
 
Hi,

I need 2 test whether a number fits between 2 numbers.
For example, if A1 contain 10, A2 contains 2, and A3 (my
test cell) contains 6 then the test displayed in A4 will
show True (or False). The values of A1-A3 will constantly
change.
Tried many ways to do this but can't figure out the logic.
Can someone help

Tony

Tom Ogilvy

Returning true if a number fits between a range
 
=And(Min(A1,A2)<A3,Max(A1,A2)A3)


if the number can equal either of the values then
=And(Min(A1,A2)<=A3,Max(A1,A2)=A3)

--
Regards,
Tom Ogilvy

"David" wrote in message
...
Hi,

I need 2 test whether a number fits between 2 numbers.
For example, if A1 contain 10, A2 contains 2, and A3 (my
test cell) contains 6 then the test displayed in A4 will
show True (or False). The values of A1-A3 will constantly
change.
Tried many ways to do this but can't figure out the logic.
Can someone help

Tony




Ben McBen[_2_]

Returning true if a number fits between a range
 
=AND(A3<A1,A3A2)

Ben McBen[_2_]

Returning true if a number fits between a range
 
Should have read (to be inclusive)

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


David

Returning true if a number fits between a range
 
Tom
First formula worked a treat
Many thanks

David

-----Original Message-----
=And(Min(A1,A2)<A3,Max(A1,A2)A3)


if the number can equal either of the values then
=And(Min(A1,A2)<=A3,Max(A1,A2)=A3)

--
Regards,
Tom Ogilvy

"David" wrote in

message
...
Hi,

I need 2 test whether a number fits between 2 numbers.
For example, if A1 contain 10, A2 contains 2, and A3 (my
test cell) contains 6 then the test displayed in A4 will
show True (or False). The values of A1-A3 will

constantly
change.
Tried many ways to do this but can't figure out the

logic.
Can someone help

Tony



.



All times are GMT +1. The time now is 02:45 PM.

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