 Ask Remember Me? donf Posts: 5,679, Reputation: 582 Printers & Electronics Expert #1 Jun 10, 2019, 06:16 PM
Convert numerical grade to letter grade in Excel
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. ArcSine Posts: 969, Reputation: 106 Senior Member #2 Jun 11, 2019, 12:53 PM
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. donf Posts: 5,679, Reputation: 582 Printers & Electronics Expert #3 Jun 11, 2019, 01:29 PM
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. ArcSine Posts: 969, Reputation: 106 Senior Member #4 Jun 12, 2019, 05:16 AM
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".

 Question Tools Search this Question Show Printable Version Email this Page Search this Question: Advanced Search