ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Value between 2 numbers (https://www.excelbanter.com/excel-discussion-misc-queries/30508-value-between-2-numbers.html)

olman

Value between 2 numbers
 
I want to compare a number in a cell to a min and max number. If it doesn't
fall between them it is bad if it does it is good.
Example: 2.5 is Min. 5 is Max.
Value is <2.5 or 5 is "Bad"
2.5 is "Good", 5 is "Good"
Any help is appreciated?

RagDyer

One way:

=IF(OR(A1<2.5,A15),"Bad","Good")

--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"olman" wrote in message
...
I want to compare a number in a cell to a min and max number. If it

doesn't
fall between them it is bad if it does it is good.
Example: 2.5 is Min. 5 is Max.
Value is <2.5 or 5 is "Bad"
2.5 is "Good", 5 is "Good"
Any help is appreciated?



David Biddulph

"olman" wrote in message
...
I want to compare a number in a cell to a min and max number. If it doesn't
fall between them it is bad if it does it is good.
Example: 2.5 is Min. 5 is Max.
Value is <2.5 or 5 is "Bad"
2.5 is "Good", 5 is "Good"
Any help is appreciated?


=IF(A1<2.5,"Bad",IF(A15,"Bad","Good"))
--
David Biddulph



olasa


For example, select cell C3 and write
=IF(AND(A1=2.5,A1<=5),"Good","Bad")
A1 contains the value you want to test.

Ola Sandström


=IF(AND(A1=B1,A1<=B2),"Good","Bad")
B1 is 2.5
B2 is 5.0


--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=378692


olman

Thank you both!

"David Biddulph" wrote:

"olman" wrote in message
...
I want to compare a number in a cell to a min and max number. If it doesn't
fall between them it is bad if it does it is good.
Example: 2.5 is Min. 5 is Max.
Value is <2.5 or 5 is "Bad"
2.5 is "Good", 5 is "Good"
Any help is appreciated?


=IF(A1<2.5,"Bad",IF(A15,"Bad","Good"))
--
David Biddulph





All times are GMT +1. The time now is 08:54 PM.

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