---
schema_version: "1"
id: 12aca89be22e3b2d6c249e3befb85aae1e27f3a1b3a8c70efe6f41703f348929
title: Evaluate Report Data with Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/reports_formulas_overview.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.reports_formulas_overview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fe71adc022c87853adc6054ea9c702d1fd40cb5f83f5fa14b3ea3b8d59a1e208
description: Reports feature built-in basic math functions (sum, average, min, and max) that you can apply to any numerical column in a report. When you're ready to perform advanced logical or mathematical operations, write a formula.
products:
  - Cross Cloud
release: "264"
---
# Evaluate Report Data with Formulas

Reports feature built-in basic math functions (sum, average, min, and max) that you can apply to any numerical column in a report. When you're ready to perform advanced logical or mathematical operations, write a formula.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enhanced Folder Sharing</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="vertical-align:top;" id="d53730e88">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d53730e88 ">To create, edit, and delete formulas in private reports:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d53730e88 ">
              <dl>

                <dt style="font-weight:bold;padding-top:.25rem;">Enhanced Folder Sharing</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Create and Customize Reports </dd>

              </dl>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d53730e88 ">To create, edit, and delete formulas in public and private reports:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d53730e88 ">
              <dl>

                <dt style="font-weight:bold;padding-top:.25rem;">Enhanced Folder Sharing</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">
                  <p style="margin-bottom:0;">Report Builder OR Report Builder (Lightning Experience)</p>
                </dd>

              </dl>
            </td>

          </tr>
        </tbody>
      </table>

There are three types of formulas, summaries, summary formulas, and row-level formulas. The type of formula you write depends in part on where you want that formula to apply.

## Summaries

Summaries are mathematical functions that you can apply to numeric columns in a report. Apply summaries to find the sum, average, minimum, or maximum value. Summaries evaluate data in and show subtotals for each report group, plus a grand total for all data in the report. No need to write a formula to find these essential math functions; instead, apply them from a numeric column's More Actions menu.

Apply a summary to answer business questions like these:

- What is the total value of all our open opportunities?
- What is the average age of all our cases?
- Which of our accounts has the most employees, and which has the least?

## Row-level Formulas

Row-level formulas apply to every record in a report, and can evaluate data mathematically or logically. For example, use a row-level formula in an opportunity report to subtract Created Date from Close Date to how long it took to close each opportunity. Write another row-level formula to flag each opportunity with an emoticon based on whether customer satisfaction score (CSAT) is above 9, above 6, or below 6.

Write a row-level formula to answer business questions like these:

- How many days did it take each opportunity to close?
- Which case subjects contain the word "widget"?
- As defined by a customer satisfaction (CSAT) score, which customers are satisifed or upset?

## Summary Formulas

Summary formulas evaluate data in either a specified group, all groups, or all groups and the entire report. If an opportunity report is grouped by Type and Stage, a summary function can apply to any of these places:

- Just to Type
- Just to Stage
- Just to the grand total of all report data
- To Type, Stage and the grand total of all report data

Summary formulas are perfect for comparing grouped data to other groups or to report totals. For example, write a summary formula to evaluate cases by source or product.

Write a summary formula to answer business questions like these:

- After deducting taxes and expenses, what are our net earnings?
- What percentage of our opportunities are attributable to each lead source?

## PREVGROUPVAL() and PARENTGROUPVAL()

`PREVGROUPVAL()` and `PARENTGROUPVAL()` are two types of special summary formulas that are particular useful in reporting. Use `PREVGROUPVAL()` to compare one group to other groups in the report. Use `PARENTGROUPVAL()` to compare a child group to a parent group or to a report total.

Write summary formulas with `PREVGROUPVAL()` and `PARENTGROUPVAL()` to answer business questions like these:

- `PREVGROUPVAL()`: How much more or less business did we do in February compared to January?
- `PARENTGROUPVAL()`: In which month did we do the most business last year?

1. **[Summarize Report Data](https://help.salesforce.com/s/articleView?id=analytics.reports_builder_fields_summaries.htm&release=264.0.0&type=5)**  
    When you want to know sum, average, highest, or lowest value of a numeric column (like Amount, Age, or Probability), summarize the column. Summaries calculate subtotals for every group in a report, as well as a grand total for all report data.
2. **[Evaluate Each Record in Reports with Row-Level Formulas](https://help.salesforce.com/s/articleView?id=analytics.reports_formulas_row_level.htm&release=264.0.0&type=5)**  
    Answer business questions like "how many days did it take each opportunity to close?" by using row-level formulas that evaluate each record in a report.
3. **[Evaluate Groups and Totals with Summary Formulas](https://help.salesforce.com/s/articleView?id=analytics.reports_builder_fields_formulas.htm&release=264.0.0&type=5)**  
    Write summary formulas to evaluate a report's group subtotals and grand totals. For example, summary formulas can adjust earnings after tax.
4. **[Compare Groups with PARENTGROUPVAL() and PREVGROUPVAL()](https://help.salesforce.com/s/articleView?id=analytics.reports_formulas_parentgroupval_prevgroupval.htm&release=264.0.0&type=5)**  
    Write row level formulas to evaluate each record in a report. For example, see how many days it took each opportunity to close by subtracting the Open Date from the Close Date.