Creating Formula fields in Salesforce :  Formulas are those which are used to calculate something, combine data from multiple fields, to check for a condition, to show information from one record on a related record.These formulas will be simple or complex with layers of nested logic s. Formula fields is based on other fields values and it is shown only in detailed view of an object and can not be viewed in editable view of an object.

 creating Formula field in Salesforce ?

Go to Setup => Build => Create => Object => Select object => Custom Fields & Relationships => Click new => Formula.

Now we are creating Formula field for student object to calculate average of three subjects F = ( S1+ S2 + S3) /3.

Go to detail view of the object.

Go to Custom fields and relationships and create new.

Now select formula which is of type number and Click next.Formulae fields in Salesforce

  • Now provide all the details like field label and field name . For formula return type select with decimal places zero.
  • A formula editor is shown with two tabs. 1.Simple formula and Advanced Formula.

Select the tab Advanced Formula you can observe function with right extreme which can be used. While writing this formula in the editor we can see two field in inside fields and outside fields to refer to the fields in the object.

In the formula editor provide the Formula given.

Now check the visibility at the top to give accessibility of this field to every profile.

Finally Save it.

Now go to your Student object create record and fill S1, S2, S3 subject marks and save it. In editable view formula field is not available . In Detailed view of the record you can view Formula.