Copy link to clipboard
Copied
Hello everyone,
I am hoping you can help me solve a problem.
I am new to pdf forms and javascript.
I have set up a basic form that functions as a calculator.
The form was originally in excel and I was able to use the formula SUMIF(X:Y,>"0")*1000000
All the formula does is checks for positive values in a range and then sums only the positive values eventually multiplying them by $1 000,000.
I am trying to have the result display in a form text box (light blue box with the $2,119,244,485.00 number)
Copy link to clipboard
Copied
What are the names of the fields you want to use for this calculation?
Copy link to clipboard
Copied
Hi there thank you for your reply,
the field names are;
The field where I want the output is named "Estimated Funding Requirement Over and Above" that's the light blue cell in the form 5th one in the first area.
in the formula SUMIF(X:Y>"0")*1000000
X:Y range is named: A39, B39, C39, D39, E39, F39, G39, H39, I39, J39, K39, L39, M39, N39, O39
0 is named: Zero
1000000 is named: One Million
thank you
Copy link to clipboard
Copied
Let's say they are called "Field1" and "Field2". You can use this code as the custom calculation script of the total field:
var fields = ["Field1", "Field2"];
var total = 0;
for (var i in fields) {
var f = this.getField(fields);
var v = Number(f.valueAsString);
if (v>0) total+=v;
}
event.value = total * 1000000;
Copy link to clipboard
Copied
thank you very much ill try as soon as I get home!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now