I have a formula field which don't have syntax errors. The characters in this formula has not even more than 500 characters. But, it is showing 2,535 characters. I need this formula as much as possible in very less characters and the formula is given below.
DATETIMEVALUE (DATE(
YEAR(DATEVALUE( Exact_Date__c )) + FLOOR( ( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1 ) / 12 ),
MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1 +
IF( DAY (DATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1,
2, 28,
4, 30,
6, 30,
9, 30,
11, 30,
31 ), 1, 0 ), 12 ) + 1,
IF( DAY(DATEVALUE( Exact_Date__c )) > CASE( MOD( MONTH (DATEVALUE( Exact_Date__c )) + 2 - 1, 12 ) + 1,
2, 28,
4, 30,
6, 30,
9, 30,
11, 30,
31 ),
1, DAY(DATEVALUE( Exact_Date__c ))
)
)
)
Where Exact_Date__c is a Date-Time
filed which works as input field takes date and time from object.
Specifically, why i need this requirement, i am using this formula field in another formula field which results in character error more than 5000.
I tried with breaking the formula field into multiple fields as in reference 1 is saying, but giving same result in characters.
I followed through following references. But its returning same result.
These are the reference 1 and reference 2
could any one help me how i can reduce the formula characters?
Dup__c
is itself a formula field. If that's the case, please edit your question to include that formula field as well. Seeing as its used 8 times in the formula field you're asking about, optimizations to that field are more valuable than optimizations to the formula field you're currently asking about.