Excel ranges within a cell.

D

Danny

A2 is the numerical value < 13, or between 13 - 18, or > 18. What formula do
I use? I tried =IF(A2<=13,"A",IF(A2>13<18,"B", IF(A2>18,"C"))). The only part
of the formula that doesn't work is it middle portion - IF(A2>13<18,"B".
Whataya think? Thanks so much.
Danny
 
D

Dave Peterson

If A2 is numeric, you could use something like this:
=if(a2<=13,"A",if(a2<18,"B","C"))

I guessed that you wanted C if A2=18.

But just for learning the =and() function:
=if(a2<=13,"A",if(and(a2>13,a2<18),"B","C"))

But if excel has already determined that A2 is not less than or equal to 13 (the
first portion of your comparisons), then you don't have to check again.

But you do have to do the comparisons in a nice order:

=if(a2>13,"A",if(a2>18,"B","C"))

wouldn't work nicely (even though the formula is syntactically correct). 99 is
bigger than 13, so you'd see an A.
 

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