Copy link to clipboard
Copied
Hello,
I am trying to create a custom formula for a fillable PDF. I am a novice at this stuff.
I need one box with a formula for the sum over numbers over 40 in two different boxes. Ths is for payroll if that helps clarify. If Box 1 says 45 and Box 2 says 43 I want Box 3 (with the formula) to caluclate 8.
Copy link to clipboard
Copied
Try this as custom calculation script of "Box 3" field:
var b1 = Number(this.getField("Box 1").valueAsString);
var b2 = Number(this.getField("Box 2").valueAsString);
var B1 = 0;
var B2 = 0;
if(b1>40)B1=b1-40;
if(b2>40)B2=b2-40;
event.value = B1+B2;