function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PookyPooky 

Formula to count fields that have data in them

I am trying to do a count on the total fields that have data populated. However, I am getting a syntax error. Can anyone help?

 

(IF(ISNULL(Aetna_POS_Open__c ), 0, 1) + ​
 IF(ISNULL(Assurant_John_Alden__c ), 0,1) + ​
  IF(ISNULL(Avalon_Healthcare__c), 0, 1) + ​
   IF(ISNULL(AVMED__c ), 0, 1) +​
 IF(ISNULL(Capital_Health__c ), 0, 1) +​
 IF(ISNULL(Cigna_PPO__c  ), 0, 1) +​ 
 IF(ISNULL(Citrus__c  ), 0, 1) +​  
IF(ISNULL(Humana__c ), 0, 1) +​   
IF(ISNULL(Florida_Health_Plan__c ), 0, 1) +​   
IF(ISNULL(Medicaid__c  ), 0, 1) +​    
IF(ISNULL(NHP__c ), 0, 1) +​     
IF(ISNULL(Total_Health_Care__c  ), 0, 1) +​      
IF(ISNULL(UHC_Options_PPO__c ), 0, 1) +​       
IF(ISNULL(Vista_U65__c  ), 0, 1) +​    
IF(ISNULL(BCBS_Preferred_Patient_Care_PPO__c    
 ), 0, 1))

werewolfwerewolf
ISNULL does not apply to text fields, I think.  For those, you'll want to compare them to the empty string, so like Field__c=''.
PookyPooky
I am not sure I understand. Basically I want to say if there is text in the field, add the field to the total. If the field is blank, leave it at 0 and at the end total all fields that have a 1
werewolfwerewolf
Yes, and I'm saying that if it's a text field, instead of using ISNULL, compare it to ''.