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
Craig CoulterCraig Coulter 

formula field limits

Hi All,

We have a number formula field which holds a Case function and the current compiled size is 9,788 characters and to add anyting else to it, we have to delete existing values. We need to continue to add to this, so what is the best way to do that?


SwethaSwetha (Salesforce Developers) 
HI Craig,

From m I see "Formula fields can’t exceed 15,000 bytes when compiled. "

If you need to add more logic to a formula field that has already reached its limits, you can consider using workarounds such as splitting the formula into multiple fields or using Apex code instead of a formula field

I'd suggest following the approaches listed in


If this information helps, please mark the answer as best. Thank you
aanojas lanceraanojas lancer
If feasible, divide the existing formula into smaller formula fields. Each field can handle a subset of the computations or logic, and the ultimate result can be obtained by referencing and combining the values from the smaller formula fields. 
If the complexity of your calculations exceeds the capabilities of formula fields and workflow rules, you can consider implementing an Apex trigger. Triggers provide greater flexibility and can handle more complex logic and calculations. They can update fields, perform calculations, and store the results in separate fields, avoiding the formula field size limit.
visit:- Salesforce formula size (
If my response is of use to you, please mark the response as best if this information is relevant. Thank you very much.