Formula Field Limits and Restrictions
Before you create formula fields, be aware of their limits and limitations.
Required Editions
Important Where possible, we changed noninclusive terms to align with our company
value of Equality. We maintained certain terms to avoid any effect on customer
implementations.
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: All Editions |
- Formula fields have these limits.
- Character limit — Formula fields can contain up to 3,900 characters, including spaces,
return characters, and comments. If your formula needs more characters, create separate
formula fields and reference them in another formula field.
Note The maximum number of displayed characters after an evaluation of a formula expression is 1,300. - Save size limit — Formula fields can’t exceed 15,000 bytes when saved. If you use multi-byte characters in your formula, the save size is different from the number of characters
- Compile size limit —Formula fields can’t exceed 15,000 bytes when compiled. The compile size is the size of the formula (in bytes) including all of the fields, values, and formulas it references. There’s no direct correlation between the compile size and the character limit. Some functions, such as TEXT, DATEVALUE, DATETIMEVALUE, and DATE significantly increase the compile size.
- Character limit — Formula fields can contain up to 3,900 characters, including spaces,
return characters, and comments. If your formula needs more characters, create separate
formula fields and reference them in another formula field.
- Default value formulas for a record type can only reference fields for that record type. But formula fields and formulas for approvals or rules for a record type can reference fields for that record type and any records that are related through a lookup or master-detail relationship. For example, a formula for a validation rule on opportunities can reference merge fields for accounts, campaigns, and opportunities. A formula field on accounts can reference fields for cases.
- You can’t use long text area, encrypted, or Description fields in formulas.
- The value of a field can’t depend on another formula that references it.
- You can’t delete fields referenced in formulas. Remove the field from the formula before deleting it.
- Campaign statistic fields can’t be referenced in formulas for field updates, approval processes, workflow rules, or validation rules, but can be referenced in custom formula fields.
- The UI escapes HTML tags used in formula fields. To create an HTML element, replace your HTML with a function, like HYPERLINK or IMAGE.
- Custom formula fields from contacts can’t be referenced through person accounts.
- The use of NULL as an expression isn’t supported in a Checkbox formula field.
- You can't directly reference aggregate fields on parent objects in formula fields, such as GrandTotal on the Quote object. Consider using Roll-Up Summary fields to aggregate values from child records for these calculations.
Did this article solve your issue?
Let us know so we can improve!

