3 Replies Latest reply on May 22, 2014 6:38 AM by Rvdlee

    Using lineair formula, but outcome 0 if X=0

    Rvdlee

      Hi all,

       

      I am new to this forum and working with Adobe Acrobat X pro for some months now. Currently I am facing some difficulties with a formula. Simplified, I want Adobe to calculate the price of a hose, with fixed costst (couplings) and variable costs (length of the hose, based on the numbers of meters that they select). Their response can be chosen in a dropdown menu in meters (0, 5, 10, 15, 20, 25). The calculation that follows is simple:

      451 + 8X

      However, since the item is an option, if X= 0 this means that the user does not want the item at all. Yet the result still equals 451 euros. I want the outcome to be 0 if 0 meters is selected.

       

      In excel we could solve the issue using the Round function (Round equals 1 if X > 0 and 0 if X equals 0. However, in PDF I have no clue how to deal with this (javascript I guess?).

       

      In practice it is slightly more complicated, since the same hose can be selected for 2 separate purposes and I want to show the total of these two as outcome. That is, the formula is 451*(1(if hose is wanted for a) + 1(if hose is wanted for b))  + 8(a+b) . See screenshot for what I mean.   

      adobe forum.jpg

       

      Can you help me?

       

      Thanks a lot in advance