You need to sign in to do that
Don't have an account?

Validation Formula With Syntax Error
Hi There,
I am having a few issues with populating a Formula Field as I need to run nested IFs on it.
Basically what I am looking to do is to determine a rating based on the Business Type and if the last bill has consumption.
So if the Business has previous consumption
The Rating for Gyms is A-, Rating For Hotels is B-, Rating For Offices is C-
If there is no consumption
Then The Rating for Gyms is A+, Rating For Hotels is B+, Rating For Offices is C+
Im pretty sure its something small but I keep getting "Error: Syntax error. Missing ')'
IF((ISPICKVAL(Does_The_Customer_Have_Consumption__c, "Yes")
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A-"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B-"),
(ISPICKVAL(BusinessType__c,"Offices") , "C-")),
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A+"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B+"),
(ISPICKVAL(BusinessType__c,"Offices") , "C+"))))
I am having a few issues with populating a Formula Field as I need to run nested IFs on it.
Basically what I am looking to do is to determine a rating based on the Business Type and if the last bill has consumption.
So if the Business has previous consumption
The Rating for Gyms is A-, Rating For Hotels is B-, Rating For Offices is C-
If there is no consumption
Then The Rating for Gyms is A+, Rating For Hotels is B+, Rating For Offices is C+
Im pretty sure its something small but I keep getting "Error: Syntax error. Missing ')'
IF((ISPICKVAL(Does_The_Customer_Have_Consumption__c, "Yes")
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A-"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B-"),
(ISPICKVAL(BusinessType__c,"Offices") , "C-")),
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A+"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B+"),
(ISPICKVAL(BusinessType__c,"Offices") , "C+"))))
IF((ISPICKVAL(Does_The_Customer_Have_Consumption__c, "Yes") , // you need a comma here
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A-"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B-"),
(ISPICKVAL(BusinessType__c,"Offices") , "C-")),
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A+"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B+"),
(ISPICKVAL(BusinessType__c,"Offices") , "C+"))))
Not tested but a comma is missing for sure.
All Answers
IF((ISPICKVAL(Does_The_Customer_Have_Consumption__c, "Yes") , // you need a comma here
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A-"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B-"),
(ISPICKVAL(BusinessType__c,"Offices") , "C-")),
IF((ISPICKVAL(BusinessType__c,"Gyms") , "A+"),
(ISPICKVAL(BusinessType__c,"Hotels") , "B+"),
(ISPICKVAL(BusinessType__c,"Offices") , "C+"))))
Not tested but a comma is missing for sure.
Thanks for that, got it working. Nested IFs caused a headache, but yes, the comma was the problem :-)