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

Formcalc If Question

kevingib
Registered: Jan 10 2008
Posts: 9

Ihave a form that has 5 drop down boxes that contain choices with assigned variables that repreent a discount percentage. I also have 5 numeric filedsthat calculate anumber next to each of these boxes.

I need to create an IF statement or something that will determine the value in each of the first 5 drop downs and if it is equal to something then add up the coresponding total boxes next to it.

Here is what I was thinking but I can not get it to work.

If (Payment1 =1 or Payment2 =1 or Payment3 =1 ...) Then sum (total1+total2=..)

The issue is getting the statement worked out where it will only sum the total boxes if the IF statement is true

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
1. You are using the set operator, "=", rather than equality operator, "==" or "eq".
2. The parameter list in your "Sum()" function does not follow the required format. You must serparate the parameters with a ",".
3. "if' statements end with an "endif" in FormCalc.
4. Letter case is significant in FormCald and JavaScript.


if (Payment1 == 1 or Payment2 == 1 or Payment3 == 1) then
Sum (total1, total2, total3)
endif

George Kaiser

kevingib
Registered: Jan 10 2008
Posts: 9
Thanks gkaiseril , I am making progres but this still doesnt yield the answer that I expect in all cases.

The statement as I have it now is:
if (Payment1 == 1 or Payment2 == 1 or Payment3 == 1 or Payment4 == 1 or Payment5 == 1) then Sum (Tuition1,Tuition2,Tuition3,Tuition4,Tuition5 /12)endif


This produces a total of all tuition boxes but doesnt do the divide by 12 to equate to a monthly payment. it also adds up all boxes BUT I only want the boxes added where Payment == 1. the Payment box uses 3 variables 1, .975 and .95 and the only one I want to match in this particular case is the 1.

if Payment1 == 1 and the other 4 payement fields yield something else I would expect to obtain the variable derived from the Tuition1 calculated box Divided by 12.

Once I get this one formula working I will have 4 or 5 others that will use the same logic and that is all I lack for wrapping this up.

I wish there was some way to upload my pdf so you could see what I am trying to accomplish