Skip to content
GravityKit
Buy
Sign in
0 items

GravityKit All Access

Perform advanced calculations on your form data. Display the number of form submissions, build calculators, and much more.

  • GravityView

    GravityView

    Bestseller

    Display Gravity Forms entries on the front-end of your site and build powerful web applications.

  • GravityImport

    GravityImport

    Trending

    Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

  • GravityEdit

    GravityEdit

    Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

  • GravityCharts

    GravityCharts

    Trending

    Turn Gravity Forms entries into interactive charts and graphs.

  • GravityActions

    GravityActions

    Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

  • GravityCalendar

    GravityCalendar

    Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

  • GravityExport

    GravityExport

    Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

  • GravityMath

    GravityMath

    Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

  • GravityRevisions

    GravityRevisions

    Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

  • GravityMigrate

    GravityMigrate

    Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

  • GravityBoard

    GravityBoard

    Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

Use cases

  • Nonprofits
  • Startups
  • Education
  • Web Agencies
  • Developers
  • Government iconGovernment

Case studies

  • Princeton University
  • BrightLeaf Giving
  • Jacksonville Port Authority
  • National Severe Storms Lab
  • Leadpal
  • Mediebruket
  • Dragonfly
  • HappyTree It
View All Case Studies

  • Blog
  • Case studies
  • Support
  • Live Demos
  • Documentation ↗
  • Developer docs ↗
  • GravityKit Academy ↗
  • GravityKit Live!

Build-it guides

  • Member Directory
  • Company Intranet
  • Fundraising Dashboard
  • Real Estate Directory
  • Document Library
  • Academic Journal
  • Volunteer Management
  • Meal Tracker
  • Simple CRM System
View All Guides
  • Pricing
  • About
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment

    Case studies

    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    • HappyTree It
    View All Case Studies

    How to build...

    • Member Directory
    • Company Intranet
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    • Simple CRM System
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation ↗
    • Developer docs ↗
    • GravityKit Academy ↗
    • GravityKit Live!

    Build-it guides

    • Member Directory
    • Company Intranet
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    • Simple CRM System
    View All Guides
  • Pricing
  • About
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityBoard
    • GravityImport
    • GravityEdit
    • GravityExport
    • GravityExport Lite
    • GravityMath
    • GravityCalendar
    • GravityCharts
    • GravityActions
    • GravityRevisions
    • GravityMigrate
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GF Widget for Elementor
    • GF Zero Spam

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityBoard
      • GravityImport
      • GravityEdit
      • GravityExport
      • GravityExport Lite
      • GravityMath
      • GravityCalendar
      • GravityCharts
      • GravityActions
      • GravityRevisions
      • GravityMigrate
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GF Widget for Elementor
      • GF Zero Spam
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
    • Contact

    GravityMath

    • Add calculations to blog posts
    • Calculating Survey fields totals based on their scoring
    • Calculations in GravityView
    • Can GravityMath be used inside a Gravity Forms form?
    • Can I use [gravitymath] with [gvlogic]?
    • Can I use [gravitymath] with dates and times?
    • Can I use [gravitymath] with Multiple Forms?
    • Debugging Calculations in GravityM​ath
    • Developer Hooks for GravityMath
    • Does GravityMath support the Polls Add-on?
    • Does GravityMath support the Survey Add-on?
    • GravityMath Calculation field
    • How to add field calculations to the table footer
    • How to Calculate the Sum of a Field in Gravity Forms
    • How to display summaries using a block, widget, or shortcode
    • How to enable duration calculations in Gravity Forms with GravityMath
    • How to perform Gravity Forms time calculations in GravityView using GravityMath
    • Math filters: How to target a specific field value with [gravitymath] filters
    • Nested calculations in GravityMath
    • Pricing fields calculation
    • Sum GravityMath values for today, a custom date range, or a rolling window
    • The [gravitymath] Shortcode
    • The {entry_count} Merge Tag in Math by GravityView
    • Using GravityMath inside a GravityView Custom Content field
    • When to use GravityMath and when to use GP Advanced Calculations
    • Home
    • Docs
    • GravityMath
    • How to Calculate the Sum of a Field in Gravity Forms

    How to Calculate the Sum of a Field in Gravity Forms

    Estimated reading: 1 minutes

    Updated on April 27, 2026

    Using the [gravitymath] shortcode you can calculate the sum of a field for all entries in a form. 

    Prefer to Watch the Video?

    We need two things to find the sum of a field for all form entries:

    1. The Form ID
    2. The Merge Tag of the field we want to sum

    The shortcode will look like this:

    
    [gravitymath scope="form" id="4"] {merg tag:2} [/gravitymath]

    scope="form" tells the shortcode that we’re working with data from a form (as opposed to a View). The id value refers to the ID of your form in Gravity Forms and the merge tag should be the merge tag of the field you want to sum. Merge tags are always wrapped in curly brackets.

    Note: The default behavior for [gravitymath] is to output a sum. If you want to output a count instead, you can use the :count operator, like this: {merge_tag:2:count}.

    Finding Your Form ID:  #

    Hover over Forms in your WordPress admin menu and click on Forms, you’ll see the form ID in the first column on the right.

    Dashboard listing forms with IDs emphasized for calculation reference

    Finding the Field’s Merge Tag #

    Here’s an easy way to find the merge tag for any field in your form.

    From the form editor, hover over Settings at the top and click on Notifications.

    Gravity Forms settings menu open, highlighting the Notifications option

    Now, click Add New to create a new notification (we’re not going to save it, we’re only using this as a way to get the merge tag!).

    Notifications settings page with an "Add New" button highlighted

    Scroll down to the text editor and click on the merge tag button on the right. 

    Gravity Forms interface showing Visual and Text tabs with an arrow pointing to code button

    Now, select the name of the field you want to sum from the list.

    Dropdown menu in Gravity Forms; user selects "Number of Attendees" field

    You’ll see the field merge tag appear in the text editor. Copy it to add to your shortcode.

    Editor displaying field placeholder "{Number of Attendees:4}" in Gravity Forms

    Displaying the Sum of a Field on Your Website #

    You can add the [gravitymath] shortcode anywhere on your website! 

    As you can see, here we’ve added it to a new page.

    Guests attending shown with a Gravity Forms math shortcode for calculating number of attendees

    And on the front end, the shortcode is replaced with the sum of all values in the field.

    Text shows guest count for a Space Station event and links to an online store for flight suits

    Adding the Shortcode to a View #

    You can add the [gravitymath] shortcode to a View by pasting it inside a Custom Content field or widget.

    To do this, go to your View editor, click the Add Widget button and select Custom Content.

    Add Widget options in Gravity Forms: Search Bar, Custom Content, Gravity Forms, and Page Size

    Next, open the widget settings by clicking on the gear icon. Now, paste the shortcode inside the text editor along with any other text/HTML you want to display.

    Using Gravity Forms shortcode to calculate total guest count

    As you can see, the shortcode is replaced on the front end.

    Total number of guests attending is shown as six, with buttons for copy, CSV, and print

    To learn more about [gravitymath] and how to perform advanced calculations, read our ultimate guide to Gravity Forms calculations.

    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous écrire dans votre langue maternelle si c’est plus facile pour vous—nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta más fácil; ¡nosotros nos encargamos de la traducción!
    Sie können uns in Ihrer Muttersprache schreiben, wenn das für Sie einfacher ist – wir kümmern uns um die Übersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is — wij zorgen voor de vertaling!
    Du kan skrive til oss på ditt morsmål hvis det er enklere for deg — vi tar oss av oversettelsen!
    Du kan skriva till oss på ditt modersmål om det är lättare för dig — vi tar hand om översättningen!
    Você pode nos escrever em seu idioma nativo se for mais fácil para você — nós cuidaremos da tradução!
    Puoi scriverci nella tua lingua madre se ti è più facile — penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Stay informed?

      Was this page helpful?

      Table Of Contents
      • Finding Your Form ID: 
      • Finding the Field’s Merge Tag
      • Displaying the Sum of a Field on Your Website
      • Adding the Shortcode to a View
      GravityKit
      • How to Build It
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (“Terms”)
      About Us
      • GravityKit on Mastodon
      • GravityKit on Twitter
      • GravityKit Training Courses
      • GravityKit on Facebook
      • Join our Facebook Group
      • Facebook
      • Twitter
      Get notified of updates.

      We’re constantly improving GravityKit. Fill out your email below and we’ll notify you anytime major updates drop.

      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.