IF with OR Question

C

carl

I am trying to write a formula that will look at a value and if that value is
between 0 and 150 return "OK", if between 151 and 300. return "Check", or if
between 301 and 500 return "Under"

Thank you in advance.
 
D

Duke Carey

No bounds checking to handle cases where the value is less than 0 or greater
than 500, but, assuming the value is in A1, try

=LOOKUP(1+INT(A1/150),{1,2,3;"OK","Check","Under"})
 
B

bpeltzer

=if(and(a1>=0,a1<=150),"OK",if(and(a1>150,a1<=300),"Check",if(and(a1>300,a1<=500),"Under")))
This doesn't account for anything <0, or >500 (it returns 'False'). If this
gets more involved, you might consider using a vlookup with a table that
indicates each range and its treatment.
--Bruce
 
M

Max

One way .. try in say, B1:

=IF(A1="","",IF(AND(A1>=0,A1<=150),"OK",
IF(AND(A1>=151,A1<=300),"Check",
IF(AND(A1>=301,A1<=500),"Under","")))
 
Top