Formula fields as roll-up summary aggregation sources
Key Takeaway
A roll-up summary field can use a formula field as its Field to Aggregate, but not a formula with cross-object field references or on-the-fly functions, such as TODAY.
A roll-up summary field shows a value on a master record that it calculates from the record's related detail records: a count, or the sum, minimum, or maximum of a field. The field being summarized can be a formula field on the detail object, but only if that formula stays on its own record and doesn't calculate values on the fly. The core of this topic is knowing which formulas qualify and how formula errors change the result.
Roll-up types and the Field to Aggregate
You create a roll-up summary field on the master side of a master-detail relationship. COUNT totals the number of related detail records. SUM, MIN, and MAX calculate a value from the field you pick as the Field to Aggregate.
The field types you can pick depend on the roll-up type. SUM offers only number, currency, and percent fields, while MIN and MAX also offer date and date/time fields. Auto number fields are never available as the Field to Aggregate. These normal type rules still apply when the source is a formula field.