Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

sum help. Multiply cell b + c + d * 200000 / a

Avatar

Level 3

This formula is driving me crazy. Its a 3 step process. For one cell.

I need to add cell  b + c + d


Then take that number and times by 200,000


then take that number and divide by a

Does anyone have an idea?

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi,

Following radzmar instruction above to change the code to be

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

View solution in original post

30 Replies

Avatar

Level 3

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??

Avatar

Level 10

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.

Avatar

Level 3

now im getting this error.. We are getting so close to fixing this, i can feel it

error1.png

Code Behind
ss1.png

Avatar

Level 3

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

Avatar

Level 10

Is any value null, 0 or negative by default in your form you use for the formula?

Avatar

Level 3

Its just a numeric field.. Nothing is in the field for value..

Avatar

Level 3

would it help to upload the live form?? How do I upload the form?

Avatar

Level 10

You can use Acrobat.com or any other file hoster to share your form.

Avatar

Level 10

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:

and in LTA1 add:

Avatar

Level 3

the errors are gone but now the form is not calculating...... ugh.... this is driving me crazy.. Why??


https://acrobat.com/#d=eOTZq0SBO8g1AxeGxEQF8A

Avatar

Level 10

Hmmm...I don't see a problem in your form.

The calculations works, when the fields a - e are filled with a value.

Avatar

Level 3

The TIR and LTA Fields are not working

Avatar

Level 5

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

Avatar

Level 10

For me they do.

I'm not sure what's might be the reason it doesn't work for you.

Unbenannt.png

Avatar

Level 3

WTF??? Ugh...

Thanks Barlae, i will look into that.