I'm working on a formula field on Account and getting stuck. It involves several custom fields. Essentially, we have three outcomes: Standard, EMR, or blank. The following is the formula that I've created, but I'm getting the generic error "Error: Syntax error. Missing ')'" so I think something is missing for me. Any help would be appreciated.
IF(OR(MDS_Exception_Home__c, Enrollment_Hold__c), "",
IF(OR(AND(ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 45 days"),
TODAY() - Completed_Compliance_Cycle__c >44),
Sell_Dental_Policies__c = TRUE,
Sell_Hearing_Policies__c = TRUE,
Sell_Vision_Policies__c = TRUE,
AND(ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 60 days"),
TODAY() - Completed_Compliance_Cycle__c >60)),
"EMR",
IF(OR(MDS_Exception_Home__c, Enrollment_Hold__c, Facility_EMR__c), "",
IF(OR(AND(ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 45 days"),
TODAY() - Completed_Compliance_Cycle__c >44),
Sell_Dental_Policies__c = TRUE,
Sell_Hearing_Policies__c = TRUE,
Sell_Vision_Policies__c = TRUE,
AND(ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 60 days"),
TODAY() - Completed_Compliance_Cycle__c >60)),
"Standard",
""))
Hi @Blake Carrera,
Hope you are doing well,
there might be some syntax errors and logical issues in your formula please look below modification and compare it with your formula
IF(
OR(
MDS_Exception_Home__c,
Enrollment_Hold__c,
Facility_EMR__c
),
"",
IF(
AND(
ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 45 days"),
TODAY() - Completed_Compliance_Cycle__c > 44,
OR(
Sell_Dental_Policies__c,
Sell_Hearing_Policies__c,
Sell_Vision_Policies__c
)
),
"EMR",
IF(
AND(
ISPICKVAL(Compliance_Cycle_Frequency__c, "Run Cycle- 60 days"),
TODAY() - Completed_Compliance_Cycle__c > 60,
OR(
Sell_Dental_Policies__c,
Sell_Hearing_Policies__c,
Sell_Vision_Policies__c
)
),
"EMR",
"Standard"
)
)
)
This adjusted formula should fix the syntax error and logically check if any of the conditions are met for each outcome. If any of the MDS_Exception_Home__c, Enrollment_Hold__c, or Facility_EMR__c fields are true, it will return an empty string. If not, it will check for the conditions for EMR. If none of those conditions are met, it will default to "Standard".
Hope this will provide more understanding to you,
Thanks!
