+ Reply to Thread
Results 1 to 11 of 11

Grade entry

Hybrid View

  1. #1
    Registered User
    Join Date
    02-18-2007
    Posts
    69

    Grade entry

    i cannot get a simple formula to work and would appreciate any help

    i would like a column that tabulates my grades

    eg. if column 1 is >=95 column 2 will read A+
    if column 1 is >=90 and <95 column 2 will show A

    and so on....(I should be able to get the rest once i get this info)

    thanks for any help
    MBS

  2. #2
    Registered User
    Join Date
    09-03-2003
    Location
    UK
    Posts
    95
    Hi MBS,

    You could set up a table with the marks in one column (0-100) and place the grade alongside each value. You can then use vlookup() to interrogate the table and return the appropriate grade.

    Stu

  3. #3
    Registered User
    Join Date
    02-18-2007
    Posts
    69

    that seems to work fine with integers

    however i have a problem when I have grades that are decimal values.

    Is there not a way to enter this as a formula? without having to set up a new column. ...using 'IF'???

  4. #4
    Registered User
    Join Date
    09-03-2003
    Location
    UK
    Posts
    95
    Yes, you can nest up to 7 "if's". So provided your grade range does not exceed 7, it can be done. If you're not sure how, give me the ranges and I'll review.

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    if you used vlookup such as

    =vlookup(a1,b2:c100,2,true)

    that should find the closest value

  6. #6
    Registered User
    Join Date
    09-03-2003
    Location
    UK
    Posts
    95
    Thanks Dave, I missed the blindingly obvious!!

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Mr Big Shot,

    Given the limitations you have run into, I feel your best solution is a UDF (User Defined Function). This will return a letter grade for a any cell with a decimal value. You will need to copy this code, insert a Standard VBA Module, and paste the code into. You can then use this macro just like a standard Excel formula.

    Public Function LetterGrade(Number_Grade) As String
    
      Application.Volatile
      
      Dim L As String
      Dim N As Single
    
        N = CSng(Number_Grade)
    
        If N >= 95 Then L = "A+": GoTo Finish
        If N >= 90 And N < 95 Then L = "A": GoTo Finish
        If N >= 85 And N < 90 Then L = "B+": GoTo Finish
        If N >= 80 And N < 85 Then L = "B": GoTo Finish
        If N >= 75 And N < 80 Then L = "C+": GoTo Finish
        If N >= 70 And N < 75 Then L = "C": GoTo Finish
        If N >= 65 And N < 70 Then L = "D+": GoTo Finish
        If N >= 60 And N < 65 Then L = "D": GoTo Finish
        If N < 60 Then L = "F"
        
    Finish:
       LetterGrade = L
    
    End Function
    Example of use:

    Say cell A1 = "77.255"
    Cell B1 formula is: =LetterGrade(A1)
    The result in B1 will C+

    Sincerely,
    Leith Ross

  8. #8
    Registered User
    Join Date
    02-18-2007
    Posts
    69

    thanks for the replies....

    the ranges would be as follows

    A= >=85-100%
    B= >=75- <85
    C= >=65- <75
    D= >=55- <65
    F= <55

  9. #9
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    For that, couldn't you simply use the formula:

    =LOOKUP(A1,{0,55,65,75,85},{"F","D","C","B","A"})

    Where A1 (or any other cell) contains the grade (with or without decimals)?

    If A1 were 54.999, you would see F. If it were 77.22, you would see B.

    You can adjust the two lookup/result arrays to fit your data (if you have A+, A, A-, B+, etc..)

  10. #10
    Registered User
    Join Date
    09-03-2003
    Location
    UK
    Posts
    95
    Hi MBS,

    The formula would look like this:
    =IF(A3>=85%,"A",IF(A3>=75%,"B",IF(A3>=65%,"C",IF(A3>=55%,"D","F"))))
    assuming the percentage is in cell A3.

    Stu

  11. #11
    Registered User
    Join Date
    02-18-2007
    Posts
    69

    perfect

    good stuff.

    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1