0

I am trying to write a formula depending on the count of roll-up summary fields to indicate which color needs to show on the Account object. Here is what I have so far:

    IF( OR(Marketing_Sum_Gray__c > 0, Outsourcing_Sum_Gray__c > 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m95", "Gray"),
    IF(AND(OR(Marketing_Sum_Black__c > 0, Outsourcing_Sum_Black__c > 0), OR(Marketing_Sum_Gray__c = 0, Outsourcing_Sum_Gray__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m90", "Black"),
    IF(AND(OR(Marketing_Sum_Blue__c > 0, Outsourcing_Sum_Blue__c > 0), OR(Marketing_Sum_Black__c = 0, Outsourcing_Sum_Black__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9P", "Blue"),
    IF(AND(OR(Marketing_Sum_Red__c > 0, Outsourcing_Sum_Red__c > 0), OR(Marketing_Sum_Blue__c = 0, Outsourcing_Sum_Blue__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9A", "Red"),
    IF(AND(OR(Marketing_Sum_Yellow__c > 0, Outsourcing_Sum_Yellow__c > 0), OR(Marketing_Sum_Red__c = 0, Outsourcing_Sum_Red__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Yellow"),
    IF(AND(OR(Marketing_Sum_Green__c > 0, Outsourcing_Sum_Green__c > 0), OR(Marketing_Sum_Yellow__c = 0, Outsourcing_Sum_Yellow__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Green"),
    IF(AND(OR(Marketing_Sum_Gold__c > 0, Outsourcing_Sum_Gold__c > 0), OR(Marketing_Sum_Green__c = 0, Outsourcing_Sum_Green__c = 0),         IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Gold"),
    IMAGE("/s.gif", "N/A")))))))
3
  • so what is not working here? Commented Oct 14, 2016 at 18:09
  • It is saying that I am missing an end ) but no matter how many I try, it's not working
    – Paul
    Commented Oct 14, 2016 at 18:14
  • you can remove one by one condition to figure out the issue Commented Oct 14, 2016 at 18:15

1 Answer 1

1

Try with this Here I add one extra ) in the end for every if condition for AND part.

IF( OR(Marketing_Sum_Gray__c > 0, Outsourcing_Sum_Gray__c > 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m95", "Gray"),
IF(AND(OR(Marketing_Sum_Black__c > 0, Outsourcing_Sum_Black__c > 0), OR(Marketing_Sum_Gray__c = 0, Outsourcing_Sum_Gray__c = 0)), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m90", "Black"),
IF(AND(OR(Marketing_Sum_Blue__c > 0, Outsourcing_Sum_Blue__c > 0), OR(Marketing_Sum_Black__c = 0, Outsourcing_Sum_Black__c = 0)), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9P", "Blue"),
IF(AND(OR(Marketing_Sum_Red__c > 0, Outsourcing_Sum_Red__c > 0), OR(Marketing_Sum_Blue__c = 0, Outsourcing_Sum_Blue__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9A", "Red"),
IF(AND(OR(Marketing_Sum_Yellow__c > 0, Outsourcing_Sum_Yellow__c > 0), OR(Marketing_Sum_Red__c = 0, Outsourcing_Sum_Red__c = 0)), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Yellow"),
IF(AND(OR(Marketing_Sum_Green__c > 0, Outsourcing_Sum_Green__c > 0), OR(Marketing_Sum_Yellow__c = 0, Outsourcing_Sum_Yellow__c = 0), IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Green"),
IF(AND(OR(Marketing_Sum_Gold__c > 0, Outsourcing_Sum_Gold__c > 0), OR(Marketing_Sum_Green__c = 0, Outsourcing_Sum_Green__c = 0)),         IMAGE("/servlet/servlet.FileDownload?file=0153C0000004m9o", "Gold"),
        IMAGE("/s.gif", "N/A")))))))
1
  • 1
    Thank you! I was missing the parenthesis to close out my AND().
    – Paul
    Commented Oct 14, 2016 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .