+ Start a Discussion
SkeeterSkeeter 

IF Formula, Extra ',' Error

I'm trying to create a formula based on combination of 2 fields.  Not sure what I'm missing.

(Class Name = Application & Application Count is not blank) = application count +1
(Class Name != Application & Application Count is not blank) = application count
(Class Name = Application & Application Count is blank) = 1
(Class Name != Application & Application Count is blank) = 0
 
IF(
AND(
Class__r.ClassName__c = 'Application',
NOT(ISBLANK(Application_Count__c)), Application_Count__c + 1)),
IF(
AND(
Class__r.ClassName__c != 'Application',
NOT(ISBLANK(Application_Count__c)), Application_Count__c)),
IF(
AND(
Class__r.ClassName__c = 'Application',
ISBLANK(Application_Count__c))),1,
IF(
AND(
Class__r.ClassName__c != 'Application',
ISBLANK(Application_Count__c),0,NULL))

 
Best Answer chosen by Skeeter
Prabhat Kumar12Prabhat Kumar12
Please use updated formula
 
IF(
AND(
Class__r.ClassName__c = 'Application',
NOT(ISBLANK(Application_Count__c))), Application_Count__c + 1 ,IF(
AND(
Class__r.ClassName__c != 'Application',
NOT(ISBLANK(Application_Count__c))),Application_Count__c,
IF(AND(
Class__r.ClassName__c = 'Application',
ISBLANK(Application_Count__c)),1,
IF(
AND(
Class__r.ClassName__c != 'Application',
ISBLANK(Application_Count__c)),0,NULL))))



 

All Answers

SkeeterSkeeter
I am now receiving Error: Incorrect parameter type for function 'AND()'. Expected Boolean, recieved Number.
Prabhat Kumar12Prabhat Kumar12
Please use updated formula
 
IF(
AND(
Class__r.ClassName__c = 'Application',
NOT(ISBLANK(Application_Count__c))), Application_Count__c + 1 ,IF(
AND(
Class__r.ClassName__c != 'Application',
NOT(ISBLANK(Application_Count__c))),Application_Count__c,
IF(AND(
Class__r.ClassName__c = 'Application',
ISBLANK(Application_Count__c)),1,
IF(
AND(
Class__r.ClassName__c != 'Application',
ISBLANK(Application_Count__c)),0,NULL))))



 
This was selected as the best answer
SkeeterSkeeter
Yeah! That worked.  Thank you!