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

Making a number of fields equal to 100%.

Slivar
Registered: May 29 2010
Posts: 16

Hello everyone,

I am having trouble trying to figure out how to have 3 fields equal to 100%. To further explain, what I want to ultimately achieve is when you type a number into of one the fields (for eg. 37) I want the other 2 fields to automatically show the remaining 63 with (31.5 in each field). This is just an example as I want be able to input any sum that into one or more of the fields and the 3rd field will automatically do the math and equal to 100.

I am hopeless with Javascript, so I am hoping that somebody out there can show me how to do this whilst explaining the formula as well.

Thank you all.
Sash

Thank you all for your time in posting your responses but I need this is for Acrobat 9 not Excel.

I tried try67's and yes it worked in one way. The only problem is, when I place a number in field1 I can't change field2 or field3. I want to be able to change any one of the 3 fields and the number in the other fields to be able to change automatically.

So for example, I type in 70 in field1, 10 in field2 then field3 should automatically be 20, or let's say I go back and change field3 to 30, field2 to 50 and then field1 should automatically be 20. I want the fields to automatically do the math no matter which field I type in.

I hope this is clearer and if you need further clarification, please let me know.

Thanks
Sash

My Product Information:
Acrobat Pro 9.0, Macintosh
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
The two things you described require different formulas.
For the first scenario you can use this code in the Simple Field Notation field of field2 and field3 (assuming the names of the fields are field1, field2 and field3):
(100 - field1) / 2

For the second scenario, if field1 and field2 are filled in, place this as the Simple Field Notation calculation of field3:
100 - (field1 + field2)

If you use this method you may not have any spaces or periods in the names of your fields.

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

Shoshana
Registered: Oct 31 2006
Posts: 6
My formula at bottom of excel sample. First column is subtracted from 100 and divided by 2, third column equalls column 2.
37 31.5 31.5 100
55 22.5 22.5 100
70 15 15 100
22 39 39 100
15 42.5 42.5 100
10 45 45 100
11 44.5 44.5 100
9 45.5 45.5 100
7 46.5 46.5 100
5 47.5 47.5 100


SUM(D2-B2)/2 =B2

Shoshana

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Your formula has a circular reference, or you are setting the value of a field that is used in the calculation.

With a format of Percentage:
In Excel I would use the following
Column B1 - =(1- $A1) /2
Column C1 - = 1 - $A1 - $B1
Column D1 - =SUM(A1:C1)

So if you name your cell fields like A1, B1, C1, D1 for row 1 with a format of Percentage, then

B1 - (1 - A1) / 2
C1 - 1 - A1 - B1
D1 - A1 + B1 + C1

There is no absolute references in Acrobat like there is in Excel.

George Kaiser

Slivar
Registered: May 29 2010
Posts: 16
Thank you all for your time in posting your responses but I need this is for Acrobat 9 not Excel.

I tried try67's and yes it worked in one way. The only problem is, when I place a number in field1 I can't change field2 or field3. I want to be able to change any one of the 3 fields and the number in the other fields to be able to change automatically.

So for example, I type in 70 in field1, 10 in field2 then field3 should automatically be 20, or let's say I go back and change field3 to 30, field2 to 50 and then field1 should automatically be 20. I want the fields to automatically do the math no matter which field I type in.

I hope this is clearer and if you need further clarification, please let me know.

Thanks
Sash
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
It's possible to do that, but it requires a more complicated script (in JavaScript).
You will need to make use of the event.source property to check which field was changed, and then change the other fields accordingly.

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

Slivar
Registered: May 29 2010
Posts: 16
Thanks for your response try67.
How exactly is it done as I would not have a clue about Javascript.

Thanks
Sash