• Resolved rosbiffer

    (@rosbiffer)


    I’m trying to work out a formula but getting bogged down:

    Year 1 running cost = purchase price * percentage
    Year 2 running cost = year 1 running cost * inflation
    year 2 running cost = year 2 running cost * inflation etc

    What is the total running cost after x years?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @rosbiffer

    I’m sorry, but your description is too general, and the implementation of the equations are based in the details.

    For example, assuming you have a DropDown field fieldname1 for the years, where the choices’ values are: 1,2,3, …. and the purchase price is the currency field fieldname2. Furthermore, the percentage is: 110%, and the inflation the 102%

    Note, the fields’ names and the numbers are hypothetical, only to describe the process.

    The equation associated to the calculated field to get the final price could be:

    
    (function(){
    var result=fieldname2, f = 1.1;
    for(var i=0; i<fieldname1; i++)
    {
    result = result*f;
    f = 1.01;
    }
    return result;
    })()
    

    and that’s all.
    Best regards.

    Thread Starter rosbiffer

    (@rosbiffer)

    Great, that got me on the right path, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Formula help’ is closed to new replies.