• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom Calculation Help - Sum of Numbers Over Certain Total

New Here ,
Jan 24, 2023 Jan 24, 2023

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. 

TOPICS
PDF forms

Views

134

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2023 Jan 24, 2023

Copy link to clipboard

Copied

LATEST

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines