A Formula Field in Salesforce is a read-only custom field that derives its value from a formula instead of storing user-entered data. Salesforce calculates the value when the field is accessed or displayed, using other fields, constants, operators, and built-in functions. Formula fields can return any of 8 data types: Number, Currency, Percent, Date, Date/Time, Text, Checkbox, or Time.
You’ll meet this term whenever a Salesforce admin needs to derive a value from other data on the record: calculating age from birthdate, deriving full name from first and last name, computing margin from revenue and cost, or flagging high-value Opportunities with a checkbox.
PRACTICAL EXAMPLE
An admin needs a quick visual flag on Opportunities so reps can sort by “high priority” deals. They create a Checkbox formula field High_Priority__c with the expression Amount > 100000 && Probability >= 75. Every Opportunity record now shows a checkbox that automatically marks itself when the deal is large and likely to close. Reports filter by it, dashboards segment by it, and the value updates the instant either source field changes.
Quick facts
-
Read-only, calculated at runtime: formula recomputes every time the record is viewed and does not persist a value in the database.
Note: if a list view or report shows stale-looking data, the formula itself is current. The cache or report filter is usually the cause. -
Available in all editions: Essentials, Professional, Enterprise, Performance, Unlimited, Developer, Database.com.
-
3,900 characters max in formula, 1,300 displayed: if you hit the limit, split the logic across multiple formula fields and reference one from another.
-
8 return data types: Number, Currency, Percent, Date, Date/Time, Text, Checkbox, Time. The return type is locked at creation and cannot be changed later.
-
Cross-object formulas: reference fields on related records via master-detail or lookup relationships, up to 10 levels up from the object that contains the formula field.
-
Blank fields handling: “treat as zeros” vs “treat as blanks”: choose this at field creation for formulas that reference number, currency, or percent fields.
Note: “treat as zeros” silently turns missing values into 0 in calculations, which distorts averages and ratios. Pick “treat as blanks” when you want a missing value to propagate.
Note
Formula fields and Roll-Up Summary fields work differently. Formula fields calculate values at runtime and do not store the result in the database. They can use fields from the current record and related parent records. Roll-Up Summary fields calculate COUNT, SUM, MIN, and MAX values from related child records and store the result on the parent record.
Roll-Up Summary fields require a master-detail relationship. Formula fields work with both master-detail and lookup relationships. If you need an aggregated value from child records for reporting, use a Roll-Up Summary field instead of a formula field.
FAQ
How many formula fields can an object have in Salesforce?
There is no separate limit for formula fields. They count toward the object's total custom field limit, which varies by Salesforce edition and object type. Objects are also limited to 15 spanning relationships used in cross-object formulas and certain other components.
Can we use a formula field in a Flow?
Yes. Flows can read formula field values like any other field. The value is calculated when the Flow accesses the record. Formula fields are read-only, so Flows cannot update them.
Can we use a formula field in a report?
Yes. Formula fields can be added as report columns, used in filters, and grouped by. Reports use the current calculated value at runtime. Complex formulas, especially those with cross-object references, can affect report performance on large datasets.