ShowAll Questionssorted byDate Posted
Tillu

# How to calculate average on Roll up field

I have a custo object  Business. and i have a field  'Amount' on this object. On Account i want to display average of this  'Amount' field. I have created a Roll Up on Account but it was giving only Count , SUM,MIN,MAX. Then How to calculate Average? for this
Puja_mfsi

Hi,

You need to create two rollup fields one for SUM and other for COUNT after that create a formula field in which divide the SUM rollup field to COUNt rollup field.

Please let me know if u have any problem on same and if this post helps u please throws KUDOS by click on star at left.

allay allay
Thanks Puja and Tillu
Suraj Tripathi 47
Hi Tillu,

Step 1 : You need to create two rollup fields one for SUM
Step 2 : For COUNT after that create a formula field in which divide the SUM rollup field to count
rollup field.

When you find the solution, mark this as best answer.

Thank you!

Regards,

Suraj Tripathi
Atul Raj 12
Seven Mentor is the best Salesforce Training provider in the town , Being old and trustworthy from decades the question for frauds doesn't exits ,at Seven Mentor we provide an environment that will be perfect for student to acquire lots of knowledge at Salesforce course in Chennai we came up with best faculty across country , under our Salesforce Training in Chennai (https://www.sevenmentor.com/salesforce-classes-in-chennai), we guarantee you to build carrier in Salesforce Department .
Chaitanya Walukar
create a two roll up summary field one for SUM it will give you back sum of total amount of all child records (if u havn't applied any filter/logi on the child records) then create 2nd roll up summary filed with Count() function it will give u back the total number of child records you have.  and now we already know the formula for calculation of Average (that is sum of amount/total no. of records in child obj (in your case) )   and now just create formule filed inside it derive the value by dividing the SUM() field by Count() filed thats it.

or you can write a trigger where u have to write a query for it. but point and click tools is good approch in this case.

Bram Rock
A roll-up summary is a field that calculates values from related records. For example, you (https://londoncarsrecovery.co.uk/) can calculate the average number of closed opportunities, or the average amount of closed opportunities, or the SUM, MIN, MAX number.