Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Accounting (https://www.askmehelpdesk.com/forumdisplay.php?f=19)
-   -   Convert numerical grade to letter grade in Excel (https://www.askmehelpdesk.com/showthread.php?t=845735)

  • Jun 10, 2019, 06:16 PM
    donf
    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.
  • Jun 11, 2019, 12:53 PM
    ArcSine
    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.
  • Jun 11, 2019, 01:29 PM
    donf
    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.
  • Jun 12, 2019, 05:16 AM
    ArcSine
    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.