Using the IF function

  • Thread starter icc56 via OfficeKB.com
  • Start date
I

icc56 via OfficeKB.com

Why does this forumla not work? =IF(J2=N14:N26,"A",IF(J2=N27:N40,"B",IF
(J2=N41:N52,"C")))
 
B

bj

It needs ot be entered as an array formula, but you also need to tell it
whether you want the J2= to be an "Or" or an "and"
in other words do you want it to have to equal any of the cells or all of
the cells.
if or use
=IF(or(J2=N14:N26),"A",IF(or(J2=N27:N40),"B",IF(or(J2=N41:N52),"C")))
and enter as an array control-shift-enter
for and just repace the ors with ands
 
I

icc56 via OfficeKB.com

Thank you so much. It still doesn't work for me. I've even changed to =IF
(OR(J2=45-57),"A",IF(OR(J2=31-44),"B",IF(OR(J2=19-30),"C"))) and it still
doesn't work. I want the cell to read "A" if the J2 totals 45-57, etc.
 
B

bj

If I am reading this correctly you want The cell to ="A" if J2 is between 45
and 57
try
=if(J2>57,"",if(J2>44,"A",if(J2>30,"B",if(J2>18,"C"))))
o
if(And(J2<=57,J2>=45),"A",if(and(J2<=44,J2>=31),"B",if(and(J2<=30,J2>=19),"C","")))
 
Top