If you have not changed the grading system in your course, you already have a Formula Grade Item in your Gradebook for calculating the final score. You can find this in the column 'Final Calculated Grade.' If you want to use the final grade in your course, refer to How do I ensure the Final Calculated Grade is calculated correctly in a Formula Grading System? to learn how to set it up.
If you want to calculate a different grade using a formula in your Gradebook, you can create a Formula Grade Item as follows:
First, navigate to Grades > Manage Grades. Then, select New and click on Item. The following screen will appear; choose Formula.

- Enter a clear name for the Grade Item.
- Optional: Select a category to group this Grade Item with other Grade Items, or click New Category to add a new category.

- Enter the Maximum Points for this Grade Item, which is the highest score a student can achieve. Note that a Formula Grade Item is typically calculated based on multiple other Grade Items. You can adjust this value later if needed.
- Click on Edit Using the Formula Editor to set up the calculation for this Grade Item using the Formula Editor.

- Optional: Select the Can Exceed option if you want to allow more points to be awarded than the maximum number of points set for this item.
- Select the desired Grade Scheme.

- Note: Do NOT add a Rubric to a Formula Grade Item.
- Optional: Adjust the Display Options if needed by clicking on Show Display Options, and then in the 'Student view' or 'Managing view' (for instructors), check Override display options for this item.
- Finally, click Save and Close, and you're done.
On the Restrictions tab, you can specify whether, when, and under what conditions students can view a Grade Item.
How do I ensure that the Final Calculated Grade is calculated correctly in a Formula Grading System?
In a Formula Grading System, the final score is calculated using a Grade Item of the type Formula. If you have not changed the grading system via the Setup Wizard, this item is already present in the Gradebook as Final Calculated Grade, and you only need to adjust it.
Navigate to Grades > Manage Grades. Click the arrow next to the Grade Item 'Final Calculated Grade,' and then select Edit.


- Adjust the Maximum Points if necessary.
- Click on Edit Using the Formula Editor to configure the calculation of the final grade using the Formula Editor.
How Does the Formula Editor Work?
The Formula Editor is a tool within Grades that you can use to create formulas for Formula Grade Items or the Formula Grading System. This article explains how to use the Formula Editor.
Use the Formula Editor to define a formula that calculates the value of a grade item based on other grade items (e.g., calculating final grades). When creating a formula, you must specify which grade items to include and the relationships between them.
An example of a simple formula is one that calculates the sum of several grade items. A more complex formula could exclude the minimum or maximum value from a range of grade items.
The Formula Editor is available on the New Item page, Edit Item for Formula items, Edit Calculated Final Grade, Edit Adjusted Final Grade, and for the Formula Grading System.
Open the Formula Editor
- On the Manage Grades page, click on the name of the Formula Grade Item you want to edit.
- Click on Edit Using the Formula Editor.

Most important components of the Grades Formula Editor

1. Formula Area
The formula area displays the formula text. The equal sign (=) at the beginning of the formula cannot be removed. A cursor indicates your position within the formula. Click within the formula area to place the cursor at the desired location.
2. Cursor Placement
The cursor placement icons are used to move the cursor forward and backward in the formula. You can also move the cursor by clicking with your mouse on the desired location. There are four options:
- Move the cursor to the beginning of the formula.
- Move the cursor to the end of the formula.
- Move the cursor one element backward.
- Move the cursor one element forward.
3. Grade Item Parameters
Use the Grade Item drop-down list to view which grade items you can insert as parameters into your formula. You can insert grade items of the following types: Numeric, Pass/Fail, Selectbox, and Formula. Note: You cannot reference the Formula Grade Item you are defining (to avoid circular references or loops) or any final grade. Select the Grade Item you want to use in your formula.
Use the Grade Item Value drop-down list to select the values associated with the grade item you want to use in the formula. There are three options:
- Points Received: The grade the user achieved. For example, 7 (out of 10 points).
- Max Points: The maximum number of points available for the grade item. For example, 10 points.
- Percent: The percentage the student achieved. For example, 70%.
Select the Grade Item you want to use and click Insert to add the selected grade parameter into the formula.
- For the Weighted System, Category and Grade Item Weights are ignored in formula calculations.
- Dropped Grade Items and Bonus Grade Items are calculated in the same way as other grade items.
4. Functions
The Function drop-down list contains functions you can use in your calculation formula:
- MAX: Calculates the maximum (largest) value in a set of values.
- MIN: Calculates the minimum (smallest) value in a set of values.
- SUM: Calculates the sum (total) of a set of values.
- AVG: Calculates the average of a set of values by adding all the values and dividing by the total number of values.
-
IF: Works as a Boolean statement that returns the value set for true or false. You need to define the condition (Boolean statement), the true (then) value, and the false (else) value.
- Example: IF{( condition: assignment 1.Points Received > 7.5, true (then): 10, false (else): 0 )}
- If the points received for Assignment 1 are greater than 7.5, assign 10. Otherwise, assign 0.
- NOT: Works as a Boolean statement that returns the true value if the condition is false and the false value if the condition is true.
- You can nest functions within other functions.
- The Start, Next Term, and End options are used to define elements of a function:
- Start: Begins the function selected in the Function drop-down list with an opening bracket {.
- Next Term: Adds a comma to separate grade items or parts of a Boolean statement.
- End: Ends the function with a closing bracket }.
Adding a Function to a Formula
- Select a Function: Choose the desired function from the drop-down list.
- Click Start: Begin the function with an opening bracket {.
- Enter a Parameter: Add the first parameter or value for the function.
- Click Next Term: Add another parameter or define a condition using numeric keys and operators if needed.
- Click End: Finish adding parameters and conditions with a closing bracket }.
5. Numeric Keys and Operators
The right section of the Formula Editor contains various operators and a numeric keypad for constructing your formula. These operators are typically used with at least one Grade Item.
6. Backspace and Clear
- Backspace: Deletes the element to the left of the cursor.
- Clear: Deletes the entire formula.
7. Cancel
The Cancel button exits the Formula Editor without saving changes.
8. Insert
The Insert button validates the formula and applies it to the Grade Item or final grade you are working on.
- If the formula is invalid, an error message appears, and the cursor moves to the point in the formula where the error occurred.
- The error type is displayed in red above the formula.
9. Validate
The Validate option checks whether the formula adheres to the standard formula syntax:
- If the formula is valid, a confirmation message appears.
- If the formula is invalid, an error message is displayed, and the cursor moves to the point of the error. The error type is shown in red above the formula. See Possible Error Messages for a list of potential errors.
10. Preview
The Preview option allows you to verify how your formula calculates grades for the first ten users in the user list:
- Click Close when you are done reviewing the calculations.
- If your formula is invalid, you cannot view a preview of the grades.
Possible Error Messages
Below are some error messages you might encounter in the Formula Editor.
Error Message |
Description |
Example | Correction |
---|---|---|---|
Unexpected [token_type] Bijvoorbeeld, Unexpected operator |
The formula contains a function component in an unexpected location. | = 5=/1 = (5+1)2 |
Correct the formula= 5/1= (5+1)*2 |
Unbalanced parentheses | The formula contains an opening or closing bracket without a corresponding matching bracket. | = 5+1) | Remove bracket = 5+ 1 |
Missing end of function | The formula contains an unclosed function. | = SUM{[Item1.Points], [Item2.Points] | Close the function (add curly bracket, add the end.) SUM{[Item1.Points], [Item2.Points]} |
Unexpected function end | The formula contains a closing bracket for a function that does not correspond to any function. | = [Item1.Points]/2} | Remove curly bracket= [Item1.Points]/2 |
Invalid number of operator parameters | The formula contains an invalid number of operator parameters. | = [Item1.Points] + | Add parameters or remove operator= [Item1.Points] + [Item2.Points] |
Invalid number of function parameters | The formula contains an invalid number of function parameters. | = SUM{} = IF{[Item1.Points]2,5} |
Enter the correct number of parameters.For SUM, at least 3 For IF, exact 3 |
Numeric value expected | A Boolean statement or operator has been entered instead of a numeric value. | = IF{52,1 OR 1,4} = SUM{1 = 2,3,4} |
Correct parameters.= IF {BOOLEAN, TRUE, FALSE}= SUM {only numeric values...} |
Boolean value expected | A Boolean statement has not been entered for a condition. | = IF {MIN{4,5},100,0} = NOT{4} |
Fill in Boolean = IF {MIN{4,5} 5, 100, 0} |
Invalid terminal | The formula contains an improperly used terminal. | = [Item1.Points] + 3.2.5 | Remove the errors = [Item1.Points] + 3.2 |