6 Replies Latest reply on Feb 9, 2018 5:57 AM by DavidBalsby

# Help "translating" an Excel calculation formual to PDF Form

I´ve been trying to figure out a calculation formula that will work on a pdf form.

The original line from Excel is:

OM(A4<1;0;(A4-1)*30+110)

A4 is the total number a person does something.

(If a person does something 1 time he/she receives 110 but if he/she does it 5 times he/she receives 230 and if he/she doesn´t do
anything he/se receives 0. )

If anyone has a solution to my problem I would appreciate it.Thanks

• ###### 1. Re: Help "translating" an Excel calculation formual to PDF Form

What is "OM"? Is this "IF" in another language?

What are the names of these fields in your PDF file?

1 person found this helpful
• ###### 2. Re: Help "translating" an Excel calculation formual to PDF Form

Sorry, forgot to translate OM from Swedish to English

I just use two fields one to print the numbers of time someone has done something and the other shows the
points.

If you run one lap you will receive 110 Points but for every extra lap you will receive an additional 30 Points.

• ###### 3. Re: Help "translating" an Excel calculation formual to PDF Form

So it is "IF"?

What are the names of your fields?

• ###### 4. Re: Help "translating" an Excel calculation formual to PDF Form

Correct OM=IF

Just two fields. One named “laps” and one named “points”

The person who does the running shall just put in a date and total laps and then he/she
will receive total points without doing any calculation them self.

There are two more fields 110 p and 30 p but that is for those who fill in with pencil.

• ###### 5. Re: Help "translating" an Excel calculation formual to PDF Form

OK. You can use this code as the custom calculation script of the "points" field:

```var laps = Number(this.getField("laps").valueAsString);
if (laps<1) event.value = 0;
else event.value = ((laps-1)*30)+110;
```
1 person found this helpful
• ###### 6. Re: Help "translating" an Excel calculation formual to PDF Form

Thank your very much for your help.

It worked perfectly.