While working as a Salesforce Administrator, I was assigned the task of calculating the sum of the amount fields from all related child records and displaying that total sum on the parent record. We can use a formula to calculate it, but the rollup summary field makes it very easy.
In this Salesforce tutorial, we will learn about the roll-up summary field in Salesforce. In that, we will discuss the following points:
- What is the roll-up summary field in Salesforce?
- Limitations of rollup summary field in Salesforce.
- Example 1- Create a roll-up summary field in Salesforce.
- Example 2- Create a roll-up summary field using filter criteria in Salesforce.
- Example 3- Create a roll-up summary field using MIN type in Salesforce.
What is the Roll-Up Summary Field in Salesforce?
In Salesforce, the rollup summary field is used to aggregate or summarize the data of related child records and display that data on the parent record in a master-detail relationship.
- We can create a rollup summary field only when two standard or custom objects are in the master-detailed relationship.
- We can create the rollup summary field on the parent or master side only.
- The roll-up summary field is read-only. We cannot edit or modify it.
There are Four Roll-Up Types in Salesforce
The following roll-up types are used as functions in the roll-up summary field. These functions calculate data automatically and display it on the parent object.
- COUNT: This function counts the total number of related child records and displays them on the parent object in the rollup summary field.
- SUM: This function calculates the sum of the fields from all related child records.
- MIN: This function displays the minimum value from the related child record on the parent record.
- MAX: This function displays the maximum value from the related child record on the parent record.
Note: We don’t need to select a particular field while using the count function. However, the other three functions perform on a particular field.
Limitations of Roll-Up Summary Field in Salesforce
Following are the limitations of the rollup summary field in Salesforce.
- In the roll-up summary, we can perform only four types of operations.
- Then, we cannot create a rollup summary field on the lookup relationship.
- Then, for the SUM, MIN, and MAX operations, we can use only certain fields, such as number, currency, and percentage fields.
- There is a limit to creating a rollup summary per object. We can create only 25 rollup summary fields, but it can vary depending on the Salesforce edition.
Example 1- Create a Roll-Up Summary Field in Salesforce
For example, I was working on an account and opportunity object, and I was assigned the task of calculating the number of records related to a particular parent record on the account.
- So here, to calculate the child record, the simplest way is to use the roll-up summary field on the parent(account) object.
We can create a rollup summary field in Salesforce using the following steps.
1. Click on the Gare icon. -> Setup. -> Object Manager.-> Account. Then click on Fields & Relationships.
- Now, we are creating a new rollup summary field. To do so, click on the New button.

2. Select Roll-Up Summary Data Type and then click on the Next button.

3. Now, enter the Field Label. It will be displayed on the record detail page. The Field Name is the API Name, and it will automatically populate.

4. Then, select Summarised Object. As you click on it, it will display all objects that are in a master-detail relationship with the account object.
- Select Roll-Up Type, basically, these are the functions. Here, as per our scenario, we have to select the Count roll-up type.
- In the filter criteria I have selected, all records should be included. In the next option, we will see another option.
After that, click on the Next button.

5. Then select Field Level Security, to which profile this field will be available to use. Then add the on the account Page Layout. Click on the Save button.

6. Now, to check whether how the count rollup type works, navigate to the account object tab and select any account record you will see the rollup field with the field label that you entered.
In that field you can see, their is dispyaed number of record which are related to the selected account.

This is how we can create a rollup summary field in Salesforce.
Example 2- Create a Roll-Up Summary Field Using Filter Criteria in Salesforce
In this scenario, we will see how to use filter criteria in the rollup summary field. Let’s take an example: I was assigned the task of calculating the total amount of all related child records from an opportunity object whose opportunity Stage is ‘Closed Won.’
In the following steps, I have explained how to create a roll-up summary field using filter criteria in Salesforce.
1. Click on Setup. -> Object Manager. -> Select object. Here, I selected the Account object.
- Then click on the Field & Relationships. -> Click on the New button.
2. Select Roll-Up Summary Data Tye and click the Next button.
- Now, enter the Field Label. It will be displayed on the record detail page. The Field Name is the API Name, and it will automatically populate.
3. Then, select Summarised Object. Then, select Roll-Up Type. Here, as per our scenario, we have to select the Sum roll-up type.
- Then, while using the sum rollup type, we must select the Field to Aggregate option. As you click on it, it will display a summarised object field that can be calculated. Here, I selected the Amount field.
- In the Filter Criteria, we will now select only records meeting certain criteria; as you click on it, you need to define the criteria.
- Stage = Closed Won.
That means now this rollup summary field calculates the sum of the amount of only those records, which is equal to the defined criteria and that sum will display on the parent record.
After that, click on the Next button.

4. Set the Field Level Security, add a field on the Page Layout. and then Save the rollup summary field.
5. Now, navigate to the account object tab and select any record. You will see that I created two rollup summary fields for the sum of amount.
- The first one is with a filter, and the second one is without a filter, and there is a clear difference in both fields.

This is how we can create a roll-up summary field using filter criteria in Salesforce.
Example 3- Create a Roll-Up Summary Field Using MIN Type in Salesforce
Let us suppose you work for a manufacturing company that makes various products across different manufacturing plants. Every workshop has its own set of production run and recorded in the Salesforce and you want to trace the minimum production time for every product across every workshop.
- In Salesforce, we have two objects, Production, and Manufacturing Plant, and we will create a roll-up summary field named Minimum Production Time with roll-up type MIN on the Production object.
- This minimum roll-up type calculates the minimum production time across all the related manufacturing plants.

With this, we have seen a few possibilities for using the Salesforce roll-up summary field.
Conclusion
I hope you now have an idea of the roll-up summary field in Salesforce and its type, as well as roll-up summary field types. We also have seen limitations of the roll-up summary field.
Then, we have seen a real-time example, and I explained how we can create a rollup summary field with and without using filter criteria in Salesforce.
You may also like to read the following Salesforce tutorials.
- How to Create Roll-Up Summary Field using Salesforce Flow
- How to Change Field Type in Salesforce
- Convert Master-Details Relationship into Lookup in Salesforce
- Field Dependency in Salesforce
- How to Create an External ID in Salesforce?
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.