IF formula

New Contributor

I'm calculating school grades with IF formula which is getting right but stuck in one thing. If there is no percentage written in cell and instead "AB" is written, how does formula reads it and replies back with "AB".

3 Replies

@Amandeep_Singh Without seeing your formula, I suggest you wrap it in another IF that checks if the grade entered is a number. If so, then execute your formula. If not, then just take the grade as entered in text. 

 

=IF(ISNUMBER(grade),<your formula>, grade)

I got it right by this formula =IF(OR(Z5="ab",),"Ab",IF(Z5>=80,"A",IF(Z5>=60,"B",IF(Z5>=40,"C","D"))))
but now there's one more issue, if I enter nothing or leave it blank instead of AB then it gives me "D" grade as a result.

@Amandeep_Singh I take your word for it that the formula you described works. Now you need to wrap it in one more IF that checks if the cell is blank.

 

=IF(Z5="","",IF(OR(Z5="ab",),"Ab",IF(Z5>=80,"A",IF(Z5>=60,"B",IF(Z5>=40,"C","D")))))