Skip to main content
johnf88290943
Participant
January 17, 2019
Question

Javascript for PDF form calculation

  • January 17, 2019
  • 1 reply
  • 6830 views

Hi, I'm new to PDF forms and need to insert a calculation into a form.  I've mastered the basic calculations, but need a custom calculation for this one.  Can any one help me with it?  Here's the formula from excel:

=50+((10*SUM(A1:A10))/(SQRT(0.7*SUMSQ(B1:B10)+0.3*(POWER(SUM(B1:B10),2)))))

Any help greatly appreciated.

John

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 17, 2019

There's no one-to-one conversion from Excel to Acrobat JS.

Some functions (like SQRT) do have a direct JS equivalent (Math.sqrt), others (like SUM) don't and you'll need to write your own code to achieve the same result.


See:

JavaScript Math Reference

https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations