Answered
Hello,
I could really use some help with a formula. I'm assuming that it would go in the custom calculation script box. I would like the box to be the average of 3 other boxes only if box #1 is more than zero. Otherwise I would like it to average box #2 & #3 and ignore box #1. Thank you for any assistance you can provide! Sincerely, Todd
Since you are using Acrobat Professional for Windows, you have 2 programs within that product that you can create forms with, Acrobat and LiveCycle Designer. Both of these products use different languages or script syntax, so it is important to know which product you are using.
If you used Acrobat then your formula could read:
// establish the field names for the cells
var cN1 = "Text1";
var cN2 = "Text2";
var cN3 = "Text3";
// get the values of the fields
var nN1 = Number(this.getField(cN1).value);
var nN2 = Number(this.getField(cN2).value);
var nN3 = Number(this.getField(cN3).value);
// default result value average of N2 and N3
event.value = (nN2 + nN3) / 2;
// if nN1 > 0 the average N1, N2, and N3
if(nN1 > 0)
event.value = (nN1 + nN2 + nN3) / 3;
George Kaiser