Calculated Formula RollUpSum

I am trying to create a Roll Up Sum if the Opportunity Sale Stage is Prospecting, Qualification etc

ifElse(

equal(related($ems_parent_opportunities_opportunities,"sales_stage"),"Prospecting","Qualification","Proposal/ Price Quote","Converting","Closed Won")
rollupConditionalSum($ems_parent_opportunities_opportunities,"amount")

).

However I get the error message:

Invalid Formula
ifElse( equal(related($ems_parent_opportunities_opportunities,"sales_stage"),"Prospecting","Qualification","Proposal/ Price Quote","Converting","Closed Won") rollupConditionalSum($ems_parent_opportunities_opportunities,"amount") ).: Syntax Error, no close parentheses found.
Can anyone help to see where i'm missing aclosed bracket??
Thanks so much
  • Hi , you have the same number of opening and closing parentheses. I believe that the problem here is that you are comparing the related opportunity sales stage to a list of values - and the "equal" function only accepts two parameters. You've provided more than 2 parameters - I am surprised that that was not raised as the error.

    Instead of equal, use isInList(related($ems_parent_opportunities_opportunities,"sales_stage"),createList("Prospecting","Qualification","Proposal/ Price Quote","Converting","Closed Won")), and it should work (or at worse case, you'll get a different error).