Calculate Letter Grade Function using VBA: MS Excel

How to create letter grade function using VBA:

This function is to calculate a letter grade from the percent of the earned scores to the total possible scores. For instance, student A receives total score 85 out of 100. It would be 85% (85 /100 = 0.85 or 85%).  We can set a score range and letter grade as shown in the table below as:

Score Range Display grade Letter
0 – 59% or 0.0- 0.59 F
60%- 69% or 0.6- 0.69 D
70% – 79% or 0.7- 0.79 C
80%- 89% or 0.8-0.89 B
90%  or 0.9 up

VBA code:

calculate Grade letter function

How to Enter VBA code:

  1. On your Excel workbook, Open MS Visual Basic for Application (VBA) by press key Alt + F11
  2. Click on Insert menu on top
  3. Select Module
  4. Open Module and place the function code as shown above in the Module

 How to Use VBA code on the Excel sheet:

  1. Insert function to the cell you want to get a letter grade (L3 in this example)
  2. Select and put a cell that contains a percent score (76.33% on cell K3) inside a function
  3. Use Auto Fill to copy function to another cell down

get Grade letter function

Note:  You have to save file type as Excel Macro-Enabled Wordbook(.xlsm) or Excel 97-2003 Workbook (.xls) format in order to have a function working.

save-as

 Macro Setting:

Also in Excel 2010 version, you need to check on “Enable all macros” on Excel Options>Trust Center>Macro Setting to enable Macro or VBA function.

macro setting in Excel

Video Link:

This erectile drug is easy cheap viagra no prescription to swallow as it is a prescription only drug and has been used by the natives of the countries that it grows in for centuries to increase virility. It’s popularity has not decreased, but it’s often expensive and cialis 10mg generico not covered by some insurance plans. Eat healthy food which buy tadalafil from india includes fruit and vegetables. If you are at present being getting treatment for one of these situations, permit your health advisor make tadalafil sample out how it treats impotence.

Related posts