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")))))))
  • so what is not working here? – Tushar Sharma Oct 14 '16 at 18:09
  • It is saying that I am missing an end ) but no matter how many I try, it's not working – Paul Oct 14 '16 at 18:14
  • you can remove one by one condition to figure out the issue – Santanu Boral Oct 14 '16 at 18:15
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
    Thank you! I was missing the parenthesis to close out my AND(). – Paul Oct 14 '16 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.