Formula issue

I have tried so many options - i did manage to get the formula to work initially when it was less complicated but have added in an additional section and cant figure out where i have gone wrong - if anyone could help that would be amazing!

The formula should read:

if Planning Required is Yes AND 35% received is 0, then add 30 days to the Approved Date,

if not and Planning Required is No AND 35% received is 0, the put the 10% received date,otherwise put "0"

ifElse(
and(
equal($pr_planning_required_c,"Yes"),equal($thirtyfive_payment_received_c,0)
),
addDays(
$pr_approved_date_c,30),

IfElse(
and(
equal($pr_planning_required_c,"No"),equal($thirtyfive_payment_received_c,0)
),
$pr_10_percentage_payment_date_c),
)
"0",
)

thank you so much in advance for anyone that is able to help! 

Parents
  • Hi  ,

    There are a few minor corrections to the formula. I think you have all the right elements based on your business requirements, but the formatting is off:

    • Your second ifElse formula has improper capitalization
    • Your second ifElse formula only has an action to execute if it is true since you have a parentheses immediately following the 10% received date field
    • I'm assuming this formula is being used in a date field. If so, you can't set date fields to a value of 0, so I changed that to an empty string

    Here is the formula I think should work:

    ifElse(
        and(
            equal(
                $pr_planning_required_c,
                "Yes"
            ),
            equal(
                $thirtyfive_payment_received_c,
                0
            )
        ),
        addDays(
            $pr_approved_date_c,
            30
        ),
        ifElse(
            and(
                equal(
                    $pr_planning_required_c,
                    "No"
                ),
                equal(
                    $thirtyfive_payment_received_c,
                    0
                )
            ),
            $pr_10_percentage_payment_date_c,
            ""
        )
    )

    Let me know if that works!

    Chris

Reply
  • Hi  ,

    There are a few minor corrections to the formula. I think you have all the right elements based on your business requirements, but the formatting is off:

    • Your second ifElse formula has improper capitalization
    • Your second ifElse formula only has an action to execute if it is true since you have a parentheses immediately following the 10% received date field
    • I'm assuming this formula is being used in a date field. If so, you can't set date fields to a value of 0, so I changed that to an empty string

    Here is the formula I think should work:

    ifElse(
        and(
            equal(
                $pr_planning_required_c,
                "Yes"
            ),
            equal(
                $thirtyfive_payment_received_c,
                0
            )
        ),
        addDays(
            $pr_approved_date_c,
            30
        ),
        ifElse(
            and(
                equal(
                    $pr_planning_required_c,
                    "No"
                ),
                equal(
                    $thirtyfive_payment_received_c,
                    0
                )
            ),
            $pr_10_percentage_payment_date_c,
            ""
        )
    )

    Let me know if that works!

    Chris

Children