Often you may want to calculate your GPA in Excel based on the grades you received in various classes and the number of credits that each class was worth.

For example, suppose you would like to calculate your GPA based on the following information:

Fortunately this is easy to do using the **SWITCH** and **SUMPRODUCT** functions in Excel and the following step-by-step example shows how to do so.

**Step 1: Enter Your Grades**

First, enter the grades you received along with the number of credits that each class was worth:

**Step 2: Calculate Points Received for Each Class**

Next, we need to assign the number of points received for each class based on the letter grade by using the following logic:

- A = 4 points
- B = 3 points
- C = 2 points
- D = 1 point
- F = 0 points

We can type the following formula into cell **D2** to do so:

**=SWITCH(B2, "A", 4, "B", 3, "C", 2, "D", 1, "F", 0)
**

We can then click and drag this formula down to each remaining cell in column D:

**Step 3: Calculate GPA**

Lastly, we can type the following formula into cell **B7** to calculate the overall GPA:

**=SUMPRODUCT(D2:D5, C2:C5)/SUM(C2:C5)
**

The following screenshot shows how to use this formula in practice:

The overall GPA for this particular student turns out to be **3.25**.

**Note**: In this particular example we calculated the GPA based on four different classes, but these same formulas will work with any number of classes you’d like to use.

**Additional Resources**

The following tutorials explain how to perform other common tasks in Excel:

Excel: Use SUMPRODUCT with Row and Column Criteria

Excel: How to Use SUMPRODUCT with Multiple Columns

Excel: Use SUMPRODUCT Only with Values Greater Than Zero