'If' formula help!

we currently work out stage payments depending on contract type ('supply and fit' or 'supply only') we have a new contract type 'New 2023 Terms' which will mean that the second stage payment will either be 40% if contract type is 'supply and fit' or 45% if contract type is 'New 2023 Terms'. 

the field we are looking to amend is 40% Suggested Amount - we want this to check the contract type field and depending whether it says 'supply and fit' or 'new 2023 terms' work out 40% value or 45% value respectively. 

we have the code for it to work out the 40% based on 'supply and fit' but do not know what we should add to make it depend on that cell and change the formula as and when required. 

can anyone help with this (the formula also makes the value on the suggested field change to zero if the client has paid the up to or over the amount up to that payment stage, to signify to our team that the client has nothing outstanding at that payment stage)

ifElse(
equal(round($pr_total_paid_c,2),
round(multiply($pr_payment_gross_value_c,.1),2)),
multiply($pr_payment_gross_value_c,.3),
ifElse(
greaterThan(
$pr_total_paid_c,
multiply($pr_payment_gross_value_c,.1)
)
,"0",
ifElse(
greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,0)),
subtract(multiply($pr_payment_gross_value_c,.4),$pr_total_paid_c),
multiply($pr_payment_gross_value_c,.3)
)

)

)

Parents
  • Hi Chris

    Thanks so much this is fab! We have 3 contract types - how do i make the last part of the calculation specific to the other contract type called "Supply and Fit 2023 Terms" this will need to calculate the balance payment up to 45% of the contract value 

  • we have managed to make it work as the other contract type works with different cells so there is only 2 contract types for the cells in question. 

    we need the same thing for 'up to 90% payment stage' which relates to 50% and 55% of the contract value - i have tried to emulate the above but havent got anywhere :( 

    could you explain the code or maybe correct this one for us please? 

    ifElse(
    equal(round($pr_total_paid_c,2),
    round(multiply($pr_payment_gross_value_c,.4),2)),
    multiply($pr_payment_gross_value_c,.5),

    ifElse(
    greaterThan(
    $pr_total_paid_c,
    multiply($pr_payment_gross_value_c,.5)
    )
    ,"0",
    ifElse(
    greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,.1)),
    subtract(multiply($pr_payment_gross_value_c,.9),$pr_total_paid_c),
    multiply($pr_payment_gross_value_c,.5)
    )

    )
    )

Reply
  • we have managed to make it work as the other contract type works with different cells so there is only 2 contract types for the cells in question. 

    we need the same thing for 'up to 90% payment stage' which relates to 50% and 55% of the contract value - i have tried to emulate the above but havent got anywhere :( 

    could you explain the code or maybe correct this one for us please? 

    ifElse(
    equal(round($pr_total_paid_c,2),
    round(multiply($pr_payment_gross_value_c,.4),2)),
    multiply($pr_payment_gross_value_c,.5),

    ifElse(
    greaterThan(
    $pr_total_paid_c,
    multiply($pr_payment_gross_value_c,.5)
    )
    ,"0",
    ifElse(
    greaterThan($pr_total_paid_c,multiply($pr_payment_gross_value_c,.1)),
    subtract(multiply($pr_payment_gross_value_c,.9),$pr_total_paid_c),
    multiply($pr_payment_gross_value_c,.5)
    )

    )
    )

Children