How to calculate and display form submission data
Gravity Forms can calculate values within one submission and show them in confirmations or notifications. It does not natively provide live counts, averages, totals, minimums, or maximums across entries on a page, so you need an export, custom code, or a reporting add-on for that.
- 01Define the result you need
- 02Create the form calculation
- 03Display the current result
- 04Use the manual reporting route
- 05Build a live submissions view
- 06Use GravityView for the fast way
What you need
- Gravity Forms with an existing form
- A Number, Total, or other numeric field to calculate
- Admin access to WordPress
- A page where the result should appear
Define the result you need
First decide whether you are calculating values inside one submission or summarising several submissions. A per-submission result might add prices or score fields. An aggregate result might show the number of entries, the total of a field, an average, or the lowest and highest values.
Also decide which entries count. Spam, trash, test submissions, date ranges, user-specific entries, and filtered views can all produce different results.
Create the form calculation
For a calculation based on the current submission, add a Number or Total field and enable its calculation setting. Insert the relevant field merge tags, then combine them with operators such as +, -, *, and /. Gravity Forms supports calculations in fields and can place the result in confirmations and notifications.
Use a hidden calculation field when the visitor should not see the working value but you still need it in an email, confirmation, or later workflow.
Display the current result
Open the form's confirmation or notification and insert the calculated field with the Insert Merge Tag control. This displays the value from the current entry, not a total calculated from every previous entry.
Check the number format before publishing. Currency symbols, decimal separators, empty fields, and values stored as text can make a correct formula look wrong.
Use the manual reporting route
For a one-off report, export the entries from the Gravity Forms Entries screen as a CSV and calculate the count, sum, average, minimum, or maximum in a spreadsheet. This is the simplest manual route and is fine when the result does not need to update automatically.
For a live result without an add-on, a developer must query the entries with Gravity Forms' API methods, apply the required filters, calculate the result, and output it through a shortcode or template. Gravity Forms documents API methods for retrieving, counting, and checking entries, but the page output, permissions, caching, and security are your responsibility.
Build a live submissions view
If visitors need to see individual submissions as well as summary figures, create a front-end entry view and decide which fields are public. Do not expose email addresses, payment details, internal notes, or other private fields merely because they are present in the entry.
Apply the same filters to the rows and the calculation. A common mistake is showing a filtered list while calculating against every entry, which makes the displayed total disagree with the visible records.
Use GravityView for the fast way
For a live, no-code result, use GravityView with its mathematical calculation functionality. Create a view for the form, select the fields to display, then add calculations for counts, sums, averages, minimums, or maximums. The calculation can be scoped to the form, the view, or the entries currently visible after filtering.
Place the view on a page using its provided embed or shortcode option, then test it with empty values, filtered results, and a newly submitted entry. This is usually the quickest route when you need a maintained front-end report rather than a one-time CSV calculation.
Let GravityView do it
Calculates counts, averages, totals, and extremes from form entries; useful when built-in submission views lack aggregate data.
Sources
- gravityforms.com /blog/gravity-forms-calculations-tutorial/?utm_source=openai
- community.gravityforms.com /t/get-the-sum-total-from-a-field-across-all-entries/16103?u…
- gravitykit.com /docs/gravitymath/entry-count-merge-tag/?utm_source=openai
Questions
- Can Gravity Forms total all previous submissions by itself?
- No, Gravity Forms' built-in calculation fields work primarily with values from the current submission. They can show that result in a confirmation or notification, but a live total, average, or count across stored entries needs an export, custom code using the entries API, or an add-on that provides aggregate calculations.
- How do I calculate an average from form entries?
- Calculate the sum of the numeric field and divide it by the number of entries included in the same scope. With a calculation add-on, use its entry-count value so the average follows the form or filtered view. Check how empty, non-numeric, spam, and trashed entries are handled before publishing the result.
- Why does my displayed total not match the entries list?
- The calculation and the list are probably using different scopes or filters. Check whether the total includes spam, trash, test entries, empty values, or entries outside the selected date or category filter. Also check whether a cached page is showing an older result after a new submission.
- Can I display a calculated value in a confirmation message?
- Yes, calculate the value in a Number, Total, or hidden calculation field and insert that field's merge tag into the confirmation message. This works for values based on the current submission. It does not, by itself, calculate an aggregate across all stored entries.
- What is the quickest way to show counts and totals on a WordPress page?
- Use GravityView with its mathematical calculation functionality when the result must update from stored entries and appear in a front-end view. You can configure the displayed fields, apply filters, and show counts, totals, averages, or extremes without maintaining a custom query and shortcode.