On 2002-10-08 15:29, HAWA wrote:
Hello, My wife is a Teacher, and made a spreadsheet to keep track of her student's grades. She wants to have a cell (actually a column) that will give her a letter grade for each percentage. I was able to make it work for only one condition/percentage with this formula =IF(B2>90%,"A"), but it needs to do more. Basically, it needs to give an A if more than 90 percent, a B if more than 80 less than 90, and so on. Can this be done all in one cell? I think the cell needs to have 5 or six letter grades with matching percentages.
Thanks in advance for your help.
Sam
I just posted the following for another inquiry.
One solution is to just use a Lookup
edit one of the following
=LOOKUP(A3*100,{0,60,70,80,90;"F","D","C","B","A"}) or
=LOOKUP(A4,{0,0.6,0.7,0.8,0.9;"F","D","C","B","A"})
or
Function LetterGrade(NumberGrade As Double) As String
'ensure correct results are are thresholds
' may have to adjust ranges such as .9 to .929
Select Case NumberGrade
Case Is > 0.97: LetterGrade = "A+"
Case 0.93 To 0.97: LetterGrade = "A"
Case 0.9 To 0.93: LetterGrade = "A-"
Case 0.87 To 0.9: LetterGrade = "B+"
Case 0.83 To 0.87: LetterGrade = "B"
Case 0.8 To 0.83: LetterGrade = "B-"
Case 0.77 To 0.8: LetterGrade = "C+"
Case 0.73 To 0.77: LetterGrade = "C"
Case 0.7 To 0.73: LetterGrade = "C-"
Case 0.67 To 0.7: LetterGrade = "D+"
Case 0.63 To 0.67: LetterGrade = "D"
Case 0.6 To 0.63: LetterGrade = "D-"
Case Else: LetterGrade = "F"
End Select
End Function
This message was edited by Dave patton on 2002-10-08 15:47