These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How do I add a complex calculation from excel?

Birdman78
Registered: May 3 2010
Posts: 2
Answered

Hi, I wanted to add a complex calculation from an excel spreadsheet into a PDF document set of fields. I have two fields, SqFt where the initial data is manually entered, then the price calculation field where I want the price to appear.

The calculation i need is (SqFt/1000-3)*3.5+34

Can anyone help me?

My Product Information:
Acrobat Standard 9.3.1, Macintosh
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
There are may ways to accomplish this either by making intermediate hidden fields so one could use the 'field is the ___ of fields:' or the 'simplified field notation' options or you could write a 'custom calculation script'.

Have you looked at the eSeminars on demand [url=https://admin.adobe.acrobat.com/_a200985228/p17266135/]Getting Started with Forms[/url] by Lori Defurio, Thom Parker's tutorial [url=http://www.acrobatusers.com/tutorials/2006/form_calculations]How to do (not so simple) form calculations[/url]? As well as other [url=http://www.acrobatusers.com/learning_center]AUC Learning Center[/url] resources.

You might want to also look at [url=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference]Mozilla JavaScript 1.5 Core Reference[/url] and Adobe's [url=http://www.adobe.com/devnet/acrobat/javascript.php]JavaScript for Acrobat[/url].

George Kaiser

try67
Expert
Registered: Oct 30 2008
Posts: 2398
I would follow gkaiseril's advice if you want to know how to create advanced calculations in Acrobat.
If you just need this one, enter the following code as the second field's custom calculation script:

event.value = (((this.getField("SqFt").value / 1000) - 3) * 3.5) + 34;
Note: You might need to adjust the name of the "SqFt" field, depending on how you named it.
Notice that the names are case-sensitive, so "sqft" is NOT the same as "SqFt".

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com