If, if, if with < & >

S

Steve

I need the results as either a 1, 2 or 3.
if the number is <200, I want a 1
If it's between 200 - 299, I want a 2, and if it's >300, I want a 3.
This formula partially works, but I think I have the <> worng.

=IF(N6<200,"1",IF(N6>199<300,"2", ("3")))

Much appreciated,

Steve
 
S

Sean Timmons

=IF(N6<200,1,if(N6<300,2,3))

This works because if the value is less than 200, the If stops looking after
the first criterion. No need to give a minimum value after that.
 
P

Peo Sjoblom

=IF(N6<200,1,IF(AND(N6>199,N6<300),2,3))

you might want something if N6 is blank, perhaps

=IF(N6="","",IF(N6<200,1,IF(AND(N6>199,N6<300),2,3)))

also if you want to extend this a bit more than skip the IF/AND function and
go for a VLOOKUP

3 criteria the IF function can handle well but if it gets to be more that
it's getting ugly plus once you get to 7
nested IFs it won't work and you have to find other ways around it

--


Regards,


Peo Sjoblom
 
N

Need Help on axis problem in a chart

Here is the solution, Try this

=IF(F17<200,"1",IF(F17>=300,"3","2"))
 
R

Rick Rothstein

This will do what you asked...

=1+(A1>200)+(A1>300)

although if A1 can be empty, then this...

=IF(A1="","",1+(A1>200)+(A1>300))

or if A1 can be empty or contain non-numerical values, then this...

=IF(ISNUMBER(A1),1+(A1>200)+(A1>300),"")
 
S

Steve

Thanks all. They worked great. And I could keep it simple, as 3 will be the
max that I need, and they'll never be blank.

Thanks again,


Steve
 
P

Peo Sjoblom

Why are you addressing me, I didn't ask the question?

--


Regards,


Peo Sjoblom

"Need Help on axis problem in a chart"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top