Skip to main content
Participant
September 4, 2024
Question

How to do an IF Statement in Adobe similar to Excel

  • September 4, 2024
  • 1 reply
  • 390 views

two examples are:

1.  =+IF($F$7-$F$28<0, $F$7-$F$28,0)

2. =+IF($F$7-$F$28>0, $F$7-$F$28,0)

 

In adobe I have is like this but i cant get it to popluate

 

1. IF(Reimbursed1-Reimbursed2<0,Reimbursed1-Reimbursed2,0)

2. IF(Reimbursed1-Reimbursed2>0,Reimbursed1-Reimbursed2,0)

 

Any help is greatly appreciated.

This topic has been closed for replies.

1 reply

PDF Automation Station
Community Expert
Community Expert
September 4, 2024

You have to write a JavaScript and put it as a custom calculation in the field where you want the result like this:

#1

var diff = this.getField("Reimbursed1").value - this.getField("Reimbursed2").value;

if(diff <0)

{event.value=diff}

else

{event.value=0}

 

#2 Same but change < to > .

Participant
September 4, 2024

I am not a cumputer specialist or write script so I do not know the format, what would by the compelte typed out version?

PDF Automation Station
Community Expert
Community Expert
September 4, 2024

I gave it to you.  Copy and paste it.  If the fields are named "Reimbursed1" and "Reimbursed2" then the scripts are correct to paste as a custom calculation in the field where you want the result.