Salesforce Roll-Up Summaries vs Formula Fields: When to Use Each
Admins reach for the wrong tool more often than they'd admit. Both roll-up summaries and formula fields calculate values for you, but they solve different problems, and picking wrong means either a field that never updates or a workaround that breaks the next time someone edits a record.
What each one actually does
A roll-up summary field lives on a parent record and calculates across its child records — count them, sum a number, find the min or max. It only works on master-detail relationships, and it only calculates when a child record changes.
A formula field calculates on a single record, from that record's own fields and its related parent fields. It recalculates every time the record is viewed, and it works on both lookup and master-detail relationships.
The simplest test: are you summarising many child records into one parent number? That's a roll-up. Are you deriving a value on one record from its own data? That's a formula.
Where roll-ups win
Counting open cases on an account, summing opportunity amounts on a campaign, or finding the latest activity date on a contact's parent account — all classic roll-up jobs. They stay accurate because Salesforce recalculates them on child changes, and they don't cost you a query or a flow.
Their limits matter though. Roll-ups can't filter on complex logic beyond a basic criteria, they can't cross more than one relationship level, and they're unavailable on lookup relationships. If your child records connect via a lookup, you'll need Flow or Apex instead — this is exactly where teams end up building a scheduled flow to mimic a roll-up, and where understanding how flow run context works saves you from a flow that runs with the wrong user's permissions.
Where formulas win
Formulas shine for record-level logic: a "days since created" age field, a full-name concatenation, a discount percentage that changes with deal size, or a status flag driven by two or three fields. They need no recalculation job and no child records.
Their trap is different: a formula that references fields across too many objects becomes unreadable, and a formula used in list views or reports on huge data volumes can slow things down. If a formula starts needing data from grandchildren or unrelated objects, that's your signal to move the logic into a flow or a roll-up instead.
The decision checklist
- Many children into one parent number? Roll-up summary.
- Value derived from the record itself? Formula.
- Lookup relationship, not master-detail? Neither — use Flow (or DLRS-style tooling) for the summary.
- Needs complex filtering or cross-object aggregation? Flow or Apex.
- Needs to display instantly on every view? Formula — it's calculated at read time, never stale.
Get this choice right and your data model stays simple: no scheduled jobs babysitting numbers that Salesforce could maintain for free, and no formulas pretending to be aggregations.
Originally published at Way2Force
Top comments (0)