This article provides ready-to-use report formula examples for the most common calculation needs in Salesforce reports. Use these formulas directly in the Report Builder under Add Column → Formula.
Applies to: Summary reports, matrix reports, and tabular reports in Lightning Experience and Salesforce Classic.
Salesforce report formulas use a specific set of functions. Unlike spreadsheet formulas, report formulas reference fields by API name and have two types: summary formulas (calculated at a group level) and row-level formulas (calculated per record). Choosing the wrong type is a common source of errors.
Use case: Calculate days to close, days since last activity, or age of a record.
Type: Row-Level Formula | Return Type: Number
CloseDate - CreatedDateConvertedDate - CreatedDateROUND(CloseDate - CreatedDate, 0)Use case: Display a 15-character ID instead of the 18-character version for use in external systems or comparisons.
Type: Row-Level Formula | Return Type: Text
LEFT(Id, 15)Use case: Show what percentage each row or group contributes to the grand total. Requires a summary report with at least one grouping.
Type: Summary Formula | Return Type: Percent
RowCount / PARENTGROUPVAL(RowCount, GRAND_SUMMARY)RowCount with your summary field (e.g., Amount__c:SUM) to calculate percentage of revenue by group.Use case: Group or sort records by day of the week in chronological order (Mon=1, Tue=2, etc.) rather than alphabetical order.
Type: Row-Level Formula | Return Type: Number
CASE(MOD(ActivityDate - DATE(1900,1,7), 7), 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 0)Use case: Calculate the percentage of closed opportunities that were won. Requires a summary report grouped by Stage or Owner.
Type: Summary Formula | Return Type: Percent
ROUND(your_formula, 2) to display two decimal places.IF(condition, value_if_true, value_if_false). For multiple conditions, use nested IF() or the CASE() function.005385906

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.