+ Start a Discussion
Shawn Kaiser 7Shawn Kaiser 7 

I have a formula field hitting max size limits

I have the below formula field that is going over the max size limite of 5000. I need to figure out a way to get this to work hopefully without APEX. Does anyone know of a way to either break downt he "CASE(MOD..." of this formula? We considered doing a workflow or process builder but we need this to fire every day not just upon create or edit. If the only way to do this is via APEX can I get some help with the code?
If(ISPICKVAL( Status ,"Assigned"), 
CASE(MOD( DateValue(Assigned_Date_Change__c) - DATE(2007,1,1),7), 
0 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1), 
1 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1), 
2 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1), 
3 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1), 
4 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1), 
5 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0), 
6 , CASE( MOD( Today() - DateValue(Assigned_Date_Change__c) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0), 
999) 
+ (FLOOR(( Today() - DateValue(Assigned_Date_Change__c) )/7)*5) 
+Assigned_Duration__c-1,Assigned_Duration__c)