The Moodle grade book considers an empty grade as a grade that is missing from the grade book, not just an empty cell. It may be from an assignment submission which has not yet been graded or from a quiz which has not yet been attempted, etc.
Moodle has an option to Exclude Empty Grades within the gradebook.
When applied at the course level that has categories, categories totals without scores will not be counted in the course total.
When applied at the category level, activities without scores will not be counted in the category total.
The primary use of this function is to give an up-to-date earned points sum and course total at anytime throughout the semester.
When you use this option, you must manually enter a zero (0) score to include a missed grade item in the grade calculation. If you leave the field blank, the activity is considered to be ungraded and will not be counted. See Enter Grades and Feedback in the Gradebook for an easy way to enter zeros.
Applying the empty grades function in Moodle 3.2
Go to the course homepage.
Find the Administration block:
Click Gradebook Setup.
On the top line of ANY category (including the course level category):