Formula field configuration
Key Takeaway
Pick a data type that matches the output of your calculation, then set field-level security to choose which profiles can see the formula field. A cross-object formula on a page layout can expose data, because users can see the referenced field even if they don't have access to the related record.
A formula field is a custom field that gets its value from a formula. You write the formula using other fields, operators, and functions. You create a formula field like any other custom field, but you also choose the data type it returns and write the formula. A formula can also pull values from related objects, which is called a cross-object formula.
Permissions and availability
To create, change, or delete formula fields, an admin needs the "Customize Application" permission. To view formula field details, an admin needs "View Setup and Configuration". Formula fields are available in all editions, in both Salesforce Classic and Lightning Experience.