We use Adobe Acrobat Pro DC for a form that includes a custom calculation script to calculate averages with an if statement.
We have a section of our form that averages ratings for three area (numeric values). We need to adjust the average if one of the three ratings/areas is marked as zero for not applicable to only then average the other two ratings.
var A = this.getField("CoreValuesRating").value; var B = this.getField("InitiativeRating").value; var C = this.getField("JudgementRating").value; var D = ((A+B+C)/3); if(B=0) event.value=((A+C)/2); else event.value=D
This script works great when all three ratings are completed but is not working if the rating for B is entered as 0.
What am I missing in this script to run correctly?