How to calculate weighted grades in Excel

A weighted grade is the sum of each score times its weight, divided by the sum of the weights. It is not the ordinary average.

The workbook that holds a class of these rows is the teacher gradebook.

84, not 85

SUMPRODUCT multiplies the pairs and adds them. SUM of the weights is the divisor.

SUMPRODUCT
=SUMPRODUCT(B2:B3,C2:C3)/SUM(C2:C3)
=SUMPRODUCT(B2:B3,C2:C3)/SUM(C2:C3)B4
Forty points and sixty points
ABC
1PartScoreWeight
2Exam9040
3Homework8060
4Weighted84
A picture of the weighted-average page. 90 times 40 is 3,600. 80 times 60 is 4,800. The sum is 8,400. Divided by 100 the grade is 84. AVERAGE of 90 and 80 is 85.

90 × 40 = 3,600. 80 × 60 = 4,800. 3,600 + 4,800 = 8,400. 8,400 / 100 = 84.

AVERAGE ignores the weight column.

AVERAGE
=AVERAGE(B2:B3)
=AVERAGE(B2:B3)B4
The same scores, unweighted
ABC
1PartScoreWeight
2Exam9040
3Homework8060
4Average85
A picture of AVERAGE on the two scores. (90 + 80) / 2 is 85. The weights are sitting in column C and this formula never reads them.

(90 + 80) / 2 = 85. That 85 is the wrong grade for this course. The homework is worth more than the exam, and the average treats them as the same size.

Weights of 0.40 and 0.60 return the same 84, because 36 + 48 = 84 and the weights sum to 1. The divisor is whatever the weights actually sum to. Weights of 40 and 50 sum to 90. 90 × 40 + 80 × 50 = 7,600, and 7,600 / 90 is 84.444…, which a two-decimal format shows as 84.44. Dividing that 7,600 by 100 instead would show 76, which is a different course.

A weight total of 0 makes the division #DIV/0!. xl.weighted.average returns #N/A in that case, so a blank weight does not look like a real zero average. The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA. The SUMPRODUCT form above does not need it.

The letter

LOOKUP finds the last band that is less than or equal to the score. The first column has to stay sorted ascending. LOOKUP will not tell you if it is not.

LOOKUP
=LOOKUP(D2,A2:A6,B2:B6)
=LOOKUP(D2,A2:A6,B2:B6)D3
84 is a B
ABCD
1At leastLetterScore
20F84
360DB
470C
580B
690A
A picture of LOOKUP. The first column is sorted ascending. 84 is at least 80 and under 90, so the letter is B. A score under 0 is #N/A, because it is below the first band.

84 is past 80 and not yet 90, so the letter is B. 86 is also B on this table. That is the same letter the IFS page returns for 86, from bands that run 90, 80, 70, and 60. The 0 band is here so a score under 60 is F instead of #N/A. A score under 0 is still #N/A, because nothing in the list is that small.

Put 90 at the top of an unsorted list and LOOKUP can return the wrong letter with no error. Sort the bands, or use XLOOKUP with an exact match on a letter you have already decided.


Template for this article

Teacher Gradebook

More from the blog