Forum Discussion
Cumulative Average of other percentages (non-contiguous range)
To calculate the cumulative average of semester grades in Excel for a non-contiguous range, while ensuring that only the non-zero semester averages are considered, you can use an array formula
Use the following formula to calculate the program cumulative average:
=SUM(H6,H54,H91,H128,H150)/COUNTIF(H6:H150,">0")
NOTE: Replace H6, H54, H91, H128, H150 with the exact cells in your table.
If you're using older versions of Excel, you may need to confirm the formula with CTRL+SHIFT+ENTER to make it an array formula. However, in most modern versions of Excel, this is not necessary.
Explanation:
This formula ensures: Only semesters with grades greater than 0 are included in the calculation. The average is adjusted dynamically as new semester grades are entered.
SUM(H6,H54,H91,H128,H150): Adds up the semester averages. Since the cells are non-contiguous, explicitly list them in the SUM function.
COUNTIF(H6:H150,">0"):Counts only the cells with values greater than 0, ensuring that semesters with a grade of 0 are excluded.
Division:Divides the total of non-zero semester averages by the count of those semesters, giving the real-time cumulative average.
I tried the formula you recommended, and it provides an incorrect answer because the COUNTIF part of the formula includes values in the range that is not supposed to be included. When I tried only selecting the non-contiguous cells, I get an error message of too many arguments .