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
    • Sum GravityMath values for today, a custom date range, or a rolling window

    Sum GravityMath values for today, a custom date range, or a rolling window

    Estimated reading: 5 minutes

    Updated on April 23, 2026

    Use this pattern when you need the sum of a field’s values over a specific time period — for example, “total revenue entered today” or “total hours logged between 2026-04-15 and 2026-04-20.” The [gravitymath]  shortcode’s filter  parameter only accepts one condition per field, so you can’t express “between two dates” directly. Instead, you nest two shortcodes and subtract.

    Before you start #

    • You need GravityMath installed and activated.
    • You should be comfortable with the [gravitymath]  shortcode and its filter  parameter. If you aren’t, start with The [gravitymath] Shortcode and Math filters: How to target a specific field value.
    • You should be using scope="form"  or scope="view"  — the filter  parameter only works with those two scopes.

    Why you need two shortcodes #

    The filter  parameter can only hold one condition per field. You cannot write filter_date_created=2026-04-15&filter_date_created=2026-04-20  and have GravityMath interpret that as a range — the second condition overwrites the first.

    The workaround is to compute two running totals and subtract them:

    1. The sum of all entries created before the end boundary.
    2. The sum of all entries created before the start boundary.

    Subtracting (1) minus (2) leaves only the entries inside the range.

    Both sums use op_date_created=lt  (“less than”), which excludes the boundary itself. Because lt  is exclusive, the end boundary must be the day after the last date you want to include.

    Sum only today’s entries #

    This example sums field ID 6  for all entries submitted today, based on each entry’s creation date. Replace id="4"  with your form ID and {Your Field:6}  with the merge tag for the field you’re summing.

    [gravitymath]
    [gravitymath2 scope="form" id="4" filter="filter_date_created=tomorrow&op_date_created=lt"] {Your Field:6} [/gravitymath2]
    -
    [gravitymath2 scope="form" id="4" filter="filter_date_created=today&op_date_created=lt"] {Your Field:6} [/gravitymath2]
    [/gravitymath]

    How this works:

    • The first inner shortcode sums every entry created before tomorrow (midnight) — i.e. everything up to and including today.
    • The second inner shortcode sums every entry created before today (midnight) — i.e. everything from yesterday and earlier.
    • The outer [gravitymath]  subtracts the second from the first, leaving only entries created today.

    The today  and tomorrow  tokens resolve to midnight on their respective days, so the math lines up cleanly at the day boundary.

    Sum entries between two specific dates #

    Use this pattern when you need a fixed date range — for example, a monthly report or a custom reporting window. This example covers 2026-04-15 through 2026-04-20 inclusive:

    [gravitymath]
    [gravitymath2 scope="form" id="4" filter="filter_date_created=2026-04-21&op_date_created=lt"] {Your Field:6} [/gravitymath2]
    -
    [gravitymath2 scope="form" id="4" filter="filter_date_created=2026-04-15&op_date_created=lt"] {Your Field:6} [/gravitymath2]
    [/gravitymath]

    Note two things:

    • The end boundary is 2026-04-21, not 2026-04-20. Because lt  is exclusive, you need to pass the day after your last included date.
    • The start boundary is 2026-04-15 — the first date you want to include. lt 2026-04-15  excludes entries from that day, which is then cancelled out because those entries are also excluded from the end-boundary total.

    Date format: use YYYY-MM-DD #

    When passing explicit dates into the filter  parameter, use YYYY-MM-DD  format (e.g. 2026-04-21 ). Other formats such as d/m/Y  (e.g. 21/04/2026 ) may not parse reliably, even when that format is what your form’s date field displays to users. The filter_date_created  comparison runs against the stored entry timestamp, not the displayed format.

    The today  and tomorrow  relative tokens also work and resolve to midnight of the matching day.

    Filtering by a date field in the form, not the submission date #

    The examples above filter on filter_date_created , which is Gravity Forms’ built-in entry creation timestamp. If you want to filter on a date field inside the form itself (for example, an “Event date” field with ID 12 ), swap the key:

    filter="filter_12=2026-04-21&op_12=lt"

    Use the field ID in place of date_created , and date values in YYYY-MM-DD  format.

    Troubleshooting #

    Symptom: The shortcode outputs 0  or a blank value.

    Cause: Most often the date format. The filter  parameter silently fails when it can’t parse the date.

    Fix: Re-enter the date in YYYY-MM-DD  format. If it still fails, enable GravityMath debugging to see how the shortcode is being parsed.

    Symptom: The result is off by one day’s worth of entries.

    Cause: The end boundary is set to the last day you want included, not the day after.

    Fix: Because op_date_created=lt  excludes the boundary, the end date must be the day after your last included date. For “through 2026-04-20,” use 2026-04-21 .

    Symptom: The filter parameter is ignored entirely.

    Cause: Missing or incorrect scope set.

    Fix: The filter  parameter only works with scope="form"  or scope="view" . Pick one and specify the matching form or View id .

    Related #

    • Math filters: How to target a specific field value — full filter  syntax reference, including operators and multi-field conditions.
    • Nested calculations in GravityMath — the nesting pattern this article builds on.
    • How to Calculate the Sum of a Field in Gravity Forms — the starting point if you just need a running total with no date filtering.
    • The [gravitymath] Shortcode — full shortcode attribute reference.
    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
      • Before you start
      • Why you need two shortcodes
      • Sum only today’s entries
      • Sum entries between two specific dates
      • Date format: use YYYY-MM-DD
      • Filtering by a date field in the form, not the submission date
      • Troubleshooting
      • Related
      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.