## If/Then Statements

Mar 23, 2020

Copied

I have been searching for days and trying numerous formulas found on this community but can't seem to get the custom calculation script to work.  Any help is greatly appreciated.

Here is the formula in Excel.   =if(Amount1>0,Type,"")

In the Type field on the bottom, I am trying to say that if the amount is greater than 0 (where 300 is) then fill in the Type from the above field that I have already entered that into.

This is what it should look like when the formula works in Excel.  Because I input JE16 in the top field, when I input the amounts in those fields below, the type JE16 shows in the first field to the left.

I hope this makes sense and thank you in advance for any help.

TOPICS
Acrobat SDK and JavaScript

Views

43

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## If/Then Statements

Mar 23, 2020

Copied

I have been searching for days and trying numerous formulas found on this community but can't seem to get the custom calculation script to work.  Any help is greatly appreciated.

Here is the formula in Excel.   =if(Amount1>0,Type,"")

In the Type field on the bottom, I am trying to say that if the amount is greater than 0 (where 300 is) then fill in the Type from the above field that I have already entered that into.

This is what it should look like when the formula works in Excel.  Because I input JE16 in the top field, when I input the amounts in those fields below, the type JE16 shows in the first field to the left.

I hope this makes sense and thank you in advance for any help.

TOPICS
Acrobat SDK and JavaScript

Views

44

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 23, 2020 0
3 Replies 3
Most Valuable Participant ,
Mar 23, 2020

Copied

if (Number(this.getField("Amount1").valueAsString)>0) event.value = this.getField("Type").valueAsString;

else event.value = "";

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 23, 2020 0
Mar 23, 2020

Copied

I can't thank you enough!!!

I was trying to use that same formula to fill in a field with a letter but only if again the amount > 0.  But there is nothing that it is pulling from so I'm not quite sure how to replace the "Type" with just the letter W.  Thank you again.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 23, 2020 0
LATEST
Most Valuable Participant ,
Mar 23, 2020

Copied

Replace:

this.getField("Type").valueAsString;

With

"W";

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 23, 2020 0