Calculate Average from sum and also take into account when fields are blank.
Hello everyone,
I need help with an Adobe Form. I'm pretty new to Adobe, so please be kind.
I have created an Performance Evaluation Form for work, with different sections, each section has a total sum. Now I need to calculate an average rating of that total. (see below)

As you can see the calculation is not correct, 57/ 36 = 1.58 NOT 1.76!
Also, I need to account if we only have 33 fields filled instead of 36. So account for "0" or blank fields.
This is the code I got from someone. I'm not sure why is not working. (see below)
var pG = this.getField("SUPERVISOR PRIOR YR SKILLS GOAL #34").value;
var RT = this.getField("RATING TOTAL").value;
var fAR = ((RT/36));
var hAR = ((RT/33));
if (pG == 0) event.value=((hAR));
else event.value=((fAR));
If anyone could, please help!
