I need to structure a formula in Excel that will take numerical gradesfrom 90 to 100 =A.
From 80 to 89 = B, From 70 to 79 = C, from 60 to 69 = D and less than or = 59 = F.
I thought you could use an If Then / Else test.
I need to structure a formula in Excel that will take numerical gradesfrom 90 to 100 =A.
From 80 to 89 = B, From 70 to 79 = C, from 60 to 69 = D and less than or = 59 = F.
I thought you could use an If Then / Else test.
You can. Excel's IF() operates like C's (if this ? then this : otherwise this). Taking advantage of the left-to-right processing of the nested IFs:
=IF(D3 > 89, "A", IF(D3 > 79, "B", IF(D3 > 69, "C", IF(D3 > 59, "D", "F"))))
...replacing "D3" in this example with the cell address containing the numerical grade.
I found the error this afternoon.
Because the numercial grade was presented as a % grade I had to change my IF function value. For example, =IF(L3>=90,"A") became =IF(L3>=0.90,"A") once I did that the entire string worked just fine.
Roger that. Small thing: If you define your breakpoints as 89, 79, ..., as I have in my example, rather than 90, 80, etc., then your inequalities in the formula can be strict ">" rather than of the ">=" form.
Makes for a wee bit shorter code, but OTOH doesn't work if scores like 89.52 are possible (in which case ">= 90" is more foolproof than "> 89.99".
All times are GMT -7. The time now is 05:51 AM. |