The idea in one line

A weighted average is the sum of (value × weight) divided by the sum of the weights. For courses, the weight is usually the credit hours; inside a course, it is the percentage each component is worth. The page on the weighted average calculator explains why a plain average of grades can mislead. Here we only build the spreadsheet version.

Set up the sheet

Put one item per row and one kind of data per column. A simple layout: column A for the course name, column B for the grade, column C for the weight. Put headings in row 1 and the data from row 2 down. Keep the grades as plain numbers, not text, and do not mix in totals or notes inside the range.

Worked example: GPA from credit hours

Here are five courses on the 4.0 scale, with grade points in column B and credit hours in column C (A=4.0, A-=3.7, B+=3.3, B=3.0, B-=2.7).

Spreadsheet layout for a GPA calculation
RowA: CourseB: Grade pointsC: Credit hoursGrade points × hours
2Calculus I3.3 (B+)43.3 × 4 = 13.2
3Intro Programming4.0 (A)34.0 × 3 = 12.0
4English Composition3.0 (B)33.0 × 3 = 9.0
5Chemistry2.7 (B-)42.7 × 4 = 10.8
6Art History3.7 (A-)23.7 × 2 = 7.4
Total1652.4

In any empty cell, type:

=SUMPRODUCT(B2:B6,C2:C6)/SUM(C2:C6)

SUMPRODUCT multiplies the two columns row by row and adds the results: 13.2 + 12.0 + 9.0 + 10.8 + 7.4 = 52.4. SUM(C2:C6) is 4 + 3 + 3 + 4 + 2 = 16. The result is 52.4 ÷ 16 = 3.275, which shows as 3.28 if you format the cell with two decimals. A plain average of the five grade points would be 16.7 ÷ 5 = 3.34, so the credit weighting matters. Schools differ in their letter-to-points tables, so use the one in your own catalog. The GPA guide covers that side.

Second example: weights in percent

Inside a course the weights are percentages. Here the weights are in column B and your scores in column C.

Spreadsheet layout for course components
RowA: ComponentB: Weight (%)C: Score (%)Weight × score
2Assignments25902,250
3Quizzes15801,200
4Midterm25701,750
5Final exam35852,975

The formula is =SUMPRODUCT(B2:B5,C2:C5)/SUM(B2:B5). The products add up to 2,250 + 1,200 + 1,750 + 2,975 = 8,175, and the weights add up to 100, so the course grade is 8,175 ÷ 100 = 81.75%. Because you divide by SUM of the weights, it does not matter whether you write the weights as 25 or as 0.25.

When some grades are not in yet

Suppose the final exam row is still empty. SUMPRODUCT treats the blank as zero, which would drag your result down. To see where you stand on the finished work only, divide by the weights of the rows that have a score:

=SUMPRODUCT(B2:B5,C2:C5)/SUMPRODUCT(B2:B5,--(C2:C5<>""))

With the final blank, the top part is 2,250 + 1,200 + 1,750 = 5,200 and the weights counted are 25 + 15 + 25 = 65, so the result is 5,200 ÷ 65 = 80%. To work out what you need on the final, see how course grade components add up.

Common mistakes

  • Numbers stored as text. SUMPRODUCT ignores text, so a grade pasted as text counts as zero without any warning. Left-aligned numbers are a hint; convert them to numbers.
  • Ranges of different sizes. B2:B6 with C2:C5 returns an error. Both ranges need the same number of rows.
  • Dividing by the row count. Divide by the sum of the weights, not by COUNT or by the number of courses.
  • Mixing scales. Do not put letter-grade points and percentages in the same column.
  • Copying with moving ranges. If you copy the formula to another cell, lock the ranges with dollar signs ($B$2:$B$6) so they do not shift.

Excel versus Google Sheets

Google Sheets works the same way: SUMPRODUCT and SUM exist there with identical arguments, so you can paste the formulas as they are. One difference to know: if your spreadsheet is set to a language or region that uses a comma as the decimal mark, it usually expects a semicolon between arguments. If a formula is rejected, try semicolons.

A spreadsheet is flexible, but it is easy to break a range by accident. The calculator stores your courses and handles credit weighting for you, and the calculator guide shows how. Whichever you use, check how your school rounds and which grade-point table it applies.

Key takeaways

  • Weighted average = SUMPRODUCT(grades, weights) ÷ SUM(weights), in Excel and Google Sheets alike.
  • In the example, 52.4 ÷ 16 = 3.275 (3.28), while the plain average would be 3.34.
  • Check for text-formatted numbers and for ranges of different sizes before trusting the result.