If statements

  • Thread starter Thread starter Mark.M.Sweeney
  • Start date Start date
M

Mark.M.Sweeney

I want an IF statement that would be able to do the following:

IF cell A6 is between 1 and 4 then put "A" in cell A7
IF cell A6 is between 5 and 8 then put "B" in cell A7
IF cell A6 is between 9 and 12 then put "C" in cell A7
IF cell A6 is between 13 and 16 then put "D" in cell A7
IF cell A6 is between 17 and 20 then put "E" in cell A7


Any idea how I could do this?

Thank you in advance, Mark
 
I assume you mean 1 and 4, not between 1 and 4

=LOOKUP(A6,{1,5,9,13,17,21},{"A","B","C","D","E","over20"})


Gord Dibben MS Excel MVP
 
One way
=CHAR(LOOKUP(D55,{1,5,9,13,17},{65,66,67,68,69}))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software








- Show quoted text -

Thank you, I put it together without the =CHAR part and it worked
fine. I don't know what the =CHAR part does, would it help?
 
char(65) is a capital A
Look in the help index for CHAR

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
One way
=CHAR(LOOKUP(D55,{1,5,9,13,17},{65,66,67,68,69}))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software








- Show quoted text -

Thank you, I put it together without the =CHAR part and it worked
fine. I don't know what the =CHAR part does, would it help?
 
Depending on if A6 always has a number in it and how high you wanted that
number to be able to go (you can control these with an IF function call if
necessary)...

=CHAR(65+INT((A6-1)/4))

Rick
 
I'm no expert like some of these other guys but this is what I would do. I
don't know what you want in A7 if A6 is blank or = 0, or if it is greater
than 20, but this formula placed in cell A7 would accomplish what you want:

=IF(A6<1,"",IF(A6<=4,"A",IF(A6<=8,"B",IF(A6<=12,"C",IF(A6<=16,"D",IF(A6<=20,"E",""))))))
 
Back
Top