-
1. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 8:13 AM (in response to dbjackie) -
2. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 13, 2011 9:41 AM (in response to dbjackie)In FormCalc it should look like:
Sum(a, b, c) * 200000 / a
-
3. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 9:50 AM (in response to radzmar) -
4. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 10:07 AM (in response to dbjackie)if a number is already present in A i dont get an error..
i get this error testing in preview in live cycle...
Is there a way to prevent this??
-
5. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 13, 2011 10:58 AM (in response to dbjackie)This error appears, because one of your values is 0.
A division with 0 returns always 0 and the script fails.
So, to avoid the error, you can wrap you formula into an if expression.
if (a ne 0) then
Sum(b, c, d) * 200000 / a
endif
-
6. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 11:19 AM (in response to radzmar) -
7. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 11:21 AM (in response to dbjackie)on a side note.. After i hit ok, the calculations work and act right.. I just get this screen when i try to open the form
-
8. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 13, 2011 12:27 PM (in response to dbjackie)Is any value null, 0 or negative by default in your form you use for the formula?
-
9. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 1:00 PM (in response to radzmar)Its just a numeric field.. Nothing is in the field for value..
-
10. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 1:13 PM (in response to dbjackie)would it help to upload the live form?? How do I upload the form?
-
11. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 13, 2011 1:20 PM (in response to dbjackie)You can use Acrobat.com or any other file hoster to share your form.
-
12. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 1:23 PM (in response to dbjackie) -
13. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 13, 2011 1:36 PM (in response to dbjackie)Ok,
that was what I'm asking for.
If any of the values (a1 to e1) is null (empty) the script fails.
So, you need a more specific expression for you formula.
In TIR1 add:
if (a1 ne null and b1 ne null and c1 ne null and d1 ne null and e1 ne null) then
if (a1 ne 0 and b1 ne 0 and c1 ne 0 and d1 ne 0 and e1 ne 0) then
Sum(b1, c1, d1) * 200000 / a1
endif
endif
and in LTA1 add:
if (a1 ne null and b1 ne null and c1 ne null and d1 ne null) then
if (a1 ne 0 and b1 ne 0 and c1 ne 0 and d1 ne 0) then
Sum(b1, c1, d1) * 200000 / a1
endif
endif
-
14. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 2:06 PM (in response to radzmar)I will give that a spin ty
-
15. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 13, 2011 2:33 PM (in response to dbjackie)the errors are gone but now the form is not calculating...... ugh.... this is driving me crazy.. Why??
-
16. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 14, 2011 6:27 AM (in response to dbjackie)Hmmm...I don't see a problem in your form.
The calculations works, when the fields a - e are filled with a value.
-
17. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 7:14 AM (in response to radzmar)The TIR and LTA Fields are not working
-
18. Re: sum help. Multiply cell b + c + d * 200000 / a
BarlaeDC Dec 14, 2011 7:26 AM (in response to dbjackie)Hi,
When I download and open your form I get an error on the LTA1 layout ready event, because "Round" is not defined, This is due the script being set to be JavaScript but it is actually FormCalc.
If you go to that event and change the script type to FormCalc, it works as I would expect for me in Acrobat X.
Hope this helps.
Malcolm
-
19. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 14, 2011 7:27 AM (in response to dbjackie) -
20. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 7:36 AM (in response to radzmar)WTF??? Ugh...
Thanks Barlae, i will look into that.
-
21. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 7:40 AM (in response to dbjackie) -
22. Re: sum help. Multiply cell b + c + d * 200000 / a
BarlaeDC Dec 14, 2011 7:40 AM (in response to radzmar)Hi Radzmar,
It doesn't work for me because I have the console set up to show when an exception is thrown and break so no more code runs, if I switch that off it is works without any visible problems, just as I noticed it I thought I should mention it.
Regards
Malcolm
-
23. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 7:58 AM (in response to BarlaeDC)Barlae are you able to see a total other than 0 in the TIR and LTA fields?? I cant, it worked yesterday and now i get 0s
-
24. Re: sum help. Multiply cell b + c + d * 200000 / a
radzmar Dec 14, 2011 8:20 AM (in response to dbjackie)Ahhh ok,
I thought all values have to be greater than 0.
If not, change the script into:
if (a1 ne null and b1 ne null and c1 ne null and d1 ne null and e1 ne null) then
if (a1 ne 0) then
Sum(b1, c1, d1, e1) * 200000 / a1
endif
endif
-
25. Re: sum help. Multiply cell b + c + d * 200000 / a
BarlaeDC Dec 14, 2011 8:26 AM (in response to dbjackie) -
26. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 8:27 AM (in response to radzmar)hi radzmar, let me give your script a spin..
Thank Your so very much for attempting to help me fix this mess
-
27. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 8:47 AM (in response to dbjackie)Crap, the calculations are still not working on my end for the TIR or LTA fields.
fields a - e are whole number 0 - 1000000
field f is b - e added up
TIR is field f x 200,000 / field a
LTS is field b - d added up, x 200,000 / field a-----------------------------------------------------------------
Field A will never be zeroField B could be zero
Field C could be zero, but not likely
Field D could be zero, but not likely
Field E could be zero
Field F could be zero -
28. Re: sum help. Multiply cell b + c + d * 200000 / a
BarlaeDC Dec 14, 2011 9:03 AM (in response to dbjackie)Hi,
Following radzmar instruction above to change the code to be
if (a1 ne null and b1 ne null and c1 ne null and d1 ne null and e1 ne null) then
if (a1 ne 0) then
Sum(b1, c1, d1, e1) * 200000 / a1
endif
endif
I have made the modifications and uploaded the file here https://acrobat.com/#d=gv3yzm73ZD-8gb-hPOlVbQ
Can you try that document and see if it works for you, this works for me, when
a != 0
b,c,d,e can be 0
Hope this helps
Malcolm
-
29. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 10:18 AM (in response to BarlaeDC)Malcom, I dont know what the difference between your form and mine was. Probably something small and silly.
But it works!! It works great.....
Thank you so much
Radzmar, Thank you so much for helping me get this mess fixed
Now one little last question and i will be one happy camper... Is there a way to only show 2 decimal places?
-
30. Re: sum help. Multiply cell b + c + d * 200000 / a
dbjackie Dec 14, 2011 11:32 AM (in response to dbjackie)Nevermind I figured that out too










